aboutsummaryrefslogtreecommitdiffstats
path: root/src/keypair.cpp
diff options
context:
space:
mode:
authorlloyd <[email protected]>2006-09-30 06:14:12 +0000
committerlloyd <[email protected]>2006-09-30 06:14:12 +0000
commit268b1f3089a9692d9a4166a81375930cb1897401 (patch)
treeaa869ee1a6aaa1c9e82e8bab592f90ce16c23e70 /src/keypair.cpp
parente52d871393f180042822950966597d160b9adf70 (diff)
Catch Encoding_Error in the keypair consistency check when we generate the
signature; if we catch it, skip the rest of the tests.
Diffstat (limited to 'src/keypair.cpp')
-rw-r--r--src/keypair.cpp10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/keypair.cpp b/src/keypair.cpp
index eb613b971..ef3e5f2a9 100644
--- a/src/keypair.cpp
+++ b/src/keypair.cpp
@@ -46,7 +46,15 @@ void check_key(PK_Signer* signer, PK_Verifier* verifier)
SecureVector<byte> message(16);
Global_RNG::randomize(message, message.size());
- SecureVector<byte> signature = sig->sign_message(message);
+ SecureVector<byte> signature;
+
+ try {
+ signature = sig->sign_message(message);
+ }
+ catch(Encoding_Error)
+ {
+ return;
+ }
if(!ver->verify_message(message, signature))
throw Self_Test_Failure("Signature key pair consistency failure");