mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-06-19 11:54:22 -04:00
Major bugfixes to get PGP authentication finished.
* p3disc now exchanges "Issuer" (pgp) certificates as well. * additional types for rsdiscitems.h * Bug Fix for NULL packet in p3service.cc * allow unauthed SSL certificates to be added in AuthSSL - otherwise cant add new friends! * only save authed SSL certificates. * fixed ref/unref of PGP keys in AuthGPG * added Mutex protection to AuthGPG * added PGP reloading when key is imported, or signed. * Fixed PGP key signing. * added Additional field validLvl to RsPeerDetails. git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@1270 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
aeb07b4ce5
commit
d4b52a59e5
15 changed files with 566 additions and 95 deletions
|
@ -41,6 +41,9 @@
|
|||
class gpgcert
|
||||
{
|
||||
public:
|
||||
gpgcert();
|
||||
~gpgcert();
|
||||
|
||||
pqiAuthDetails user;
|
||||
gpgme_key_t key;
|
||||
};
|
||||
|
@ -52,19 +55,30 @@ typedef std::map<std::string, gpgcert> certmap;
|
|||
|
||||
class GPGAuthMgr: public AuthSSL
|
||||
{
|
||||
private:
|
||||
|
||||
/* Internal functions */
|
||||
bool setPGPPassword_locked(std::string pwd);
|
||||
bool DoOwnSignature_locked(void *, unsigned int, void *, unsigned int *);
|
||||
bool VerifySignature_locked(std::string id, void *data, int datalen,
|
||||
void *sig, unsigned int siglen);
|
||||
|
||||
// store all keys in map mKeyList to avoid calling gpgme exe repeatedly
|
||||
bool storeAllKeys_locked();
|
||||
bool updateTrustAllKeys_locked();
|
||||
|
||||
bool printAllKeys_locked();
|
||||
bool printOwnKeys_locked();
|
||||
|
||||
public:
|
||||
|
||||
GPGAuthMgr();
|
||||
~GPGAuthMgr();
|
||||
|
||||
bool setPGPPassword(std::string pwd);
|
||||
|
||||
X509* SignX509Req(X509_REQ *req, long days, std::string);
|
||||
bool AuthX509(X509 *x509);
|
||||
|
||||
bool DoOwnSignature(void *, unsigned int, void *, unsigned int *);
|
||||
bool VerifySignature(std::string id, void *data, int datalen,
|
||||
void *sig, unsigned int siglen);
|
||||
|
||||
bool availablePGPCertificates(std::list<std::string> &ids);
|
||||
|
||||
|
@ -106,13 +120,6 @@ class GPGAuthMgr: public AuthSSL
|
|||
bool CloseAuth();
|
||||
// int setConfigDirectories(std::string confFile, std::string neighDir);
|
||||
|
||||
// store all keys in map mKeyList to avoid calling gpgme exe repeatedly
|
||||
bool storeAllKeys();
|
||||
bool updateTrustAllKeys();
|
||||
|
||||
bool printAllKeys();
|
||||
bool printOwnKeys();
|
||||
|
||||
|
||||
|
||||
/*********************************************************************************/
|
||||
|
@ -272,7 +279,8 @@ bool checkSignature(std::string id, std::string hash, std::string signature);
|
|||
|
||||
private:
|
||||
|
||||
/* Example Storage - Change as needed */
|
||||
RsMutex pgpMtx;
|
||||
/* Below is protected via the mutex */
|
||||
|
||||
certmap mKeyList;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue