diff options
author | Ben Laurie <ben@openssl.org> | 2001-12-09 21:53:31 +0000 |
---|---|---|
committer | Ben Laurie <ben@openssl.org> | 2001-12-09 21:53:31 +0000 |
commit | ff3fa48fc79029d46f5285bdf9347b96f2262ce2 (patch) | |
tree | f74a1f8ddd6ecf86c7f217742f10dea32a3b89bb /crypto/hmac/hmac.c | |
parent | 87166e1fb6941280fc0827909d944b806461727d (diff) |
Improve back compatibility.
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); |