mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-03-23 15:26:37 -04:00
add gpgme error output
git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@1737 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
090ea53d72
commit
62452ed3c5
@ -1360,14 +1360,15 @@ bool GPGAuthMgr::getPGPAllList(std::list<std::string> &ids)
|
||||
bool GPGAuthMgr::decryptText(gpgme_data_t CIPHER, gpgme_data_t PLAIN) {
|
||||
RsStackMutex stack(pgpMtx); /******* LOCKED ******/
|
||||
|
||||
if (GPG_ERR_NO_ERROR != gpgme_op_decrypt (CTX, CIPHER, PLAIN))
|
||||
gpg_error_t ERR;
|
||||
if (GPG_ERR_NO_ERROR != (ERR = gpgme_op_decrypt (CTX, CIPHER, PLAIN)))
|
||||
{
|
||||
std::cerr << "Error decrypting text";
|
||||
ProcessPGPmeError(ERR);
|
||||
std::cerr << "GPGAuthMgr::decryptText() Error decrypting text.";
|
||||
std::cerr << std::endl;
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -1375,11 +1376,13 @@ bool GPGAuthMgr::encryptText(gpgme_data_t PLAIN, gpgme_data_t CIPHER) {
|
||||
RsStackMutex stack(pgpMtx); /******* LOCKED ******/
|
||||
|
||||
gpgme_encrypt_flags_t* flags = new gpgme_encrypt_flags_t();
|
||||
gpgme_key_t keys[2] = {mOwnGpgCert.key, NULL};
|
||||
gpgme_key_t keys[2] = {mOwnGpgCert.key, NULL};
|
||||
|
||||
if (GPG_ERR_NO_ERROR != gpgme_op_encrypt(CTX, keys, *flags, PLAIN, CIPHER))
|
||||
gpg_error_t ERR;
|
||||
if (GPG_ERR_NO_ERROR != (ERR = gpgme_op_encrypt(CTX, keys, *flags, PLAIN, CIPHER)))
|
||||
{
|
||||
std::cerr << "Error encrypting text";
|
||||
ProcessPGPmeError(ERR);
|
||||
std::cerr << "GPGAuthMgr::encryptText() Error encrypting text.";
|
||||
std::cerr << std::endl;
|
||||
return false;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user