mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-05-03 14:45:12 -04:00
encrypt and decrypt ssl password
git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@1550 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
128aa9ceda
commit
0a28f35eea
4 changed files with 94 additions and 11 deletions
|
@ -1343,6 +1343,36 @@ bool GPGAuthMgr::getPGPAllList(std::list<std::string> &ids)
|
|||
return true;
|
||||
}
|
||||
|
||||
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))
|
||||
{
|
||||
std::cerr << "Error decrypting text";
|
||||
std::cerr << std::endl;
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
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();
|
||||
|
||||
if (GPG_ERR_NO_ERROR != gpgme_op_encrypt(CTX, NULL, *flags, PLAIN, CIPHER))
|
||||
{
|
||||
std::cerr << "Error encrypting text";
|
||||
std::cerr << std::endl;
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool GPGAuthMgr::getPGPAuthenticatedList(std::list<std::string> &ids)
|
||||
{
|
||||
RsStackMutex stack(pgpMtx); /******* LOCKED ******/
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue