diff options
Diffstat (limited to 'crypto/hmac/hmac.c')
-rw-r--r-- | crypto/hmac/hmac.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/crypto/hmac/hmac.c b/crypto/hmac/hmac.c index a2a49d986a..3fff7b1af3 100644 --- a/crypto/hmac/hmac.c +++ b/crypto/hmac/hmac.c @@ -60,8 +60,8 @@ #include <string.h> #include <openssl/hmac.h> -void HMAC_Init(HMAC_CTX *ctx, const void *key, int len, - const EVP_MD *md) +void HMAC_Init_ex(HMAC_CTX *ctx, const void *key, int len, + const EVP_MD *md) { int i,j,reset=0; unsigned char pad[HMAC_MAX_MD_CBLOCK]; @@ -110,6 +110,14 @@ void HMAC_Init(HMAC_CTX *ctx, const void *key, int len, EVP_MD_CTX_copy_ex(&ctx->md_ctx,&ctx->i_ctx); } +void HMAC_Init(HMAC_CTX *ctx, const void *key, int len, + const EVP_MD *md) + { + if(key && md) + HMAC_CTX_init(ctx); + HMAC_Init_ex(ctx,key,len,md); + } + void HMAC_Update(HMAC_CTX *ctx, const unsigned char *data, int len) { EVP_DigestUpdate(&ctx->md_ctx,data,len); |