summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorlouiz’ <louiz@louiz.org>2017-03-06 00:51:43 +0100
committerlouiz’ <louiz@louiz.org>2017-03-06 00:57:33 +0100
commit99a4ddedaf903d27b781341108433ae2d9533ad1 (patch)
tree2662dddda921d84f6fd348e46f154261ad46c17a /src
parentd81c3ad5ac2c12130d90044b7597bf962a7cfe9e (diff)
downloadbiboumi-99a4ddedaf903d27b781341108433ae2d9533ad1.tar.gz
biboumi-99a4ddedaf903d27b781341108433ae2d9533ad1.tar.bz2
biboumi-99a4ddedaf903d27b781341108433ae2d9533ad1.tar.xz
biboumi-99a4ddedaf903d27b781341108433ae2d9533ad1.zip
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
Diffstat (limited to 'src')
-rw-r--r--src/identd/identd_socket.cpp9
1 files changed, 1 insertions, 8 deletions
diff --git a/src/identd/identd_socket.cpp b/src/identd/identd_socket.cpp
index 46553ca..a94f172 100644
--- a/src/identd/identd_socket.cpp
+++ b/src/identd/identd_socket.cpp
@@ -38,14 +38,7 @@ void IdentdSocket::parse_in_buffer(const std::size_t)
static std::string hash_jid(const std::string& jid)
{
- sha1nfo sha1;
- sha1_init(&sha1);
- sha1_write(&sha1, jid.data(), jid.size());
- const uint8_t* res = sha1_result(&sha1);
- std::ostringstream result;
- for (int i = 0; i < HASH_LENGTH; i++)
- result << std::hex << std::setfill('0') << std::setw(2) << static_cast<int>(res[i]);
- return result.str();
+ return sha1(jid);
}
std::string IdentdSocket::generate_answer(const BiboumiComponent& biboumi, uint16_t local, uint16_t remote)