From 64a06fd0bba5d25272948631ce97f0728799318d Mon Sep 17 00:00:00 2001 From: csoler Date: Wed, 9 Sep 2009 11:22:44 +0000 Subject: [PATCH] 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 --- libretroshare/src/pqi/authssl.cc | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/libretroshare/src/pqi/authssl.cc b/libretroshare/src/pqi/authssl.cc index 013450c55..b43102df3 100644 --- a/libretroshare/src/pqi/authssl.cc +++ b/libretroshare/src/pqi/authssl.cc @@ -1217,6 +1217,10 @@ bool AuthSSL::VerifySignBin(std::string pid, } EVP_PKEY *peerkey = peer->certificate->cert_info->key->pkey; + + if(peerkey == NULL) + return false ; + EVP_MD_CTX *mdctx = EVP_MD_CTX_create(); if (0 == EVP_VerifyInit(mdctx, EVP_sha1())) @@ -1235,6 +1239,12 @@ bool AuthSSL::VerifySignBin(std::string pid, return false; } + if(signlen == 0 || sign == NULL) + { + EVP_MD_CTX_destroy(mdctx); + return false ; + } + if (0 == EVP_VerifyFinal(mdctx, sign, signlen, peerkey)) { std::cerr << "EVP_VerifyFinal Failure!" << std::endl;