Fix for doing base64(hex(sha1))

Instead we want to base64 encode the raw sha1
This commit is contained in:
Stephen Paul Weber
2026-09-24 21:38:34 -05:00
parent 69b8797d3b
commit 2217cbeab3
4 changed files with 24 additions and 4 deletions
+3 -3
View File
@@ -32,7 +32,7 @@ TEST_CASE("Hash disco 1") {
auto check_stanza = [](const Stanza &stanza) {
const std::string hash = Xmpp::hash_disco_sha1(stanza);
CHECK(hash == "YjVkN2NhODU2ZWQyZjhhNjJjOTE1MWMxYjQ0YmUwM2Q0ODhhZDI2MA==");
CHECK(hash == "tdfKhW7S+KYskVHBtEvgPUiK0mA=");
};
xml.add_stanza_callback([check_stanza](const Stanza &stanza) {
check_stanza(stanza);
@@ -62,7 +62,7 @@ TEST_CASE("Hash disco 2") {
auto check_stanza = [](const Stanza &stanza) {
const std::string hash = Xmpp::hash_disco_sha1(stanza);
CHECK(hash == "ZmY1ZTJjZjUyZjkwMjA2OTliZGFhYzYxMmVmMTI5YjdmYzNhZTIwYw==");
CHECK(hash == "/14s9S+QIGmb2qxhLvEpt/w64gw=");
};
xml.add_stanza_callback([check_stanza](const Stanza &stanza) {
check_stanza(stanza);
@@ -91,7 +91,7 @@ TEST_CASE("Hash disco 2 different order") {
auto check_stanza = [](const Stanza &stanza) {
const std::string hash = Xmpp::hash_disco_sha1(stanza);
CHECK(hash == "ZmY1ZTJjZjUyZjkwMjA2OTliZGFhYzYxMmVmMTI5YjdmYzNhZTIwYw==");
CHECK(hash == "/14s9S+QIGmb2qxhLvEpt/w64gw=");
};
xml.add_stanza_callback([check_stanza](const Stanza &stanza) {
check_stanza(stanza);