diff options
author | Ben Laurie <ben@openssl.org> | 2002-11-13 15:43:43 +0000 |
---|---|---|
committer | Ben Laurie <ben@openssl.org> | 2002-11-13 15:43:43 +0000 |
commit | 54a656ef081f72a740c550ebd8099b40b8b5cde0 (patch) | |
tree | 9b3638b56848c7f0648b84cfa7ad056116b37a1b /crypto/hmac/hmac.c | |
parent | 8f797f14b8ff7d3d5cb04443284259a0c94860b3 (diff) |
Security fixes brought forward from 0.9.7.
Diffstat (limited to 'crypto/hmac/hmac.c')
-rw-r--r-- | crypto/hmac/hmac.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/crypto/hmac/hmac.c b/crypto/hmac/hmac.c index da363b7950..4c91f919d5 100644 --- a/crypto/hmac/hmac.c +++ b/crypto/hmac/hmac.c @@ -59,6 +59,7 @@ #include <stdlib.h> #include <string.h> #include <openssl/hmac.h> +#include "cryptlib.h" void HMAC_Init_ex(HMAC_CTX *ctx, const void *key, int len, const EVP_MD *md, ENGINE *impl) @@ -78,6 +79,7 @@ void HMAC_Init_ex(HMAC_CTX *ctx, const void *key, int len, { reset=1; j=EVP_MD_block_size(md); + OPENSSL_assert(j <= sizeof ctx->key); if (j < len) { EVP_DigestInit_ex(&ctx->md_ctx,md, impl); @@ -87,6 +89,7 @@ void HMAC_Init_ex(HMAC_CTX *ctx, const void *key, int len, } else { + OPENSSL_assert(len <= sizeof ctx->key); memcpy(ctx->key,key,len); ctx->key_length=len; } |