diff options
author | Jack Lloyd <[email protected]> | 2017-01-22 14:46:57 -0500 |
---|---|---|
committer | Jack Lloyd <[email protected]> | 2017-01-22 14:46:57 -0500 |
commit | 8583c92f502c616dbf8358b350b0d3f0f8f8d1b8 (patch) | |
tree | 15e72dff13b33128be0af561bcc84062a171d4c7 /src | |
parent | 1531c4fcd0c0817eaf3708f267a8a2895c1d7cb5 (diff) |
Add a test for trusted_hashes on path validation result
Diffstat (limited to 'src')
-rw-r--r-- | src/tests/unit_x509.cpp | 9 |
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())) |