aboutsummaryrefslogtreecommitdiffstats
path: root/src/tests/unit_x509.cpp
diff options
context:
space:
mode:
authorJack Lloyd <[email protected]>2017-01-22 14:46:57 -0500
committerJack Lloyd <[email protected]>2017-01-22 14:46:57 -0500
commit8583c92f502c616dbf8358b350b0d3f0f8f8d1b8 (patch)
tree15e72dff13b33128be0af561bcc84062a171d4c7 /src/tests/unit_x509.cpp
parent1531c4fcd0c0817eaf3708f267a8a2895c1d7cb5 (diff)
Add a test for trusted_hashes on path validation result
Diffstat (limited to 'src/tests/unit_x509.cpp')
-rw-r--r--src/tests/unit_x509.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/tests/unit_x509.cpp b/src/tests/unit_x509.cpp
index dbaf88cd8..b51914ee8 100644
--- a/src/tests/unit_x509.cpp
+++ b/src/tests/unit_x509.cpp
@@ -375,6 +375,15 @@ Test::Result test_x509_cert(const std::string& sig_algo, const std::string& hash
{
result.test_note("user 1 validation result was " + result_u1.result_string());
}
+ else
+ {
+ const std::set<std::string> u1_hashes = result_u1.trusted_hashes();
+
+ if(result.test_eq("Single trusted hash", u1_hashes.size(), 1))
+ {
+ result.test_eq("Hash matches test", *u1_hashes.begin(), hash_fn);
+ }
+ }
Botan::Path_Validation_Result result_u2 = Botan::x509_path_validate(user2_cert, restrictions, store);
if(!result.confirm("user 2 validates", result_u2.successful_validation()))