mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-05-02 14:16:16 -04:00
fixed import of retroshare identities that have multiple signatures from the same key ID. Fixed bug reported by claude37
git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@6927 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
214375ede1
commit
68138fc1c8
2 changed files with 14 additions and 1 deletions
|
@ -835,7 +835,18 @@ bool PGPHandler::importGPGKeyPair(const std::string& filename,PGPIdType& importe
|
|||
|
||||
ops_validate_key_signatures(result, const_cast<ops_keydata_t*>(pubkey), &dummy_keyring, cb_get_passphrase) ;
|
||||
|
||||
if(result->valid_count != 1 || memcmp((unsigned char*)result->valid_sigs[0].signer_id,pubkey->key_id,KEY_ID_SIZE))
|
||||
// Check that signatures contain at least one certification from the user id.
|
||||
//
|
||||
bool found = false ;
|
||||
|
||||
for(uint32_t i=0;i<result->valid_count;++i)
|
||||
if(!memcmp((unsigned char*)result->valid_sigs[i].signer_id,pubkey->key_id,KEY_ID_SIZE))
|
||||
{
|
||||
found = true ;
|
||||
break ;
|
||||
}
|
||||
|
||||
if(!found)
|
||||
{
|
||||
import_error = "Cannot validate self signature for the imported key. Sorry." ;
|
||||
return false ;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue