aboutsummaryrefslogtreecommitdiffstats
path: root/checks/pk.cpp
diff options
context:
space:
mode:
authorlloyd <[email protected]>2008-10-01 14:30:40 +0000
committerlloyd <[email protected]>2008-10-01 14:30:40 +0000
commit65fff4aee41bdc473ef2e5c435de31d9a25a6fe7 (patch)
tree36d4a309e4cee6d7e15038de7fda0b1634e868d4 /checks/pk.cpp
parent7438e2c57df90ea379745790de243b4b30aeb3e9 (diff)
Note in test suite output if DSA tests are being skipped
Diffstat (limited to 'checks/pk.cpp')
-rw-r--r--checks/pk.cpp13
1 files changed, 7 insertions, 6 deletions
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<const byte*>(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<const byte*>(str[0].c_str()),
str[0].length());
- bool passed = true;
#if defined(BOTAN_HAS_DSA)
std::auto_ptr<Public_Key> key(X509::load_key(keysource));
@@ -446,10 +446,11 @@ u32bit validate_dsa_ver(const std::string& algo,
SecureVector<byte> 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,