pkgsrc-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc/chat/prosody Don't conflict with NetBSD's hmac(3).



details:   https://anonhg.NetBSD.org/pkgsrc/rev/d5002998129a
branches:  trunk
changeset: 355925:d5002998129a
user:      joerg <joerg%pkgsrc.org@localhost>
date:      Thu Dec 15 23:45:42 2016 +0000

description:
Don't conflict with NetBSD's hmac(3).

diffstat:

 chat/prosody/distinfo                        |   3 +-
 chat/prosody/patches/patch-util-src_hashes.c |  40 ++++++++++++++++++++++++++++
 2 files changed, 42 insertions(+), 1 deletions(-)

diffs (58 lines):

diff -r 2c0349412b56 -r d5002998129a chat/prosody/distinfo
--- a/chat/prosody/distinfo     Thu Dec 15 23:45:07 2016 +0000
+++ b/chat/prosody/distinfo     Thu Dec 15 23:45:42 2016 +0000
@@ -1,4 +1,4 @@
-$NetBSD: distinfo,v 1.12 2016/02/01 12:35:33 fhajny Exp $
+$NetBSD: distinfo,v 1.13 2016/12/15 23:45:42 joerg Exp $
 
 SHA1 (prosody-0.9.10.tar.gz) = 572b3dc6f29cb304cc7d4c5a2ef570cf0638fe63
 RMD160 (prosody-0.9.10.tar.gz) = adee85a03e80b8953c55ec6dc5e89773c342bc5a
@@ -9,3 +9,4 @@
 SHA1 (patch-ad) = abcae34982fee846c00252be1c0b033a44ad65d0
 SHA1 (patch-prosodyctl) = e3e3a8f03c6d7c74b9026cf7ada765ee86c8397e
 SHA1 (patch-util-src_Makefile) = be6d7dd7224a56687238a85827756c109d068a96
+SHA1 (patch-util-src_hashes.c) = ddd8a623209def4e7ff923d71a20e0c143f6ebaf
diff -r 2c0349412b56 -r d5002998129a chat/prosody/patches/patch-util-src_hashes.c
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/chat/prosody/patches/patch-util-src_hashes.c      Thu Dec 15 23:45:42 2016 +0000
@@ -0,0 +1,40 @@
+$NetBSD: patch-util-src_hashes.c,v 1.1 2016/12/15 23:45:42 joerg Exp $
+
+Avoid conflict with NetBSD's hmac.
+
+--- util-src/hashes.c.orig     2016-12-15 15:20:05.616992510 +0000
++++ util-src/hashes.c
+@@ -70,7 +70,7 @@ struct hash_desc {
+       void *ctx, *ctxo;
+ };
+ 
+-static void hmac(struct hash_desc *desc, const char *key, size_t key_len,
++static void myhmac(struct hash_desc *desc, const char *key, size_t key_len,
+     const char *msg, size_t msg_len, unsigned char *result)
+ {
+       union xory {
+@@ -124,7 +124,7 @@ static int myFunc(lua_State *L) { \
+       desc.digestLength = size; \
+       desc.ctx = &ctx; \
+       desc.ctxo = &ctxo; \
+-      hmac(&desc, key, key_len, msg, msg_len, hash); \
++      myhmac(&desc, key, key_len, msg, msg_len, hash); \
+       if (hex_out) { \
+               toHex(hash, size, result); \
+               lua_pushlstring(L, (char*)result, size*2); \
+@@ -168,13 +168,13 @@ static int LscramHi(lua_State *L) {
+               luaL_error(L, "Out of memory in scramHi");
+       memcpy(salt2, salt, salt_len);
+       memcpy(salt2 + salt_len, "\0\0\0\1", 4);
+-      hmac(&desc, str, str_len, salt2, salt_len + 4, Ust);
++      myhmac(&desc, str, str_len, salt2, salt_len + 4, Ust);
+       free(salt2);
+ 
+       memcpy(res.bytes, Ust, sizeof(res));
+       for (i = 1; i < iter; i++) {
+               int j;
+-              hmac(&desc, str, str_len, (char*)Ust, sizeof(Ust), Und.bytes);
++              myhmac(&desc, str, str_len, (char*)Ust, sizeof(Ust), Und.bytes);
+               for (j = 0; j < SHA_DIGEST_LENGTH/4; j++)
+                       res.quadbytes[j] ^= Und.quadbytes[j];
+               memcpy(Ust, Und.bytes, sizeof(Ust));



Home | Main Index | Thread Index | Old Index