mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-05-13 11:32:48 -04:00
improved testing code for PGP handler, and added RSA/DSA flags to certificates.
git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@5371 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
fe95818384
commit
afe62dad28
3 changed files with 219 additions and 84 deletions
|
@ -188,13 +188,22 @@ void PGPHandler::initCertificateInfo(PGPCertificateInfo& cert,const ops_keydata_
|
|||
cert._key_index = index ;
|
||||
cert._flags = 0 ;
|
||||
|
||||
switch(keydata->key.pkey.algorithm)
|
||||
{
|
||||
case OPS_PKA_RSA: cert._type = PGPCertificateInfo::PGP_CERTIFICATE_TYPE_RSA ;
|
||||
break ;
|
||||
case OPS_PKA_DSA: cert._type = PGPCertificateInfo::PGP_CERTIFICATE_TYPE_DSA ;
|
||||
cert._flags |= PGPCertificateInfo::PGP_CERTIFICATE_FLAG_UNSUPPORTED_ALGORITHM ;
|
||||
break ;
|
||||
default: cert._type = PGPCertificateInfo::PGP_CERTIFICATE_TYPE_UNKNOWN ;
|
||||
cert._flags |= PGPCertificateInfo::PGP_CERTIFICATE_FLAG_UNSUPPORTED_ALGORITHM ;
|
||||
break ;
|
||||
}
|
||||
|
||||
ops_fingerprint_t f ;
|
||||
ops_fingerprint(&f,&keydata->key.pkey) ;
|
||||
|
||||
cert._fpr = PGPFingerprintType(f.fingerprint) ;
|
||||
|
||||
if(keydata->key.pkey.algorithm != OPS_PKA_RSA)
|
||||
cert._flags |= PGPCertificateInfo::PGP_CERTIFICATE_FLAG_UNSUPPORTED_ALGORITHM ;
|
||||
}
|
||||
|
||||
bool PGPHandler::validateAndUpdateSignatures(PGPCertificateInfo& cert,const ops_keydata_t *keydata)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue