diff options
author | Saturneric <[email protected]> | 2021-07-20 19:01:06 +0000 |
---|---|---|
committer | Saturneric <[email protected]> | 2021-07-20 19:01:06 +0000 |
commit | 69e33d6eeef7d77385d21c5b969df76cb0fbc0e7 (patch) | |
tree | 333861b3e1691dd720c410388639a429458c5eb5 /src/gpg/GpgContext.cpp | |
parent | Fix problem that macos cannot use multi-languages. (diff) | |
download | GpgFrontend-69e33d6eeef7d77385d21c5b969df76cb0fbc0e7.tar.gz GpgFrontend-69e33d6eeef7d77385d21c5b969df76cb0fbc0e7.zip |
Fix Keygen Problem
Diffstat (limited to 'src/gpg/GpgContext.cpp')
-rw-r--r-- | src/gpg/GpgContext.cpp | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/src/gpg/GpgContext.cpp b/src/gpg/GpgContext.cpp index 0462433d..72c04ac9 100644 --- a/src/gpg/GpgContext.cpp +++ b/src/gpg/GpgContext.cpp @@ -197,7 +197,7 @@ namespace GpgME { /** Generate New Key with values params * */ - bool GpgContext::generateKey(GenKeyInfo *params) { + gpgme_error_t GpgContext::generateKey(GenKeyInfo *params) { auto userid_utf8 = params->getUserid().toUtf8(); const char *userid = userid_utf8.constData(); @@ -232,12 +232,12 @@ namespace GpgME { err = gpgme_op_createkey(mCtx, userid, algo, 0, expires, nullptr, flags); - if (err != GPG_ERR_NO_ERROR) { + if (gpgme_err_code(err) != GPG_ERR_NO_ERROR) { checkErr(err); - return false; + return err; } else { emit signalKeyDBChanged(); - return true; + return err; } } @@ -986,10 +986,10 @@ namespace GpgME { } } - bool GpgContext::generateSubkey(const GpgKey &key, GenKeyInfo *params) { + gpgme_error_t GpgContext::generateSubkey(const GpgKey &key, GenKeyInfo *params) { if (!params->isSubKey()) { - return false; + return GPG_ERR_CANCELED; } auto algo_utf8 = (params->getAlgo() + params->getKeySizeStr()).toUtf8(); @@ -1022,12 +1022,12 @@ namespace GpgME { auto gpgmeError = gpgme_op_createsubkey(mCtx, key.key_refer, algo, 0, expires, flags); - if (gpgmeError == GPG_ERR_NO_ERROR) { + if (gpgme_err_code(gpgmeError) == GPG_ERR_NO_ERROR) { emit signalKeyUpdated(key.id); - return true; + return gpgmeError; } else { checkErr(gpgmeError); - return false; + return gpgmeError; } } |