mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-07-31 18:29:02 -04:00
merge of branch v0.6-idclean 7180
git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@7187 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
7815efb16f
commit
0f29d28b1b
397 changed files with 6503 additions and 5702 deletions
|
@ -68,7 +68,7 @@ public:
|
|||
class AuthGPGOperationLoadOrSave : public AuthGPGOperation
|
||||
{
|
||||
public:
|
||||
AuthGPGOperationLoadOrSave(bool load, const std::string &gpgId, const std::string &gpgCert, void *userdata)
|
||||
AuthGPGOperationLoadOrSave(bool load, const RsPgpId &gpgId, const std::string &gpgCert, void *userdata)
|
||||
: AuthGPGOperation(userdata)
|
||||
{
|
||||
m_load = load;
|
||||
|
@ -82,8 +82,8 @@ public:
|
|||
|
||||
public:
|
||||
bool m_load;
|
||||
std::string m_certGpgId; // set for save & load.
|
||||
std::string m_certGpg; // set for load
|
||||
RsPgpId m_certGpgId; // set for save & load.
|
||||
std::string m_certGpg; // set for load
|
||||
};
|
||||
|
||||
class AuthGPGService
|
||||
|
@ -111,7 +111,7 @@ class AuthGPG: public p3Config, public RsThread, public PGPHandler
|
|||
/**
|
||||
* @param ids list of gpg certificate ids (note, not the actual certificates)
|
||||
*/
|
||||
virtual bool availableGPGCertificatesWithPrivateKeys(std::list<std::string> &ids);
|
||||
//virtual bool availableGPGCertificatesWithPrivateKeys(std::list<RsPgpId> &ids);
|
||||
|
||||
/*********************************************************************************/
|
||||
/************************* STAGE 1 ***********************************************/
|
||||
|
@ -134,8 +134,8 @@ class AuthGPG: public p3Config, public RsThread, public PGPHandler
|
|||
|
||||
/* Init by generating new Own PGP Cert, or selecting existing PGP Cert */
|
||||
|
||||
virtual int GPGInit(const std::string &ownId);
|
||||
virtual bool GeneratePGPCertificate(const std::string& name, const std::string& email, const std::string& passwd, std::string &pgpId, std::string &errString);
|
||||
virtual int GPGInit(const RsPgpId &ownId);
|
||||
virtual bool GeneratePGPCertificate(const std::string& name, const std::string& email, const std::string& passwd, RsPgpId &pgpId, std::string &errString);
|
||||
|
||||
/*********************************************************************************/
|
||||
/************************* STAGE 3 ***********************************************/
|
||||
|
@ -148,25 +148,25 @@ class AuthGPG: public p3Config, public RsThread, public PGPHandler
|
|||
* provide access to details in cache list.
|
||||
*
|
||||
****/
|
||||
virtual std::string getGPGName(const std::string &pgp_id,bool *success = NULL);
|
||||
virtual std::string getGPGEmail(const std::string &pgp_id,bool *success = NULL);
|
||||
virtual std::string getGPGName(const RsPgpId &pgp_id,bool *success = NULL);
|
||||
virtual std::string getGPGEmail(const RsPgpId &pgp_id,bool *success = NULL);
|
||||
|
||||
/* PGP web of trust management */
|
||||
virtual std::string getGPGOwnId();
|
||||
virtual const RsPgpId& getGPGOwnId();
|
||||
virtual std::string getGPGOwnName();
|
||||
|
||||
//virtual std::string getGPGOwnEmail();
|
||||
virtual bool isKeySupported(const std::string &id) const ;
|
||||
virtual bool haveSecretKey(const std::string &id) const ;
|
||||
virtual bool getGPGDetails(const std::string &id, RsPeerDetails &d);
|
||||
virtual bool getGPGAllList(std::list<std::string> &ids);
|
||||
virtual bool getGPGValidList(std::list<std::string> &ids);
|
||||
virtual bool getGPGAcceptedList(std::list<std::string> &ids);
|
||||
virtual bool getGPGSignedList(std::list<std::string> &ids);
|
||||
virtual bool importProfile(const std::string& filename,std::string& gpg_id,std::string& import_error) ;
|
||||
virtual bool exportProfile(const std::string& filename,const std::string& gpg_id) ;
|
||||
virtual bool isKeySupported(const RsPgpId &id) const ;
|
||||
virtual bool haveSecretKey(const RsPgpId &id) const ;
|
||||
virtual bool getGPGDetails(const RsPgpId& id, RsPeerDetails &d);
|
||||
virtual bool getGPGAllList(std::list<RsPgpId> &ids);
|
||||
virtual bool getGPGValidList(std::list<RsPgpId> &ids);
|
||||
virtual bool getGPGAcceptedList(std::list<RsPgpId> &ids);
|
||||
virtual bool getGPGSignedList(std::list<RsPgpId> &ids);
|
||||
virtual bool importProfile(const std::string& filename,RsPgpId& gpg_id,std::string& import_error) ;
|
||||
virtual bool exportProfile(const std::string& filename,const RsPgpId& gpg_id) ;
|
||||
|
||||
virtual bool removeKeysFromPGPKeyring(const std::list<std::string>& pgp_ids,std::string& backup_file,uint32_t& error_code) ;
|
||||
virtual bool removeKeysFromPGPKeyring(const std::list<RsPgpId>& pgp_ids,std::string& backup_file,uint32_t& error_code) ;
|
||||
|
||||
/*********************************************************************************/
|
||||
/************************* STAGE 4 ***********************************************/
|
||||
|
@ -175,11 +175,11 @@ class AuthGPG: public p3Config, public RsThread, public PGPHandler
|
|||
* STAGE 4: Loading and Saving Certificates. (Strings and Files)
|
||||
*
|
||||
****/
|
||||
virtual bool LoadCertificateFromString(const std::string &pem, PGPIdType& gpg_id,std::string& error_string);
|
||||
virtual std::string SaveCertificateToString(const std::string &id,bool include_signatures) ;
|
||||
virtual bool LoadCertificateFromString(const std::string &pem, RsPgpId& gpg_id,std::string& error_string);
|
||||
virtual std::string SaveCertificateToString(const RsPgpId &id,bool include_signatures) ;
|
||||
|
||||
// Cached certificates.
|
||||
bool getCachedGPGCertificate(const std::string &id, std::string &certificate);
|
||||
bool getCachedGPGCertificate(const RsPgpId &id, std::string &certificate);
|
||||
|
||||
/*********************************************************************************/
|
||||
/************************* STAGE 6 ***********************************************/
|
||||
|
@ -191,12 +191,12 @@ class AuthGPG: public p3Config, public RsThread, public PGPHandler
|
|||
* done in gpgroot already.
|
||||
*
|
||||
****/
|
||||
virtual bool AllowConnection(const std::string &gpg_id, bool accept);
|
||||
virtual bool AllowConnection(const RsPgpId &gpg_id, bool accept);
|
||||
|
||||
virtual bool SignCertificateLevel0(const std::string &id);
|
||||
virtual bool RevokeCertificate(const std::string &id); /* Particularly hard - leave for later */
|
||||
virtual bool SignCertificateLevel0(const RsPgpId &id);
|
||||
virtual bool RevokeCertificate(const RsPgpId &id); /* Particularly hard - leave for later */
|
||||
|
||||
virtual bool TrustCertificate(const std::string &id, int trustlvl); //trustlvl is 2 for none, 3 for marginal and 4 for full trust
|
||||
virtual bool TrustCertificate(const RsPgpId& id, int trustlvl); //trustlvl is 2 for none, 3 for marginal and 4 for full trust
|
||||
|
||||
/*********************************************************************************/
|
||||
/************************* STAGE 7 ***********************************************/
|
||||
|
@ -208,9 +208,9 @@ class AuthGPG: public p3Config, public RsThread, public PGPHandler
|
|||
*
|
||||
****/
|
||||
virtual bool SignDataBin(const void *data, const uint32_t len, unsigned char *sign, unsigned int *signlen);
|
||||
virtual bool VerifySignBin(const void*, uint32_t, unsigned char*, unsigned int, const std::string &withfingerprint);
|
||||
virtual bool VerifySignBin(const void*, uint32_t, unsigned char*, unsigned int, const PGPFingerprintType& withfingerprint);
|
||||
|
||||
virtual bool encryptDataBin(const std::string& pgp_id,const void *data, const uint32_t len, unsigned char *encr, unsigned int *encrlen);
|
||||
virtual bool encryptDataBin(const RsPgpId& pgp_id,const void *data, const uint32_t len, unsigned char *encr, unsigned int *encrlen);
|
||||
virtual bool decryptDataBin(const void *data, const uint32_t len, unsigned char *decr, unsigned int *decrlen);
|
||||
|
||||
virtual bool decryptTextFromFile( std::string& text,const std::string& filename);
|
||||
|
@ -219,7 +219,7 @@ class AuthGPG: public p3Config, public RsThread, public PGPHandler
|
|||
// virtual bool decryptTextFromString( std::string& encrypted_text,std::string& clear_string);
|
||||
// virtual bool encryptTextToString (const std::string& pgp_id,const std::string& clear_text,std::string& encrypted_string);
|
||||
|
||||
bool getGPGFilteredList(std::list<std::string>& list,bool (*filter)(const PGPCertificateInfo&) = NULL) ;
|
||||
bool getGPGFilteredList(std::list<RsPgpId>& list,bool (*filter)(const PGPCertificateInfo&) = NULL) ;
|
||||
|
||||
//END of PGP public functions
|
||||
|
||||
|
@ -253,12 +253,12 @@ class AuthGPG: public p3Config, public RsThread, public PGPHandler
|
|||
|
||||
/* Internal functions */
|
||||
bool DoOwnSignature(const void *, unsigned int, void *, unsigned int *);
|
||||
bool VerifySignature(const void *data, int datalen, const void *sig, unsigned int siglen, const std::string &withfingerprint);
|
||||
bool VerifySignature(const void *data, int datalen, const void *sig, unsigned int siglen, const PGPFingerprintType& withfingerprint);
|
||||
|
||||
/* Sign/Trust stuff */
|
||||
int privateSignCertificate(const std::string &id);
|
||||
int privateRevokeCertificate(const std::string &id); /* revoke the signature on Certificate */
|
||||
int privateTrustCertificate(const std::string &id, int trustlvl);
|
||||
int privateSignCertificate(const RsPgpId &id);
|
||||
int privateRevokeCertificate(const RsPgpId &id); /* revoke the signature on Certificate */
|
||||
int privateTrustCertificate(const RsPgpId& id, int trustlvl);
|
||||
|
||||
// store all keys in map mKeyList to avoid calling gpgme exe repeatedly
|
||||
//bool storeAllKeys();
|
||||
|
@ -293,7 +293,7 @@ class AuthGPG: public p3Config, public RsThread, public PGPHandler
|
|||
|
||||
time_t mStoreKeyTime;
|
||||
|
||||
PGPIdType mOwnGpgId;
|
||||
RsPgpId mOwnGpgId;
|
||||
bool gpgKeySelected;
|
||||
bool _force_sync_database ;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue