From 99a4ddedaf903d27b781341108433ae2d9533ad1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?louiz=E2=80=99?= Date: Mon, 6 Mar 2017 00:51:43 +0100 Subject: Remove the embedded sha1 code, and use one of botan or gcrypt This adds a hard dependency on one of Botan or gcrypt. Botan is already a recommended dependency, and gcrypt is probably packaged almost everywhere, so this should not be a big deal. ref #3241 --- louloulibs/xmpp/auth.cpp | 15 +-------------- 1 file changed, 1 insertion(+), 14 deletions(-) (limited to 'louloulibs/xmpp/auth.cpp') diff --git a/louloulibs/xmpp/auth.cpp b/louloulibs/xmpp/auth.cpp index c20f95d..8a34a4e 100644 --- a/louloulibs/xmpp/auth.cpp +++ b/louloulibs/xmpp/auth.cpp @@ -2,20 +2,7 @@ #include -#include -#include - std::string get_handshake_digest(const std::string& stream_id, const std::string& secret) { - sha1nfo sha1; - sha1_init(&sha1); - sha1_write(&sha1, stream_id.data(), stream_id.size()); - sha1_write(&sha1, secret.data(), secret.size()); - const uint8_t* result = sha1_result(&sha1); - - std::ostringstream digest; - for (int i = 0; i < HASH_LENGTH; i++) - digest << std::hex << std::setfill('0') << std::setw(2) << static_cast(result[i]); - - return digest.str(); + return sha1(stream_id + secret); } -- cgit v1.2.3 From 0ab40dc1ab4e689921da54080b135e1d22b1c586 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?louiz=E2=80=99?= Date: Tue, 14 Mar 2017 21:45:23 +0100 Subject: Refactoring louloulibs and cmake Use OBJECT libraries Remove the louloulibs directory Write FOUND variables in the cache --- louloulibs/xmpp/auth.cpp | 8 -------- 1 file changed, 8 deletions(-) delete mode 100644 louloulibs/xmpp/auth.cpp (limited to 'louloulibs/xmpp/auth.cpp') diff --git a/louloulibs/xmpp/auth.cpp b/louloulibs/xmpp/auth.cpp deleted file mode 100644 index 8a34a4e..0000000 --- a/louloulibs/xmpp/auth.cpp +++ /dev/null @@ -1,8 +0,0 @@ -#include - -#include - -std::string get_handshake_digest(const std::string& stream_id, const std::string& secret) -{ - return sha1(stream_id + secret); -} -- cgit v1.2.3