mirror of
https://github.com/RetroShare/RetroShare.git
synced 2024-10-01 02:35:48 -04:00
added check to only import version 4 keys in the keyring
git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@6945 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
3add068cdd
commit
d26d6fa355
@ -963,10 +963,19 @@ bool PGPHandler::LoadCertificateFromString(const std::string& pgp_cert,PGPIdType
|
|||||||
return false ;
|
return false ;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Check that the key is correctly self-signed.
|
|
||||||
//
|
|
||||||
const ops_keydata_t *keydata = ops_keyring_get_key_by_index(tmp_keyring,0);
|
const ops_keydata_t *keydata = ops_keyring_get_key_by_index(tmp_keyring,0);
|
||||||
|
|
||||||
|
// Check that the key is a version 4 key
|
||||||
|
//
|
||||||
|
if(keydata->key.pkey.version != 4)
|
||||||
|
{
|
||||||
|
error_string = "Public key is not version 4. Rejected!" ;
|
||||||
|
std::cerr << "Received a key with unhandled version number (" << keydata->key.pkey.version << ")" << std::endl;
|
||||||
|
return false ;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Check that the key is correctly self-signed.
|
||||||
|
//
|
||||||
ops_validate_result_t* result=(ops_validate_result_t*)ops_mallocz(sizeof *result);
|
ops_validate_result_t* result=(ops_validate_result_t*)ops_mallocz(sizeof *result);
|
||||||
|
|
||||||
if(!ops_validate_key_signatures(result,keydata,tmp_keyring,cb_get_passphrase))
|
if(!ops_validate_key_signatures(result,keydata,tmp_keyring,cb_get_passphrase))
|
||||||
|
Loading…
Reference in New Issue
Block a user