Fix past commit for p3idservice.cc

This commit is contained in:
Phenom 2017-07-21 15:31:53 +02:00
parent 733f81269c
commit 8ce10ea6a8

View File

@ -1207,7 +1207,7 @@ bool p3IdService::encryptData( const uint8_t* decrypted_data,
for( int i=0; i < maxRounds; ++i ) for( int i=0; i < maxRounds; ++i )
{ {
for( std::set<const RsGxsId*>::iterator it = keyNotYetFoundIds.begin(); for( std::set<const RsGxsId*>::iterator it = keyNotYetFoundIds.begin();
it !=keyNotYetFoundIds.end(); ++it ) it !=keyNotYetFoundIds.end(); )
{ {
RsTlvPublicRSAKey encryption_key; RsTlvPublicRSAKey encryption_key;
if(getKey(**it, encryption_key) && !encryption_key.keyId.isNull()) if(getKey(**it, encryption_key) && !encryption_key.keyId.isNull())
@ -1215,6 +1215,10 @@ bool p3IdService::encryptData( const uint8_t* decrypted_data,
encryption_keys.push_back(encryption_key); encryption_keys.push_back(encryption_key);
it = keyNotYetFoundIds.erase(it); it = keyNotYetFoundIds.erase(it);
} }
else
{
++it;
}
} }
if(keyNotYetFoundIds.empty()) break; if(keyNotYetFoundIds.empty()) break;
@ -1336,7 +1340,7 @@ bool p3IdService::decryptData( const uint8_t* encrypted_data,
for( int i=0; i < maxRounds; ++i ) for( int i=0; i < maxRounds; ++i )
{ {
for( std::set<const RsGxsId*>::iterator it = keyNotYetFoundIds.begin(); for( std::set<const RsGxsId*>::iterator it = keyNotYetFoundIds.begin();
it !=keyNotYetFoundIds.end(); ++it ) it !=keyNotYetFoundIds.end(); )
{ {
RsTlvPrivateRSAKey decryption_key; RsTlvPrivateRSAKey decryption_key;
if( getPrivateKey(**it, decryption_key) if( getPrivateKey(**it, decryption_key)
@ -1345,6 +1349,10 @@ bool p3IdService::decryptData( const uint8_t* encrypted_data,
decryption_keys.push_back(decryption_key); decryption_keys.push_back(decryption_key);
it = keyNotYetFoundIds.erase(it); it = keyNotYetFoundIds.erase(it);
} }
else
{
++it;
}
} }
if(keyNotYetFoundIds.empty()) break; if(keyNotYetFoundIds.empty()) break;