diff options
author | Saturneric <[email protected]> | 2021-07-05 05:29:00 +0000 |
---|---|---|
committer | Saturneric <[email protected]> | 2021-07-05 05:29:00 +0000 |
commit | 30f7a94d405977f1a4a88b8c29632c00c0c8529d (patch) | |
tree | 02a6f5e5b982cedde6c9300db7ed4e59d73084bc /src/gpg/GpgContext.cpp | |
parent | Improve the access method and interface of fast file operation (diff) | |
download | GpgFrontend-30f7a94d405977f1a4a88b8c29632c00c0c8529d.tar.gz GpgFrontend-30f7a94d405977f1a4a88b8c29632c00c0c8529d.zip |
Fix the logic problem of the signature and encryption function.
Update documentation.
Diffstat (limited to '')
-rw-r--r-- | src/gpg/GpgContext.cpp | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/gpg/GpgContext.cpp b/src/gpg/GpgContext.cpp index 67bae907..2834ced5 100644 --- a/src/gpg/GpgContext.cpp +++ b/src/gpg/GpgContext.cpp @@ -959,8 +959,10 @@ namespace GpgME { void GpgContext::setSigners(const QVector<GpgKey> &keys) { gpgme_signers_clear(mCtx); for (const auto &key : keys) { - auto gpgmeError = gpgme_signers_add(mCtx, key.key_refer); - checkErr(gpgmeError); + if(checkIfKeyCanSign(key)) { + auto gpgmeError = gpgme_signers_add(mCtx, key.key_refer); + checkErr(gpgmeError); + } } if (keys.length() != gpgme_signers_count(mCtx)) { qDebug() << "No All Keys Added"; @@ -1174,6 +1176,10 @@ namespace GpgME { } } } + + if(gpgme_err_code(err) != GPG_ERR_NO_ERROR) + checkErr(err); + if (dataIn) { gpgme_data_release(dataIn); } |