mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-06-21 12:54:26 -04:00
Add some documentation and fix some compiler warnings
This commit is contained in:
parent
4e3ac4a9f4
commit
1e9adc1e23
2 changed files with 33 additions and 18 deletions
|
@ -1581,24 +1581,25 @@ void PGPHandler::locked_updateOwnSignatureFlag(PGPCertificateInfo& cert,const Rs
|
||||||
cert._flags &= ~PGPCertificateInfo::PGP_CERTIFICATE_FLAG_HAS_SIGNED_ME ;
|
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) ;
|
const ops_keydata_t *key = locked_getPublicKey(id,false) ;
|
||||||
|
|
||||||
if(key == NULL)
|
if(!key) return false;
|
||||||
return false ;
|
|
||||||
|
|
||||||
ops_fingerprint_t f ;
|
ops_fingerprint_t f ;
|
||||||
ops_fingerprint(&f,&key->key.pkey) ;
|
ops_fingerprint(&f,&key->key.pkey) ;
|
||||||
|
|
||||||
fp = PGPFingerprintType(f.fingerprint) ;
|
fp = RsPgpFingerprint::fromBufferUnsafe(f.fingerprint);
|
||||||
|
|
||||||
return true ;
|
return true ;
|
||||||
}
|
}
|
||||||
|
|
|
@ -124,7 +124,6 @@ class PGPHandler
|
||||||
bool encryptTextToFile(const RsPgpId& key_id,const std::string& text,const std::string& outfile) ;
|
bool encryptTextToFile(const RsPgpId& key_id,const std::string& text,const std::string& outfile) ;
|
||||||
bool decryptTextFromFile(const RsPgpId& key_id,std::string& text,const std::string& encrypted_inputfile) ;
|
bool decryptTextFromFile(const RsPgpId& key_id,std::string& text,const std::string& encrypted_inputfile) ;
|
||||||
|
|
||||||
bool getKeyFingerprint(const RsPgpId& id,PGPFingerprintType& fp) const ;
|
|
||||||
void setAcceptConnexion(const RsPgpId&,bool) ;
|
void setAcceptConnexion(const RsPgpId&,bool) ;
|
||||||
|
|
||||||
void updateOwnSignatureFlag(const RsPgpId& ownId) ;
|
void updateOwnSignatureFlag(const RsPgpId& ownId) ;
|
||||||
|
@ -148,6 +147,14 @@ class PGPHandler
|
||||||
|
|
||||||
const PGPCertificateInfo *getCertificateInfo(const RsPgpId& id) const ;
|
const PGPCertificateInfo *getCertificateInfo(const RsPgpId& id) const ;
|
||||||
|
|
||||||
|
RS_DEPRECATED_FOR(isPgpPubKeyAvailable)
|
||||||
|
bool isGPGId(const RsPgpId &id);
|
||||||
|
bool isGPGSigned(const RsPgpId &id);
|
||||||
|
bool isGPGAccepted(const RsPgpId &id);
|
||||||
|
|
||||||
|
static void setPassphraseCallback(PassphraseCallback cb) ;
|
||||||
|
static PassphraseCallback passphraseCallback() { return _passphrase_callback ; }
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Check if a PGP publick key is available
|
* @brief Check if a PGP publick key is available
|
||||||
* @param id id of the key to check
|
* @param id id of the key to check
|
||||||
|
@ -156,14 +163,21 @@ class PGPHandler
|
||||||
*/
|
*/
|
||||||
bool isPgpPubKeyAvailable(const RsPgpId& id);
|
bool isPgpPubKeyAvailable(const RsPgpId& id);
|
||||||
|
|
||||||
RS_DEPRECATED_FOR(isPgpPubKeyAvailable)
|
/**
|
||||||
bool isGPGId(const RsPgpId &id);
|
* @brief Convert PGP fingerprint to PGP 64bit id
|
||||||
bool isGPGSigned(const RsPgpId &id);
|
* @param f PGP fingerprint to convert
|
||||||
bool isGPGAccepted(const RsPgpId &id);
|
* @return PGP 64bit id extracted from fingerprint
|
||||||
|
*/
|
||||||
|
static RsPgpId pgpIdFromFingerprint(const RsPgpFingerprint& f);
|
||||||
|
|
||||||
static void setPassphraseCallback(PassphraseCallback cb) ;
|
/**
|
||||||
static PassphraseCallback passphraseCallback() { return _passphrase_callback ; }
|
* @brief Get PGP fingerprint for the given key
|
||||||
static RsPgpId pgpIdFromFingerprint(const PGPFingerprintType& f) ;
|
* @param id PGP 64bit key id
|
||||||
|
* @param fp storage for the retrived key fingerpring, the contained value
|
||||||
|
* is meaningfull only if true is returned
|
||||||
|
* @return true if the key was found, false if not
|
||||||
|
*/
|
||||||
|
bool getKeyFingerprint(const RsPgpId& id, RsPgpFingerprint& fp) const;
|
||||||
|
|
||||||
// Gets info about the key. Who are the signers, what's the owner's name, etc.
|
// Gets info about the key. Who are the signers, what's the owner's name, etc.
|
||||||
//
|
//
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue