Skip to content

Commit

Permalink
Fix conflict with NetBSD's hmac(3) function.
Browse files Browse the repository at this point in the history
Makes this build again on NetBSD-7.99.33.
  • Loading branch information
wiz committed Jul 6, 2016
1 parent 9eb6a3c commit 367dd7e
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 1 deletion.
3 changes: 2 additions & 1 deletion chat/libpurple/distinfo
@@ -1,9 +1,10 @@
$NetBSD: distinfo,v 1.44 2016/01/13 22:25:38 wiz Exp $
$NetBSD: distinfo,v 1.45 2016/07/06 05:57:51 wiz Exp $

SHA1 (pidgin-2.10.12.tar.bz2) = 4550a447f35b869554c2d7d7bc1c7d84a01ce238
RMD160 (pidgin-2.10.12.tar.bz2) = 22b14ba35cef488cb25d89b59aeb6c9923a4d924
SHA512 (pidgin-2.10.12.tar.bz2) = 4756bed3ae78b48bfeaa586def3c7a0014db76ce14ae8c6773c96bdca24b65e92b2805270af43960e2a11a600aeac35e030faa3f79dbe3301084ca9d970a5f03
Size (pidgin-2.10.12.tar.bz2) = 9837598 bytes
SHA1 (patch-configure) = 74d033d148d74d0233c7ad33411b9ebcfbab7851
SHA1 (patch-libpurple_plugins_perl_common_Makefile.PL.in) = 40326826000ed42e7570486f89f3196b58093d48
SHA1 (patch-libpurple_protocols_jabber_auth__scram.c) = 26384081c1065a26185019d715a007653b496e1e
SHA1 (patch-libpurple_protocols_mxit_profile.c) = e14883061131da2a3d31479584c5b267e451b721
@@ -0,0 +1,38 @@
$NetBSD: patch-libpurple_protocols_jabber_auth__scram.c,v 1.1 2016/07/06 05:57:51 wiz Exp $

Fix conflict with NetBSD's hmac(3) function.

--- libpurple/protocols/jabber/auth_scram.c.orig 2015-12-31 23:19:40.000000000 +0000
+++ libpurple/protocols/jabber/auth_scram.c
@@ -134,7 +134,7 @@ guchar *jabber_scram_hi(const JabberScra
* Needless to say, these are fragile.
*/
static void
-hmac(const JabberScramHash *hash, guchar *out, const guchar *key, const gchar *str)
+purple_hmac(const JabberScramHash *hash, guchar *out, const guchar *key, const gchar *str)
{
PurpleCipherContext *context;

@@ -187,18 +187,18 @@ jabber_scram_calc_proofs(JabberScramData
return FALSE;

/* client_key = HMAC(salted_password, "Client Key") */
- hmac(data->hash, client_key, salted_password, "Client Key");
+ purple_hmac(data->hash, client_key, salted_password, "Client Key");
/* server_key = HMAC(salted_password, "Server Key") */
- hmac(data->hash, server_key, salted_password, "Server Key");
+ purple_hmac(data->hash, server_key, salted_password, "Server Key");
g_free(salted_password);

/* stored_key = HASH(client_key) */
hash(data->hash, stored_key, client_key);

/* client_signature = HMAC(stored_key, auth_message) */
- hmac(data->hash, client_signature, stored_key, data->auth_message->str);
+ purple_hmac(data->hash, client_signature, stored_key, data->auth_message->str);
/* server_signature = HMAC(server_key, auth_message) */
- hmac(data->hash, (guchar *)data->server_signature->str, server_key, data->auth_message->str);
+ purple_hmac(data->hash, (guchar *)data->server_signature->str, server_key, data->auth_message->str);

/* client_proof = client_key XOR client_signature */
for (i = 0; i < hash_len; ++i)

0 comments on commit 367dd7e

Please sign in to comment.