diff options
author | Ubbo Veentjer <[email protected]> | 2017-12-30 23:50:55 +0000 |
---|---|---|
committer | Ubbo Veentjer <[email protected]> | 2017-12-30 23:50:55 +0000 |
commit | d327c06ebb5138359e875e8f9a7ac242de45c158 (patch) | |
tree | 653664e755ddbfcc00389e2a0075a2a2386536b1 /gpgcontext.cpp | |
parent | recommit of a06539af3448396f56a44d6859f2a54b787cdd8d (sign files integrated) (diff) | |
download | gpg4usb-d327c06ebb5138359e875e8f9a7ac242de45c158.tar.gz gpg4usb-d327c06ebb5138359e875e8f9a7ac242de45c158.zip |
verify files readded (4ecc173307c8c1ed13f28b6955484a484a25402a to 7c874c55c8242baaa770c46718a5c66b3bf8284a)
Diffstat (limited to 'gpgcontext.cpp')
-rw-r--r-- | gpgcontext.cpp | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/gpgcontext.cpp b/gpgcontext.cpp index b9c2567..8f7c07e 100644 --- a/gpgcontext.cpp +++ b/gpgcontext.cpp @@ -590,12 +590,14 @@ void GpgContext::executeGpgCommand(QStringList arguments, QByteArray *stdOut, QB } /*** + * if sigbuffer not set, the inbuffer should contain signed text + * * TODO: return type should contain: * -> list of sigs * -> valid * -> errors */ -gpgme_signature_t GpgContext::verify(QByteArray inBuffer) { +gpgme_signature_t GpgContext::verify(QByteArray *inBuffer, QByteArray *sigBuffer) { int error=0; gpgme_data_t in; @@ -603,10 +605,16 @@ gpgme_signature_t GpgContext::verify(QByteArray inBuffer) { gpgme_signature_t sign; gpgme_verify_result_t result; - err = gpgme_data_new_from_mem(&in, inBuffer.data(), inBuffer.size(), 1); + err = gpgme_data_new_from_mem(&in, inBuffer->data(), inBuffer->size(), 1); checkErr(err); - err = gpgme_op_verify (mCtx, in, NULL, in); + 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, in, NULL); + } else { + err = gpgme_op_verify (mCtx, in, NULL, in); + } error = checkErr(err); if (error != 0) { |