Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/boringssl.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Benjamin <davidben@chromium.org>2015-03-01 04:45:54 +0300
committerAdam Langley <agl@google.com>2015-03-03 02:15:20 +0300
commitcc239d3903f908fff2933f379577cf8f57482a09 (patch)
tree482a53d127fb5b71317f993e4e6d4c60fd5fe21b /crypto/hmac
parent0d5e080ab948da74be68e5f9f6c002fedc99a3ec (diff)
Use HMAC_Init_ex, not HMAC_Init, in HMAC.
We've already initialized the context, HMAC_Init has questionable behavior around NULL keys, and this avoids a size_t truncation. Change-Id: Iab6bfc24fe22d46ca4c01be6129efe0630d553e6 Reviewed-on: https://boringssl-review.googlesource.com/3732 Reviewed-by: Adam Langley <agl@google.com>
Diffstat (limited to 'crypto/hmac')
-rw-r--r--crypto/hmac/hmac.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/crypto/hmac/hmac.c b/crypto/hmac/hmac.c
index f179fede..21479c2a 100644
--- a/crypto/hmac/hmac.c
+++ b/crypto/hmac/hmac.c
@@ -76,7 +76,7 @@ uint8_t *HMAC(const EVP_MD *evp_md, const void *key, size_t key_len,
}
HMAC_CTX_init(&ctx);
- if (!HMAC_Init(&ctx, key, key_len, evp_md) ||
+ if (!HMAC_Init_ex(&ctx, key, key_len, evp_md, NULL) ||
!HMAC_Update(&ctx, data, data_len) ||
!HMAC_Final(&ctx, out, out_len)) {
out = NULL;