mirror of
https://github.com/RetroShare/RetroShare.git
synced 2024-12-19 12:54:24 -05:00
* Fixed certificate saving bug. (authssl.cc)
* added cert->issuer to external interface (rspeers.h) git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@1501 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
0924fa49c2
commit
60349baf9d
@ -1632,6 +1632,10 @@ bool AuthSSL::ProcessX509(X509 *x509, std::string &id)
|
||||
if (!cert->authed)
|
||||
{
|
||||
cert->authed = valid;
|
||||
|
||||
/* resave newly authed certificate */
|
||||
mToSaveCerts = true;
|
||||
|
||||
#ifdef AUTHSSL_DEBUG
|
||||
std::cerr << "AuthSSL::ProcessX509() ";
|
||||
std::cerr << "Updating Unauthed duplicate: ";
|
||||
@ -2166,9 +2170,10 @@ std::string getX509AuthCode(X509 *x509)
|
||||
return out.str();
|
||||
}
|
||||
|
||||
// other fns
|
||||
// filename of certificate. (SSL Only)
|
||||
std::string getCertName(X509 *x509)
|
||||
{
|
||||
|
||||
std::string name = getX509NameString(x509->cert_info->subject);
|
||||
// strip out bad chars.
|
||||
for(int i = 0; i < (signed) name.length(); i++)
|
||||
@ -2182,10 +2187,6 @@ std::string getCertName(X509 *x509)
|
||||
return name;
|
||||
}
|
||||
|
||||
#if 0
|
||||
#endif
|
||||
|
||||
|
||||
/********** SSL ERROR STUFF ******************************************/
|
||||
|
||||
int printSSLError(SSL *ssl, int retval, int err, unsigned long err2,
|
||||
@ -2322,12 +2323,20 @@ bool AuthSSL::saveCertificates()
|
||||
{
|
||||
X509 *x509 = it->second->certificate;
|
||||
std::string hash;
|
||||
#if PQI_SSLONLY
|
||||
std::string neighfile = neighdir + getCertName(x509) + ".pqi";
|
||||
#else
|
||||
std::string neighfile = neighdir + (it->first) + ".pqi";
|
||||
#endif
|
||||
|
||||
if (saveX509ToFile(x509, neighfile, hash))
|
||||
{
|
||||
conftxt += "CERT ";
|
||||
#if PQI_SSLONLY
|
||||
conftxt += getCertName(x509);
|
||||
#else
|
||||
conftxt += (it->first);
|
||||
#endif
|
||||
conftxt += "\n";
|
||||
conftxt += hash;
|
||||
conftxt += "\n";
|
||||
|
@ -78,6 +78,8 @@ class RsPeerDetails
|
||||
std::string location;
|
||||
std::string org;
|
||||
|
||||
std::string issuer;
|
||||
|
||||
std::string fpr; /* pgp fingerprint */
|
||||
std::string authcode;
|
||||
std::list<std::string> signers;
|
||||
|
@ -302,6 +302,8 @@ bool p3Peers::getPeerDetails(std::string id, RsPeerDetails &d)
|
||||
d.org = authDetail.org;
|
||||
d.signers = authDetail.signers;
|
||||
|
||||
d.issuer = authDetail.issuer;
|
||||
|
||||
d.ownsign = authDetail.ownsign;
|
||||
d.trusted = authDetail.trusted;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user