Add some documentation and fix some compiler warnings

This commit is contained in:
Gioacchino Mazzurco 2019-09-28 14:34:07 +02:00
parent 4e3ac4a9f4
commit 1e9adc1e23
No known key found for this signature in database
GPG key ID: A1FBCA3872E87051
2 changed files with 33 additions and 18 deletions

View file

@ -1581,24 +1581,25 @@ void PGPHandler::locked_updateOwnSignatureFlag(PGPCertificateInfo& cert,const Rs
cert._flags &= ~PGPCertificateInfo::PGP_CERTIFICATE_FLAG_HAS_SIGNED_ME ;
}
RsPgpId PGPHandler::pgpIdFromFingerprint(const PGPFingerprintType& f)
/*static*/ RsPgpId PGPHandler::pgpIdFromFingerprint(const RsPgpFingerprint& f)
{
return RsPgpId(f.toByteArray() + _RsIdSize::PGP_FINGERPRINT - _RsIdSize::PGP_ID);
return RsPgpId::fromBufferUnsafe(
f.toByteArray() +
RsPgpFingerprint::SIZE_IN_BYTES - RsPgpId::SIZE_IN_BYTES );
}
bool PGPHandler::getKeyFingerprint(const RsPgpId& id,PGPFingerprintType& fp) const
bool PGPHandler::getKeyFingerprint(const RsPgpId& id, RsPgpFingerprint& fp) const
{
RsStackMutex mtx(pgphandlerMtx) ; // lock access to PGP memory structures.
RS_STACK_MUTEX(pgphandlerMtx);
const ops_keydata_t *key = locked_getPublicKey(id,false) ;
if(key == NULL)
return false ;
if(!key) return false;
ops_fingerprint_t f ;
ops_fingerprint(&f,&key->key.pkey) ;
fp = PGPFingerprintType(f.fingerprint) ;
fp = RsPgpFingerprint::fromBufferUnsafe(f.fingerprint);
return true ;
}