From d5c645e3838e838191d210592eff7ab1125edf52 Mon Sep 17 00:00:00 2001 From: csoler Date: Tue, 11 Jun 2013 20:51:39 +0000 Subject: [PATCH] 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 --- libretroshare/src/pgp/pgphandler.cc | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/libretroshare/src/pgp/pgphandler.cc b/libretroshare/src/pgp/pgphandler.cc index 6a7d68c7c..89b73b87b 100644 --- a/libretroshare/src/pgp/pgphandler.cc +++ b/libretroshare/src/pgp/pgphandler.cc @@ -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);