diff options
author | Jack Lloyd <[email protected]> | 2018-10-03 16:05:34 -0400 |
---|---|---|
committer | Jack Lloyd <[email protected]> | 2018-10-03 16:05:34 -0400 |
commit | deb0ebe8361aee545b67a52032af1cfc6b008724 (patch) | |
tree | ec5bc20d57215f7a17ded467bcc4042fb3eb5f6f /src/tests/main.cpp | |
parent | a631b8fe7b559c24ddd73e8e8bdb4e5d41df1780 (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.cpp | 12 |
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) { |