From: Bjoern Sikora Date: Mon, 17 Jan 2011 12:15:39 +0000 (+0100) Subject: Fixed mantis Bug#1750: Don't call EVP_cleanup(). This will remove all digest from... X-Git-Tag: v1.1~29 X-Git-Url: http://developer.intra2net.com/git/?p=bpdyndnsd;a=commitdiff_plain;h=6c0292897296ebcfec6b5aa94b7b016d608539ff Fixed mantis Bug#1750: Don't call EVP_cleanup(). This will remove all digest from the internal table which is also used by curl. --- diff --git a/src/util.cpp b/src/util.cpp index 6b7cbda..8aa5bd9 100644 --- a/src/util.cpp +++ b/src/util.cpp @@ -47,7 +47,6 @@ std::string compute_md5_digest(std::string data) if ( EVP_DigestInit_ex(&mdctx, md, NULL) == 0 ) { EVP_MD_CTX_cleanup(&mdctx); /*lint !e534 */ - EVP_cleanup(); /*lint !e534 */ throw std::invalid_argument("Could not set up digest context correctly"); } @@ -55,7 +54,6 @@ std::string compute_md5_digest(std::string data) if ( data.empty() ) { EVP_MD_CTX_cleanup(&mdctx); /*lint !e534 */ - EVP_cleanup(); /*lint !e534 */ throw std::invalid_argument("Passed data is empty"); } @@ -63,7 +61,6 @@ std::string compute_md5_digest(std::string data) if ( EVP_DigestUpdate(&mdctx, data.c_str(), data.size()) == 0 ) { EVP_MD_CTX_cleanup(&mdctx); /*lint !e534 */ - EVP_cleanup(); /*lint !e534 */ throw std::invalid_argument("Could not hash data into digest context"); } @@ -71,7 +68,6 @@ std::string compute_md5_digest(std::string data) if ( EVP_DigestFinal_ex(&mdctx, md_value, &md_len) == 0 ) { EVP_MD_CTX_cleanup(&mdctx); /*lint !e534 */ - EVP_cleanup(); /*lint !e534 */ throw std::invalid_argument("Could not retrieve digest value"); } @@ -79,13 +75,11 @@ std::string compute_md5_digest(std::string data) if ( (md_len == 0) || (EVP_MD_CTX_size(&mdctx) == 0) ) { EVP_MD_CTX_cleanup(&mdctx); /*lint !e534 */ - EVP_cleanup(); /*lint !e534 */ throw std::invalid_argument("Retrieved invalid digest value"); } // Internal cleanup of the digest content. EVP_MD_CTX_cleanup(&mdctx); /*lint !e534 */ - EVP_cleanup(); /*lint !e534 */ // Convert md5 digest C string to hex. std::ostringstream oss_digest_md5_hex;