fixed assert crash due to using non RSA key

git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@6424 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
csoler 2013-06-11 20:51:39 +00:00
parent b427d5a4f2
commit d5c645e383

View File

@ -1027,6 +1027,11 @@ bool PGPHandler::encryptDataBin(const PGPIdType& key_id,const void *data, const
std::cerr << "PGPHandler::encryptTextToFile(): ERROR: supplied id did not return a public key!" << std::endl;
return false ;
}
if(public_key->key.pkey.algorithm != OPS_PKA_RSA)
{
std::cerr << "PGPHandler::encryptTextToFile(): ERROR: supplied key id " << key_id.toStdString() << " is not an RSA key (DSA for instance, is not supported)!" << std::endl;
return false ;
}
ops_create_info_t *info;
ops_memory_t *buf = NULL ;
ops_setup_memory_write(&info, &buf, 0);