diff ui/administratorwindow.cpp @ 679:75cd2fbf9ac6

(Issue 9) Log key's sha256 fingerprint
author Andre Heinecke <andre.heinecke@intevation.de>
date Mon, 30 Jun 2014 17:21:44 +0200
parents c9d296f04995
children 0b7bb4f68f5a
line wrap: on
line diff
--- a/ui/administratorwindow.cpp	Mon Jun 30 15:41:13 2014 +0200
+++ b/ui/administratorwindow.cpp	Mon Jun 30 17:21:44 2014 +0200
@@ -224,7 +224,7 @@
     }
 }
 
-void AdministratorWindow::logChanges(const QString &currentCerts)
+void AdministratorWindow::logChanges(const QString &currentCerts, const QString& keyFingerprint)
 {
     QDir logDir(QStandardPaths::writableLocation(QStandardPaths::DataLocation));
     QString logFilePath = logDir.filePath("log.txt");
@@ -239,7 +239,7 @@
 
     CertificateList newCertList;
     newCertList.readList(currentCerts.toLocal8Bit());
-    QByteArray entries = createLogEntries(newCertList);
+    QByteArray entries = createLogEntries(newCertList, keyFingerprint);
     if(logFile.write(entries) != entries.size()) {
         QMessageBox::warning(this, tr("Error!"), tr("Failed to write log file: ") +
                 logFilePath + tr(" Changes are not logged!"));
@@ -248,7 +248,7 @@
     logFile.close();
 }
 
-QByteArray AdministratorWindow::createLogEntries(const CertificateList &list)
+QByteArray AdministratorWindow::createLogEntries(const CertificateList &list, const QString& keyFingerprint)
 {
     QByteArray entries;
     QByteArray removeListEntries;
@@ -265,7 +265,9 @@
         listDate.toString(Qt::ISODate) +
         "#####\r\n");
     entries.append(tr("signing certificate: \r\n"));
-    entries.append(tr("new certificates:\r\n"));
+    entries.append(keyFingerprint);
+
+    entries.append(tr("\r\nnew certificates:\r\n"));
 
     foreach (const Certificate& cert, list.getCertificates()) {
         if (!mCertList.getCertificates().contains(cert)) {

http://wald.intevation.org/projects/trustbridge/