diff options
author | Jack Lloyd <[email protected]> | 2017-01-06 20:29:22 -0500 |
---|---|---|
committer | Jack Lloyd <[email protected]> | 2017-01-06 20:29:22 -0500 |
commit | 5d82fa42ca4943c89ee48830e3ad8927f287538d (patch) | |
tree | 95ea54437f904aedb5ddd8b0075ce81e439beb9c /src/tests | |
parent | 7b9b0c41137e96eaaea9bf1725d8c6b9341585a7 (diff) |
Work around an apparent problem with GCC on AIX
When compiled by GCC 4.8 on AIX 7.1 ppc32, the TLS policy tests
fail because the exception thrown from the TLS policy check ends up
not being caught at runtime by the test if the catch statement
is for `std::exception&` or even `Botan::Exception&` but only
if the actually thrown type `Botan::TLS::TLS_Exception` is caught.
Diffstat (limited to 'src/tests')
-rw-r--r-- | src/tests/unit_tls_policy.cpp | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/tests/unit_tls_policy.cpp b/src/tests/unit_tls_policy.cpp index 95290b933..bd8be6e03 100644 --- a/src/tests/unit_tls_policy.cpp +++ b/src/tests/unit_tls_policy.cpp @@ -12,6 +12,7 @@ #include <botan/pubkey.h> #include <botan/oids.h> #include <botan/tls_policy.h> + #include <botan/tls_exceptn.h> #endif #if defined(BOTAN_HAS_RSA) @@ -62,7 +63,7 @@ class TLS_Policy_Unit_Tests : public Test policy.check_peer_key_acceptable(*rsa_key_1024); result.test_failure("Incorrectly accepting 1024 bit RSA keys"); } - catch(std::exception& e) + catch(Botan::TLS::TLS_Exception&) { result.test_success("Correctly rejecting 1024 bit RSA keys"); } @@ -87,7 +88,7 @@ class TLS_Policy_Unit_Tests : public Test policy.check_peer_key_acceptable(*ecdh_192); result.test_failure("Incorrectly accepting 192 bit EC keys"); } - catch(std::exception& e) + catch(Botan::TLS::TLS_Exception&) { result.test_success("Correctly rejecting 192 bit EC keys"); } @@ -113,7 +114,7 @@ class TLS_Policy_Unit_Tests : public Test policy.check_peer_key_acceptable(*ecdsa_192); result.test_failure("Incorrectly accepting 192 bit EC keys"); } - catch(std::exception& e) + catch(Botan::TLS::TLS_Exception&) { result.test_success("Correctly rejecting 192 bit EC keys"); } @@ -142,7 +143,7 @@ class TLS_Policy_Unit_Tests : public Test policy.check_peer_key_acceptable(*dhkey); result.test_failure("Incorrectly accepting short bit DH keys"); } - catch(std::exception& e) + catch(Botan::TLS::TLS_Exception&) { result.test_success("Correctly rejecting short bit DH keys"); } |