From deb0ebe8361aee545b67a52032af1cfc6b008724 Mon Sep 17 00:00:00 2001 From: Jack Lloyd Date: Wed, 3 Oct 2018 16:05:34 -0400 Subject: Resolve a leak in OpenSSL ECDSA verification for old OpenSSL The code was using the 1.0 API incorrectly and causing a leak. https://github.com/riboseinc/rnp/issues/757 --- src/tests/main.cpp | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'src/tests/main.cpp') diff --git a/src/tests/main.cpp b/src/tests/main.cpp index ef1a16ba7..6777f85f4 100644 --- a/src/tests/main.cpp +++ b/src/tests/main.cpp @@ -97,7 +97,17 @@ int main(int argc, char* argv[]) Botan_Tests::Test_Runner tests(std::cout); - return tests.run(opts); + int rc = tests.run(opts); + +#if defined(BOTAN_HAS_OPENSSL) + if(opts.provider().empty() || opts.provider() == "openssl") + { + ::ERR_free_strings(); + ::ERR_remove_thread_state(nullptr); + } +#endif + + return rc; } catch(std::exception& e) { -- cgit v1.2.3