Mercurial > trustbridge
changeset 1394:8d27c6d226cd
Improve debug output for list verification and no installed list
author | Andre Heinecke <andre.heinecke@intevation.de> |
---|---|
date | Fri, 23 Jan 2015 15:25:50 +0100 |
parents | a9dcf6c86d19 |
children | a2574a029322 |
files | common/listutil.c ui/main.cpp ui/mainwindow.cpp |
diffstat | 3 files changed, 10 insertions(+), 5 deletions(-) [+] |
line wrap: on
line diff
--- a/common/listutil.c Mon Jan 19 15:45:28 2015 +0100 +++ b/common/listutil.c Fri Jan 23 15:25:50 2015 +0100 @@ -135,6 +135,7 @@ if (!data || !size) { + ERRORPRINTF ("Invalid call.\n"); return -1; } @@ -142,7 +143,8 @@ p = strchr(data, '\r'); if (p == 0 || (unsigned int)(p - (data + 2)) != sig_b64_size) { - /* printf("Invalid data. Signature might be too long.\n"); */ + DEBUGPRINTF("Invalid data. Signature might be too long.\n"); + DEBUGPRINTF("Should: %u is: %u\n", sig_b64_size, (unsigned int)(p - (data + 2))); return -1; } strncpy(signature_b64, data + 2, sig_b64_size); @@ -153,7 +155,7 @@ if (ret != 0 || sig_size != TRUSTBRIDGE_RSA_KEY_SIZE / 8) { - /* printf("failed to decode signature\n"); */ + DEBUGPRINTF("failed to decode signature\n"); return -1; }
--- a/ui/main.cpp Mon Jan 19 15:45:28 2015 +0100 +++ b/ui/main.cpp Fri Jan 23 15:25:50 2015 +0100 @@ -122,7 +122,7 @@ printf (APPNAME " Version: %s \n", QApplication::applicationVersion().toLocal8Bit().constData()); #ifndef RELEASE_BUILD - printf ("Test Version! - Not for productive use!\n"; + printf ("Test Version! - Not for productive use!\n"); #endif printf (COPYRIGHT); return 0;
--- a/ui/mainwindow.cpp Mon Jan 19 15:45:28 2015 +0100 +++ b/ui/mainwindow.cpp Fri Jan 23 15:25:50 2015 +0100 @@ -234,6 +234,8 @@ if (!mListToInstall.isValid()) { handleLTE(lteInvalidList); mCurState = TransferError; + qDebug() << "Failed to validate certificate list. Removing: " << availableFileName; + qDebug() << "State: " << mListToInstall.getStatus(); QFile::remove(availableFileName); mSettings.remove("List/available"); mSettings.remove("List/availableDate"); @@ -318,13 +320,14 @@ qDebug() << "List already handled"; return; } else { - qDebug() << "Handling list"; + qDebug() << "Handling list: " << fileName << " Date: " << modDate; } mSettings.setValue("List/available", fileName); mSettings.setValue("List/availableDate", modDate); verifyListData(); - if (!mListToInstall.isValid() || mListToInstall.date() <= mInstalledList.date()) { + if (!mListToInstall.isValid() || (mInstalledList.isValid() && + mListToInstall.date() <= mInstalledList.date()) ) { if ( mListToInstall.date() <= mInstalledList.date()) { qDebug() << "Newest list on the server is older then the installed list. "; qDebug() << "Installed: " << mInstalledList.date();