mirror of
https://github.com/RetroShare/RetroShare.git
synced 2024-10-01 02:35:48 -04:00
fixed core dump issue where AuthSSL::VerifySignBin() is called with NULL parameters. Still, this should not happen.
git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@1624 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
3b3c7c7ba4
commit
64a06fd0bb
@ -1217,6 +1217,10 @@ bool AuthSSL::VerifySignBin(std::string pid,
|
|||||||
}
|
}
|
||||||
|
|
||||||
EVP_PKEY *peerkey = peer->certificate->cert_info->key->pkey;
|
EVP_PKEY *peerkey = peer->certificate->cert_info->key->pkey;
|
||||||
|
|
||||||
|
if(peerkey == NULL)
|
||||||
|
return false ;
|
||||||
|
|
||||||
EVP_MD_CTX *mdctx = EVP_MD_CTX_create();
|
EVP_MD_CTX *mdctx = EVP_MD_CTX_create();
|
||||||
|
|
||||||
if (0 == EVP_VerifyInit(mdctx, EVP_sha1()))
|
if (0 == EVP_VerifyInit(mdctx, EVP_sha1()))
|
||||||
@ -1235,6 +1239,12 @@ bool AuthSSL::VerifySignBin(std::string pid,
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(signlen == 0 || sign == NULL)
|
||||||
|
{
|
||||||
|
EVP_MD_CTX_destroy(mdctx);
|
||||||
|
return false ;
|
||||||
|
}
|
||||||
|
|
||||||
if (0 == EVP_VerifyFinal(mdctx, sign, signlen, peerkey))
|
if (0 == EVP_VerifyFinal(mdctx, sign, signlen, peerkey))
|
||||||
{
|
{
|
||||||
std::cerr << "EVP_VerifyFinal Failure!" << std::endl;
|
std::cerr << "EVP_VerifyFinal Failure!" << std::endl;
|
||||||
|
Loading…
Reference in New Issue
Block a user