projects
/
oweals
/
openssl.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
e7c2ad5
)
Fix HMAC to pass invalid key len test
author
Matt Caswell
<matt@openssl.org>
Tue, 10 Feb 2015 13:15:25 +0000
(13:15 +0000)
committer
Matt Caswell
<matt@openssl.org>
Wed, 25 Mar 2015 12:58:56 +0000
(12:58 +0000)
Reviewed-by: Richard Levitte <levitte@openssl.org>
crypto/hmac/hmac.c
patch
|
blob
|
history
diff --git
a/crypto/hmac/hmac.c
b/crypto/hmac/hmac.c
index 31d08ef88123f8d7f63522a8147b356d8a6a7cf7..0eea5626e6b24d413f385e2a76b135c188a7257f 100644
(file)
--- a/
crypto/hmac/hmac.c
+++ b/
crypto/hmac/hmac.c
@@
-123,7
+123,8
@@
int HMAC_Init_ex(HMAC_CTX *ctx, const void *key, int len,
&ctx->key_length))
goto err;
} else {
- OPENSSL_assert(len >= 0 && len <= (int)sizeof(ctx->key));
+ if(len < 0 || len > (int)sizeof(ctx->key))
+ return 0;
memcpy(ctx->key, key, len);
ctx->key_length = len;
}