diff options
author | markus <> | 2003-05-12 02:18:40 +0000 |
---|---|---|
committer | markus <> | 2003-05-12 02:18:40 +0000 |
commit | d4fcd82bb7f6d603bd61e19a81ba97337b89dfca (patch) | |
tree | d52e3a0f1f08f65ad283027e560e17ed0d720462 /src/lib/libcrypto/hmac/hmac.c | |
parent | 582bbd139cd2afd58d10dc051c5b0b989b441074 (diff) | |
download | openbsd-d4fcd82bb7f6d603bd61e19a81ba97337b89dfca.tar.gz openbsd-d4fcd82bb7f6d603bd61e19a81ba97337b89dfca.tar.bz2 openbsd-d4fcd82bb7f6d603bd61e19a81ba97337b89dfca.zip |
merge 0.9.7b with local changes; crank majors for libssl/libcrypto
Diffstat (limited to 'src/lib/libcrypto/hmac/hmac.c')
-rw-r--r-- | src/lib/libcrypto/hmac/hmac.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/lib/libcrypto/hmac/hmac.c b/src/lib/libcrypto/hmac/hmac.c index da363b7950..4c91f919d5 100644 --- a/src/lib/libcrypto/hmac/hmac.c +++ b/src/lib/libcrypto/hmac/hmac.c | |||
@@ -59,6 +59,7 @@ | |||
59 | #include <stdlib.h> | 59 | #include <stdlib.h> |
60 | #include <string.h> | 60 | #include <string.h> |
61 | #include <openssl/hmac.h> | 61 | #include <openssl/hmac.h> |
62 | #include "cryptlib.h" | ||
62 | 63 | ||
63 | void HMAC_Init_ex(HMAC_CTX *ctx, const void *key, int len, | 64 | void HMAC_Init_ex(HMAC_CTX *ctx, const void *key, int len, |
64 | const EVP_MD *md, ENGINE *impl) | 65 | const EVP_MD *md, ENGINE *impl) |
@@ -78,6 +79,7 @@ void HMAC_Init_ex(HMAC_CTX *ctx, const void *key, int len, | |||
78 | { | 79 | { |
79 | reset=1; | 80 | reset=1; |
80 | j=EVP_MD_block_size(md); | 81 | j=EVP_MD_block_size(md); |
82 | OPENSSL_assert(j <= sizeof ctx->key); | ||
81 | if (j < len) | 83 | if (j < len) |
82 | { | 84 | { |
83 | EVP_DigestInit_ex(&ctx->md_ctx,md, impl); | 85 | EVP_DigestInit_ex(&ctx->md_ctx,md, impl); |
@@ -87,6 +89,7 @@ void HMAC_Init_ex(HMAC_CTX *ctx, const void *key, int len, | |||
87 | } | 89 | } |
88 | else | 90 | else |
89 | { | 91 | { |
92 | OPENSSL_assert(len <= sizeof ctx->key); | ||
90 | memcpy(ctx->key,key,len); | 93 | memcpy(ctx->key,key,len); |
91 | ctx->key_length=len; | 94 | ctx->key_length=len; |
92 | } | 95 | } |