From 65fff4aee41bdc473ef2e5c435de31d9a25a6fe7 Mon Sep 17 00:00:00 2001 From: lloyd Date: Wed, 1 Oct 2008 14:30:40 +0000 Subject: Note in test suite output if DSA tests are being skipped --- checks/pk.cpp | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'checks') diff --git a/checks/pk.cpp b/checks/pk.cpp index 69221a1c5..9f74f1c22 100644 --- a/checks/pk.cpp +++ b/checks/pk.cpp @@ -394,9 +394,8 @@ u32bit validate_dsa_sig(const std::string& algo, strip_newlines(pass); /* it will have a newline thanks to the messy decoding method we use */ - bool failure = false; - #if defined(BOTAN_HAS_DSA) + DataSource_Memory keysource(reinterpret_cast(str[0].c_str()), str[0].length()); @@ -413,10 +412,12 @@ u32bit validate_dsa_sig(const std::string& algo, PK_Verifier* v = get_pk_verifier(*dsapub, emsa); PK_Signer* s = get_pk_signer(*dsapriv, emsa); + bool failure = false; validate_signature(v, s, algo, str[1], str[2], str[3], failure); + return (failure ? 1 : 0); #endif - return (failure ? 1 : 0); + return 2; } u32bit validate_dsa_ver(const std::string& algo, @@ -428,7 +429,6 @@ u32bit validate_dsa_ver(const std::string& algo, DataSource_Memory keysource(reinterpret_cast(str[0].c_str()), str[0].length()); - bool passed = true; #if defined(BOTAN_HAS_DSA) std::auto_ptr key(X509::load_key(keysource)); @@ -446,10 +446,11 @@ u32bit validate_dsa_ver(const std::string& algo, SecureVector sig = decode_hex(str[2]); v->set_input_format(DER_SEQUENCE); - passed = v->verify_message(msg, msg.size(), sig, sig.size()); + bool passed = v->verify_message(msg, msg.size(), sig, sig.size()); + return (passed ? 0 : 1); #endif - return (passed ? 0 : 1); + return 2; } u32bit validate_nr_sig(const std::string& algo, -- cgit v1.2.3