fixed long-term bug due to sending an empty list of destkeys for GXSSecurity to encrypt an item

This commit is contained in:
csoler 2020-05-28 23:58:07 +02:00
parent b29abaf67b
commit f75a6424b5
No known key found for this signature in database
GPG Key ID: 7BCA522266C0804C

View File

@ -651,6 +651,9 @@ bool GxsSecurity::encrypt(uint8_t *& out, uint32_t &outlen, const uint8_t *in, u
try try
{ {
if(keys.empty())
throw std::runtime_error("EVP_SealInit will not be called with 0 keys. GxsSecurity::encrypt() was called with an empty set of destination keys!") ;
for(uint32_t i=0;i<keys.size();++i) for(uint32_t i=0;i<keys.size();++i)
{ {
RSA *tmpkey = ::extractPublicKey(keys[i]) ; RSA *tmpkey = ::extractPublicKey(keys[i]) ;