Refactor the sha1 digest into its own function, and do not use sprintf
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
#include "catch.hpp"
|
||||
|
||||
#include <xmpp/xmpp_parser.hpp>
|
||||
#include <xmpp/auth.hpp>
|
||||
|
||||
TEST_CASE("Test basic XML parsing")
|
||||
{
|
||||
@@ -45,3 +46,9 @@ TEST_CASE("XML escape")
|
||||
const std::string unescaped = "'coucou'<cc>/&\"gaga\"";
|
||||
CHECK(xml_escape(unescaped) == "'coucou'<cc>/&"gaga"");
|
||||
}
|
||||
|
||||
TEST_CASE("handshake_digest")
|
||||
{
|
||||
const auto res = get_handshake_digest("id1234", "S4CR3T");
|
||||
CHECK(res == "c92901b5d376ad56269914da0cce3aab976847df");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user