mirror of
https://github.com/RetroShare/RetroShare.git
synced 2024-12-19 21:04:32 -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)
|
if (!cert->authed)
|
||||||
{
|
{
|
||||||
cert->authed = valid;
|
cert->authed = valid;
|
||||||
|
|
||||||
|
/* resave newly authed certificate */
|
||||||
|
mToSaveCerts = true;
|
||||||
|
|
||||||
#ifdef AUTHSSL_DEBUG
|
#ifdef AUTHSSL_DEBUG
|
||||||
std::cerr << "AuthSSL::ProcessX509() ";
|
std::cerr << "AuthSSL::ProcessX509() ";
|
||||||
std::cerr << "Updating Unauthed duplicate: ";
|
std::cerr << "Updating Unauthed duplicate: ";
|
||||||
@ -2166,9 +2170,10 @@ std::string getX509AuthCode(X509 *x509)
|
|||||||
return out.str();
|
return out.str();
|
||||||
}
|
}
|
||||||
|
|
||||||
// other fns
|
// filename of certificate. (SSL Only)
|
||||||
std::string getCertName(X509 *x509)
|
std::string getCertName(X509 *x509)
|
||||||
{
|
{
|
||||||
|
|
||||||
std::string name = getX509NameString(x509->cert_info->subject);
|
std::string name = getX509NameString(x509->cert_info->subject);
|
||||||
// strip out bad chars.
|
// strip out bad chars.
|
||||||
for(int i = 0; i < (signed) name.length(); i++)
|
for(int i = 0; i < (signed) name.length(); i++)
|
||||||
@ -2182,10 +2187,6 @@ std::string getCertName(X509 *x509)
|
|||||||
return name;
|
return name;
|
||||||
}
|
}
|
||||||
|
|
||||||
#if 0
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
/********** SSL ERROR STUFF ******************************************/
|
/********** SSL ERROR STUFF ******************************************/
|
||||||
|
|
||||||
int printSSLError(SSL *ssl, int retval, int err, unsigned long err2,
|
int printSSLError(SSL *ssl, int retval, int err, unsigned long err2,
|
||||||
@ -2322,12 +2323,20 @@ bool AuthSSL::saveCertificates()
|
|||||||
{
|
{
|
||||||
X509 *x509 = it->second->certificate;
|
X509 *x509 = it->second->certificate;
|
||||||
std::string hash;
|
std::string hash;
|
||||||
|
#if PQI_SSLONLY
|
||||||
std::string neighfile = neighdir + getCertName(x509) + ".pqi";
|
std::string neighfile = neighdir + getCertName(x509) + ".pqi";
|
||||||
|
#else
|
||||||
|
std::string neighfile = neighdir + (it->first) + ".pqi";
|
||||||
|
#endif
|
||||||
|
|
||||||
if (saveX509ToFile(x509, neighfile, hash))
|
if (saveX509ToFile(x509, neighfile, hash))
|
||||||
{
|
{
|
||||||
conftxt += "CERT ";
|
conftxt += "CERT ";
|
||||||
|
#if PQI_SSLONLY
|
||||||
conftxt += getCertName(x509);
|
conftxt += getCertName(x509);
|
||||||
|
#else
|
||||||
|
conftxt += (it->first);
|
||||||
|
#endif
|
||||||
conftxt += "\n";
|
conftxt += "\n";
|
||||||
conftxt += hash;
|
conftxt += hash;
|
||||||
conftxt += "\n";
|
conftxt += "\n";
|
||||||
|
@ -78,6 +78,8 @@ class RsPeerDetails
|
|||||||
std::string location;
|
std::string location;
|
||||||
std::string org;
|
std::string org;
|
||||||
|
|
||||||
|
std::string issuer;
|
||||||
|
|
||||||
std::string fpr; /* pgp fingerprint */
|
std::string fpr; /* pgp fingerprint */
|
||||||
std::string authcode;
|
std::string authcode;
|
||||||
std::list<std::string> signers;
|
std::list<std::string> signers;
|
||||||
|
@ -302,6 +302,8 @@ bool p3Peers::getPeerDetails(std::string id, RsPeerDetails &d)
|
|||||||
d.org = authDetail.org;
|
d.org = authDetail.org;
|
||||||
d.signers = authDetail.signers;
|
d.signers = authDetail.signers;
|
||||||
|
|
||||||
|
d.issuer = authDetail.issuer;
|
||||||
|
|
||||||
d.ownsign = authDetail.ownsign;
|
d.ownsign = authDetail.ownsign;
|
||||||
d.trusted = authDetail.trusted;
|
d.trusted = authDetail.trusted;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user