--- a/libpurple/protocols/jabber/auth_scram.c Sat May 27 20:04:10 2017 -0300
+++ b/libpurple/protocols/jabber/auth_scram.c Wed Apr 12 01:44:03 2017 -0300
@@ -129,12 +129,12 @@
* is the hash algorithm. All buffers must be of the appropriate size
* according to the JabberScramHash.
- * "str" is a NULL-terminated string for hmac().
+ * "str" is a NULL-terminated string for jabber_scram_hmac(). * Needless to say, these are fragile.
-hmac(const JabberScramHash *hash, guchar *out, const guchar *key, const gchar *str)
+jabber_scram_hmac(const JabberScramHash *hash, guchar *out, const guchar *key, const gchar *str) PurpleCipherContext *context;
@@ -147,7 +147,7 @@
-hash(const JabberScramHash *hash, guchar *out, const guchar *data)
+jabber_scram_hash(const JabberScramHash *hash, guchar *out, const guchar *data) PurpleCipherContext *context;
@@ -187,18 +187,18 @@
/* client_key = HMAC(salted_password, "Client Key") */
- hmac(data->hash, client_key, salted_password, "Client Key");
+ jabber_scram_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");
+ jabber_scram_hmac(data->hash, server_key, salted_password, "Server Key"); /* stored_key = HASH(client_key) */
- hash(data->hash, stored_key, client_key);
+ jabber_scram_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);
+ jabber_scram_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);
+ jabber_scram_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)