mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-05-08 17:15:16 -04:00
Addition of several utility functions:
(1) xpgp_id to extract the name/id from a certificate. (2) dht_bootstrap to check the status of the bootstrap peers. Various bits of code needed to be rearranged to make these utilities possible. git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@394 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
e1f4dc1dff
commit
7044822e1f
12 changed files with 651 additions and 31 deletions
|
@ -1186,7 +1186,7 @@ bool AuthXPGP::ProcessXPGP(XPGP *xpgp, std::string &id)
|
|||
}
|
||||
|
||||
|
||||
bool AuthXPGP::getXPGPid(XPGP *xpgp, std::string &xpgpid)
|
||||
bool getXPGPid(XPGP *xpgp, std::string &xpgpid)
|
||||
{
|
||||
#ifdef AUTHXPGP_DEBUG
|
||||
std::cerr << "AuthXPGP::getXPGPid()";
|
||||
|
@ -1320,7 +1320,7 @@ int pem_passwd_cb(char *buf, int size, int rwflag, void *password)
|
|||
|
||||
// Not dependent on sslroot. load, and detroys the XPGP memory.
|
||||
|
||||
int LoadCheckXPGPandGetName(const char *cert_file, std::string &userName)
|
||||
int LoadCheckXPGPandGetName(const char *cert_file, std::string &userName, std::string &userId)
|
||||
{
|
||||
/* This function loads the XPGP certificate from the file,
|
||||
* and checks the certificate
|
||||
|
@ -1352,6 +1352,11 @@ int LoadCheckXPGPandGetName(const char *cert_file, std::string &userName)
|
|||
userName = getX509CNString(xpgp->subject->subject);
|
||||
}
|
||||
|
||||
if (!getXPGPid(xpgp, userId))
|
||||
{
|
||||
valid = false;
|
||||
}
|
||||
|
||||
// clean up.
|
||||
XPGP_free(xpgp);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue