aboutsummaryrefslogtreecommitdiffstats
path: root/src/tests/test_bigint.cpp
diff options
context:
space:
mode:
authorJack Lloyd <[email protected]>2016-11-04 11:03:08 -0400
committerJack Lloyd <[email protected]>2016-11-04 11:03:08 -0400
commit5ce3241ef02af8555c6b731ff89dbd352fa96e9b (patch)
tree92dafc7f45f34649eef291171064f9f04366c5cf /src/tests/test_bigint.cpp
parentbb88e7c8c1cff8c671e8402c37929a67c67ea7e6 (diff)
Handle missing SHA-x in DSA param gen test
Diffstat (limited to 'src/tests/test_bigint.cpp')
-rw-r--r--src/tests/test_bigint.cpp21
1 files changed, 13 insertions, 8 deletions
diff --git a/src/tests/test_bigint.cpp b/src/tests/test_bigint.cpp
index 3d9fd7139..b54f0082f 100644
--- a/src/tests/test_bigint.cpp
+++ b/src/tests/test_bigint.cpp
@@ -533,15 +533,20 @@ class DSA_ParamGen_Test : public Text_Based_Test
if(Test::soak_level() <= 5 && p_bits > 1024)
return result;
- Botan::BigInt gen_P, gen_Q;
- if(Botan::generate_dsa_primes(Test::rng(), gen_P, gen_Q, p_bits, q_bits, seed))
- {
- result.test_eq("P", gen_P, P);
- result.test_eq("Q", gen_Q, Q);
- }
- else
+ try {
+ Botan::BigInt gen_P, gen_Q;
+ if(Botan::generate_dsa_primes(Test::rng(), gen_P, gen_Q, p_bits, q_bits, seed))
+ {
+ result.test_eq("P", gen_P, P);
+ result.test_eq("Q", gen_Q, Q);
+ }
+ else
+ {
+ result.test_failure("Seed did not generate a DSA parameter");
+ }
+ }
+ catch(Botan::Algorithm_Not_Found&)
{
- result.test_failure("Seed did not generate a DSA parameter");
}
return result;