mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-05-08 17:15:16 -04:00
Conversion of the SSL connection methods.
* Added new XPGP functions to checking certificates. * Converted SSL classes from cert * -> p3AuthMgr. * Added check of addresses before connect attempt. * started up listener correctly. git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@319 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
f9d6f1c418
commit
798e19d58c
14 changed files with 221 additions and 109 deletions
|
@ -1105,6 +1105,68 @@ bool AuthXPGP::getXPGPid(XPGP *xpgp, std::string &xpgpid)
|
|||
}
|
||||
|
||||
|
||||
|
||||
/* validate + get id */
|
||||
bool AuthXPGP::ValidateCertificateXPGP(XPGP *xpgp, std::string &peerId)
|
||||
{
|
||||
/* check self signed */
|
||||
if (!XPGP_check_valid_certificate(xpgp))
|
||||
{
|
||||
/* bad certificate */
|
||||
return false;
|
||||
}
|
||||
|
||||
return getXPGPid(xpgp, peerId);
|
||||
}
|
||||
|
||||
/* store for discovery */
|
||||
bool AuthXPGP::FailedCertificateXPGP(XPGP *xpgp, bool incoming)
|
||||
{
|
||||
std::string id;
|
||||
return ProcessXPGP(xpgp, id);
|
||||
}
|
||||
|
||||
/* check that they are exact match */
|
||||
bool AuthXPGP::CheckCertificateXPGP(std::string xpgpId, XPGP *xpgp)
|
||||
{
|
||||
xpgpMtx.lock(); /***** LOCK *****/
|
||||
|
||||
xpgpcert *cert = NULL;
|
||||
if (!locked_FindCert(xpgpId, &cert))
|
||||
{
|
||||
/* not there -> error */
|
||||
XPGP_free(xpgp);
|
||||
|
||||
xpgpMtx.unlock(); /**** UNLOCK ****/
|
||||
return false;
|
||||
}
|
||||
else
|
||||
{
|
||||
/* have a duplicate */
|
||||
/* check that they are exact */
|
||||
if (0 != XPGP_cmp(cert->certificate, xpgp))
|
||||
{
|
||||
/* MAJOR ERROR */
|
||||
XPGP_free(xpgp);
|
||||
xpgpMtx.unlock(); /**** UNLOCK ****/
|
||||
return false;
|
||||
}
|
||||
|
||||
/* transfer new signatures */
|
||||
XPGP_copy_known_signatures(pgp_keyring, cert->certificate, xpgp);
|
||||
XPGP_free(xpgp);
|
||||
|
||||
/* update signers */
|
||||
cert->signers = getXPGPsigners(cert->certificate);
|
||||
|
||||
xpgpMtx.unlock(); /**** UNLOCK ****/
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/********************************************************************************/
|
||||
/********************************************************************************/
|
||||
/********************************************************************************/
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue