summaryrefslogtreecommitdiff
path: root/src/mir_core
diff options
context:
space:
mode:
authorGeorge Hazan <ghazan@miranda.im>2018-12-23 20:11:05 +0300
committerGeorge Hazan <ghazan@miranda.im>2018-12-23 20:11:05 +0300
commitff6b8261d89a2ac071bba0ebe0e16b40dd7122a1 (patch)
tree4259ca6e16d4bf453be0bc2aaa31f5a5ba413051 /src/mir_core
parent6c05257b0cee0cfd1599e1f771dfadfe6035141f (diff)
in fact, we don't need mir_hmac_sha1 either
Diffstat (limited to 'src/mir_core')
-rw-r--r--src/mir_core/src/mir_core.def1
-rw-r--r--src/mir_core/src/mir_core64.def1
-rw-r--r--src/mir_core/src/sha1.cpp31
3 files changed, 0 insertions, 33 deletions
diff --git a/src/mir_core/src/mir_core.def b/src/mir_core/src/mir_core.def
index f2cd22e6d2..4a744c5b5f 100644
--- a/src/mir_core/src/mir_core.def
+++ b/src/mir_core/src/mir_core.def
@@ -164,7 +164,6 @@ mir_writeLogVA @226
mir_writeLogVW @227
bin2hex @228
bin2hexW @229
-mir_hmac_sha1 @230
mir_base64_encodebuf @231
mirstr_allocate @232
mirstr_free @233
diff --git a/src/mir_core/src/mir_core64.def b/src/mir_core/src/mir_core64.def
index 4b454ab756..3f25e54f77 100644
--- a/src/mir_core/src/mir_core64.def
+++ b/src/mir_core/src/mir_core64.def
@@ -164,7 +164,6 @@ mir_writeLogVA @226
mir_writeLogVW @227
bin2hex @228
bin2hexW @229
-mir_hmac_sha1 @230
mir_base64_encodebuf @231
mirstr_allocate @232
mirstr_free @233
diff --git a/src/mir_core/src/sha1.cpp b/src/mir_core/src/sha1.cpp
index 10f47d7867..435f6f440b 100644
--- a/src/mir_core/src/sha1.cpp
+++ b/src/mir_core/src/sha1.cpp
@@ -153,34 +153,3 @@ MIR_CORE_DLL(void) mir_sha1_hash(BYTE *dataIn, size_t len, BYTE hashout[20])
mir_sha1_append(&ctx, dataIn, len);
mir_sha1_finish(&ctx, hashout);
}
-
-/////////////////////////////////////////////////////////////////////////////////////////
-
-MIR_CORE_DLL(void) mir_hmac_sha1(BYTE hashout[MIR_SHA1_HASH_SIZE], const BYTE *key, size_t keylen, const BYTE *text, size_t textlen)
-{
- mir_sha1_ctx ctx;
- BYTE usedKey[MIR_SHA_BLOCKSIZE] = { 0 };
-
- if (keylen > MIR_SHA_BLOCKSIZE) {
- mir_sha1_init(&ctx);
- mir_sha1_append(&ctx, key, (int)keylen);
- mir_sha1_finish(&ctx, usedKey);
- }
- else memcpy(usedKey, key, keylen);
-
- for (size_t i = 0; i < MIR_SHA_BLOCKSIZE; i++)
- usedKey[i] ^= 0x36;
-
- mir_sha1_init(&ctx);
- mir_sha1_append(&ctx, usedKey, MIR_SHA_BLOCKSIZE);
- mir_sha1_append(&ctx, text, (int)textlen);
- mir_sha1_finish(&ctx, hashout);
-
- for (size_t i = 0; i < MIR_SHA_BLOCKSIZE; i++)
- usedKey[i] ^= 0x5C ^ 0x36;
-
- mir_sha1_init(&ctx);
- mir_sha1_append(&ctx, usedKey, MIR_SHA_BLOCKSIZE);
- mir_sha1_append(&ctx, hashout, MIR_SHA1_HASH_SIZE);
- mir_sha1_finish(&ctx, hashout);
-}