aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2019-04-19 13:24:32 +0200
committerKim Alvefur <zash@zash.se>2019-04-19 13:24:32 +0200
commit86219e253244ae0aab1b27195410affee3c22ab2 (patch)
tree6aa3af8eb212f915ca7ef35f50bf7ddf64681807
parent5bc034dcf55c76081728e75c3b53457d5dcaa20d (diff)
downloadprosody-86219e253244ae0aab1b27195410affee3c22ab2.tar.gz
prosody-86219e253244ae0aab1b27195410affee3c22ab2.zip
util.hashes: Remove now unused hmac() function
-rw-r--r--util-src/hashes.c38
1 files changed, 0 insertions, 38 deletions
diff --git a/util-src/hashes.c b/util-src/hashes.c
index ac6cac7e..75eb116d 100644
--- a/util-src/hashes.c
+++ b/util-src/hashes.c
@@ -76,44 +76,6 @@ struct hash_desc {
void *ctx, *ctxo;
};
-static void hmac(struct hash_desc *desc, const char *key, size_t key_len,
- const char *msg, size_t msg_len, unsigned char *result) {
- union xory {
- unsigned char bytes[64];
- uint32_t quadbytes[16];
- };
-
- int i;
- unsigned char hashedKey[64]; /* Maximum used digest length */
- union xory k_ipad, k_opad;
-
- if(key_len > 64) {
- desc->Init(desc->ctx);
- desc->Update(desc->ctx, key, key_len);
- desc->Final(hashedKey, desc->ctx);
- key = (const char *)hashedKey;
- key_len = desc->digestLength;
- }
-
- memcpy(k_ipad.bytes, key, key_len);
- memset(k_ipad.bytes + key_len, 0, 64 - key_len);
- memcpy(k_opad.bytes, k_ipad.bytes, 64);
-
- for(i = 0; i < 16; i++) {
- k_ipad.quadbytes[i] ^= HMAC_IPAD;
- k_opad.quadbytes[i] ^= HMAC_OPAD;
- }
-
- desc->Init(desc->ctx);
- desc->Update(desc->ctx, k_ipad.bytes, 64);
- desc->Init(desc->ctxo);
- desc->Update(desc->ctxo, k_opad.bytes, 64);
- desc->Update(desc->ctx, msg, msg_len);
- desc->Final(result, desc->ctx);
- desc->Update(desc->ctxo, result, desc->digestLength);
- desc->Final(result, desc->ctxo);
-}
-
#define MAKE_HMAC_FUNCTION(myFunc, evp, size, type) \
static int myFunc(lua_State *L) { \
unsigned char hash[size], result[2*size]; \