mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-05-29 19:11:24 -04:00
refactor LoadCheckX509 into safer AuthSSL::parseX509DetailsFromFile
This commit is contained in:
parent
0c097c2080
commit
16d606b513
5 changed files with 65 additions and 49 deletions
|
@ -686,7 +686,8 @@ static bool checkAccount(const std::string &accountdir, AccountDetails &account,
|
|||
bool ret = false;
|
||||
|
||||
/* check against authmanagers private keys */
|
||||
if (LoadCheckX509(cert_name.c_str(), account.mPgpId, account.mLocation, account.mSslId))
|
||||
if(AuthSSL::instance().parseX509DetailsFromFile(
|
||||
cert_name, account.mSslId, account.mPgpId, account.mLocation ))
|
||||
{
|
||||
// new locations store the name in an extra file
|
||||
if(account.mLocation == "")
|
||||
|
@ -1117,8 +1118,11 @@ bool RsAccountsDetail::GenerateSSLCertificate(const RsPgpId& pgp_id, const s
|
|||
std::string location;
|
||||
RsPgpId pgpid_retrieved;
|
||||
|
||||
if (LoadCheckX509(cert_name.c_str(), pgpid_retrieved, location, sslId) == 0) {
|
||||
std::cerr << "RsInit::GenerateSSLCertificate() Cannot check own signature, maybe the files are corrupted." << std::endl;
|
||||
if(!AuthSSL::instance().parseX509DetailsFromFile(
|
||||
cert_name, sslId, pgpid_retrieved, location ))
|
||||
{
|
||||
RsErr() << __PRETTY_FUNCTION__ << " Cannot check own signature, maybe "
|
||||
<< "the files are corrupted." << std::endl;
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue