diff options
author | ubbo <ubbo@34ebc366-c3a9-4b3c-9f84-69acf7962910> | 2012-05-01 11:46:42 +0000 |
---|---|---|
committer | ubbo <ubbo@34ebc366-c3a9-4b3c-9f84-69acf7962910> | 2012-05-01 11:46:42 +0000 |
commit | 2966d6ffa465a38c28ab4914ffefe9330b424553 (patch) | |
tree | d69591b22c47834d71c20cc73c6eaff4e7ba550e | |
parent | verify for files (not yet working) (diff) | |
download | gpg4usb-2966d6ffa465a38c28ab4914ffefe9330b424553.tar.gz gpg4usb-2966d6ffa465a38c28ab4914ffefe9330b424553.zip |
verify file working now
git-svn-id: http://cpunk.de/svn/src/gpg4usb/trunk@910 34ebc366-c3a9-4b3c-9f84-69acf7962910
-rwxr-xr-x | fileencryptiondialog.cpp | 6 | ||||
-rw-r--r-- | gpgcontext.cpp | 2 | ||||
-rw-r--r-- | verifydetailsdialog.cpp | 4 |
3 files changed, 7 insertions, 5 deletions
diff --git a/fileencryptiondialog.cpp b/fileencryptiondialog.cpp index 4e652a6..bc4352f 100755 --- a/fileencryptiondialog.cpp +++ b/fileencryptiondialog.cpp @@ -118,12 +118,14 @@ void FileEncryptionDialog::selectInputFile() inputFileEdit->setText(infileName); // try to find a matching output-filename, if not yet done - if (infileName > 0 && outputFileEdit->text().size() == 0) { + if (infileName > 0 + && outputFileEdit->text().size() == 0 + && signFileEdit->text().size() == 0) { if (mAction == Encrypt) { outputFileEdit->setText(infileName + ".asc"); } else if (mAction == Sign) { outputFileEdit->setText(infileName + ".sig"); - } else if (mAction == Sign) { + } else if (mAction == Verify) { signFileEdit->setText(infileName + ".sig"); } else { if (infileName.endsWith(".asc", Qt::CaseInsensitive)) { diff --git a/gpgcontext.cpp b/gpgcontext.cpp index 78a124c..5884c14 100644 --- a/gpgcontext.cpp +++ b/gpgcontext.cpp @@ -611,7 +611,7 @@ gpgme_signature_t GpgContext::verify(QByteArray *inBuffer, QByteArray *sigBuffer if (sigBuffer != NULL ) { gpgme_data_t sigdata; err = gpgme_data_new_from_mem(&sigdata, sigBuffer->data(), sigBuffer->size(), 1); - err = gpgme_op_verify (mCtx, sigdata, NULL, in); + err = gpgme_op_verify (mCtx, sigdata, in, NULL); } else { err = gpgme_op_verify (mCtx, in, NULL, in); } diff --git a/verifydetailsdialog.cpp b/verifydetailsdialog.cpp index 557646e..5fcedc8 100644 --- a/verifydetailsdialog.cpp +++ b/verifydetailsdialog.cpp @@ -55,9 +55,7 @@ void VerifyDetailsDialog::refresh() //mCtx->preventNoDataErr(&text); gpgme_signature_t sign; if(mInputSignature != 0) { - qDebug() << "insig: " << *mInputSignature; sign = mCtx->verify(mInputData, mInputSignature); - qDebug() << gpg_err_code(sign->status); } else { sign = mCtx->verify(mInputData); } @@ -69,6 +67,8 @@ void VerifyDetailsDialog::refresh() // Set the title widget depending on sign status if(gpg_err_code(sign->status) == GPG_ERR_BAD_SIGNATURE) { mVboxLayout->addWidget(new QLabel(tr("Error Validating signature"))); + } else if (mInputSignature != 0) { + mVboxLayout->addWidget(new QLabel(tr("File was signed on <br/> %1 by:<br/>").arg(timestamp.toString(Qt::SystemLocaleLongDate)))); } else { switch (mCtx->textIsSigned(*mInputData)) { |