diff options
author | joerg <joerg@pkgsrc.org> | 2016-12-15 23:45:42 +0000 |
---|---|---|
committer | joerg <joerg@pkgsrc.org> | 2016-12-15 23:45:42 +0000 |
commit | 6b1ea02f6dff254e99731ae08d776daaae316ef6 (patch) | |
tree | 5231032da8bec084c449420dbd5ab55630f7a92a /chat/prosody | |
parent | c45f81cc46d877f8df9eb5bbc6309ba0290a397d (diff) | |
download | pkgsrc-6b1ea02f6dff254e99731ae08d776daaae316ef6.tar.gz |
Don't conflict with NetBSD's hmac(3).
Diffstat (limited to 'chat/prosody')
-rw-r--r-- | chat/prosody/distinfo | 3 | ||||
-rw-r--r-- | chat/prosody/patches/patch-util-src_hashes.c | 40 |
2 files changed, 42 insertions, 1 deletions
diff --git a/chat/prosody/distinfo b/chat/prosody/distinfo index fc95fb311ae..fac5bf59546 100644 --- a/chat/prosody/distinfo +++ b/chat/prosody/distinfo @@ -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-ab) = 755dd6d77689ef56ea4468f943f149933be72378 SHA1 (patch-ad) = abcae34982fee846c00252be1c0b033a44ad65d0 SHA1 (patch-prosodyctl) = e3e3a8f03c6d7c74b9026cf7ada765ee86c8397e SHA1 (patch-util-src_Makefile) = be6d7dd7224a56687238a85827756c109d068a96 +SHA1 (patch-util-src_hashes.c) = ddd8a623209def4e7ff923d71a20e0c143f6ebaf diff --git a/chat/prosody/patches/patch-util-src_hashes.c b/chat/prosody/patches/patch-util-src_hashes.c new file mode 100644 index 00000000000..2add2ec9e64 --- /dev/null +++ b/chat/prosody/patches/patch-util-src_hashes.c @@ -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)); |