aboutsummaryrefslogtreecommitdiffstats
path: root/src/tests/main.cpp
diff options
context:
space:
mode:
authorJack Lloyd <[email protected]>2018-10-03 16:05:34 -0400
committerJack Lloyd <[email protected]>2018-10-03 16:05:34 -0400
commitdeb0ebe8361aee545b67a52032af1cfc6b008724 (patch)
treeec5bc20d57215f7a17ded467bcc4042fb3eb5f6f /src/tests/main.cpp
parenta631b8fe7b559c24ddd73e8e8bdb4e5d41df1780 (diff)
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
Diffstat (limited to 'src/tests/main.cpp')
-rw-r--r--src/tests/main.cpp12
1 files changed, 11 insertions, 1 deletions
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)
{