From: Fred Morcos Date: Wed, 9 Nov 2022 16:45:58 +0000 (+0100) Subject: OpenSSL signers test for getPubKeyHash() X-Git-Tag: dnsdist-1.8.0-rc1~124^2~3 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=49011353100157830e37a86fd49327516d8d21ed;p=thirdparty%2Fpdns.git OpenSSL signers test for getPubKeyHash() --- diff --git a/pdns/test-signers.cc b/pdns/test-signers.cc index 523eb3a971..2f37332f87 100644 --- a/pdns/test-signers.cc +++ b/pdns/test-signers.cc @@ -28,6 +28,7 @@ struct SignerParams std::string name; std::string rfcMsgDump; std::string rfcB64Signature; + std::string pubKeyHash; int bits; uint16_t flags; uint16_t rfcFlags; @@ -76,6 +77,7 @@ static const SignerParams rsaSha256SignerParams = SignerParams{ .rfcMsgDump = "", .rfcB64Signature = "", + .pubKeyHash = "QH+uURzTHkYZ5MrwNvOrn+BtnL4=", .bits = 512, .flags = 256, @@ -130,6 +132,7 @@ static const SignerParams ecdsaSha256 = SignerParams{ .rfcMsgDump = "", .rfcB64Signature = "", + .pubKeyHash = "aIQTEsTXwMDIOXPY9e6W1G1AnAk=", .bits = 256, .flags = 256, @@ -187,6 +190,7 @@ static const SignerParams ed25519 = SignerParams{ // https://www.rfc-editor.org/errata_search.php?rfc=8080&eid=4935 .rfcB64Signature = "oL9krJun7xfBOIWcGHi7mag5/hdZrKWw15jPGrHpjQeR" "AvTdszaPD+QLs3fx8A4M3e23mRZ9VrbpMngwcrqNAg==", + .pubKeyHash = "l02Woi0iS8Aa25FQkUd9RMzZHJpBoRQwAQEX1SxZJA4=", .bits = 256, .flags = 256, @@ -248,6 +252,8 @@ static const SignerParams ed448 = SignerParams{ .rfcB64Signature = "3cPAHkmlnxcDHMyg7vFC34l0blBhuG1qpwLmjInI8w1CMB29FkEA" "IJUA0amxWndkmnBZ6SKiwZSAxGILn/NBtOXft0+Gj7FSvOKxE/07" "+4RQvE581N3Aj/JtIyaiYVdnYtyMWbSNyGEY2213WKsJlwEA", + .pubKeyHash = "3kgROaDjrh0H2iuixWBrc8g2EpBBLCdGzHmn+G2MpTPhpj/" + "OiBVHHSfPodx1FYYUcJKm1MDpJtIA", .bits = 456, .flags = 256, @@ -414,6 +420,8 @@ static void test_generic_signer(std::shared_ptr dcke, DNSKEY if (!signer.rfcMsgDump.empty() && !signer.rfcB64Signature.empty()) { checkRR(signer); } + + BOOST_CHECK_EQUAL(Base64Encode(dcke->getPubKeyHash()), signer.pubKeyHash); } BOOST_FIXTURE_TEST_CASE(test_generic_signers, Fixture)