diff options
author | George Hazan <ghazan@miranda.im> | 2018-12-23 19:37:22 +0300 |
---|---|---|
committer | George Hazan <ghazan@miranda.im> | 2018-12-23 19:37:22 +0300 |
commit | 3a5a00dd6d1d0d0d0ff9c882faf1a8d958469323 (patch) | |
tree | 2694982e38ee0237e589a9479e11357a06537229 /src/mir_core | |
parent | 105158e0a4b2c23adb154e298aac9e10b665b18b (diff) |
we don't need this function, cause it's not called, and also we have openssl
Diffstat (limited to 'src/mir_core')
-rw-r--r-- | src/mir_core/src/mir_core.def | 1 | ||||
-rw-r--r-- | src/mir_core/src/mir_core64.def | 1 | ||||
-rw-r--r-- | src/mir_core/src/sha256.cpp | 31 |
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 1b50cfafc5..f2cd22e6d2 100644 --- a/src/mir_core/src/mir_core.def +++ b/src/mir_core/src/mir_core.def @@ -958,7 +958,6 @@ mir_sha256_write @1147 mir_forkthreadowner @1148
hex2bin @1149
hex2binW @1150
-mir_hmac_sha256 @1151
Utf8toUcs2 @1152
db_add_contact @1153
db_delete_contact @1154
diff --git a/src/mir_core/src/mir_core64.def b/src/mir_core/src/mir_core64.def index f43d9b35ed..4b454ab756 100644 --- a/src/mir_core/src/mir_core64.def +++ b/src/mir_core/src/mir_core64.def @@ -958,7 +958,6 @@ mir_sha256_write @1147 mir_forkthreadowner @1148
hex2bin @1149
hex2binW @1150
-mir_hmac_sha256 @1151
Utf8toUcs2 @1152
db_add_contact @1153
db_delete_contact @1154
diff --git a/src/mir_core/src/sha256.cpp b/src/mir_core/src/sha256.cpp index 69821977e4..e3e5991f5f 100644 --- a/src/mir_core/src/sha256.cpp +++ b/src/mir_core/src/sha256.cpp @@ -287,34 +287,3 @@ MIR_CORE_DLL(void) mir_sha256_hash(const void *dataIn, size_t len, BYTE hashout[ mir_sha256_write(&tmp, dataIn, len);
mir_sha256_final(&tmp, hashout);
}
-
-/////////////////////////////////////////////////////////////////////////////////////////
-
-MIR_CORE_DLL(void) mir_hmac_sha256(BYTE hashout[MIR_SHA256_HASH_SIZE], const BYTE *key, size_t keylen, const BYTE *text, size_t textlen)
-{
- SHA256_CONTEXT ctx;
- BYTE usedKey[MIR_SHA_BLOCKSIZE] = { 0 };
-
- if (keylen > MIR_SHA_BLOCKSIZE) {
- mir_sha256_init(&ctx);
- mir_sha256_write(&ctx, key, (int)keylen);
- mir_sha256_final(&ctx, usedKey);
- }
- else memcpy(usedKey, key, keylen);
-
- for (size_t i = 0; i < MIR_SHA_BLOCKSIZE; i++)
- usedKey[i] ^= 0x36;
-
- mir_sha256_init(&ctx);
- mir_sha256_write(&ctx, usedKey, MIR_SHA_BLOCKSIZE);
- mir_sha256_write(&ctx, text, textlen);
- mir_sha256_final(&ctx, hashout);
-
- for (size_t i = 0; i < MIR_SHA_BLOCKSIZE; i++)
- usedKey[i] ^= 0x5C ^ 0x36;
-
- mir_sha256_init(&ctx);
- mir_sha256_write(&ctx, usedKey, MIR_SHA_BLOCKSIZE);
- mir_sha256_write(&ctx, hashout, MIR_SHA256_HASH_SIZE);
- mir_sha256_final(&ctx, hashout);
-}
|