diff options
author | Matt Caswell <matt@openssl.org> | 2015-02-10 09:45:18 +0000 |
---|---|---|
committer | Matt Caswell <matt@openssl.org> | 2015-02-10 14:32:56 +0000 |
commit | 00a5a74bbc854972c4484a0b204bc9437d2757d9 (patch) | |
tree | 3480f953e5dab47d70b9b5c2317f95ea05e918fe /crypto/hmac | |
parent | a8b4e057b3c8b9563802105cfcc6210f70ce1fc8 (diff) |
HMAC_cleanup, and HMAC_Init are stated as deprecated in the docs and source.
Mark them as such with OPENSSL_USE_DEPRECATED
Reviewed-by: Tim Hudson <tjh@openssl.org>
Diffstat (limited to 'crypto/hmac')
-rw-r--r-- | crypto/hmac/hmac.c | 4 | ||||
-rw-r--r-- | crypto/hmac/hmac.h | 7 |
2 files changed, 8 insertions, 3 deletions
diff --git a/crypto/hmac/hmac.c b/crypto/hmac/hmac.c index 1d871f0410..3a4dfa4f40 100644 --- a/crypto/hmac/hmac.c +++ b/crypto/hmac/hmac.c @@ -118,12 +118,14 @@ int HMAC_Init_ex(HMAC_CTX *ctx, const void *key, int len, return 0; } +#ifndef OPENSSL_NO_DEPRECATED int HMAC_Init(HMAC_CTX *ctx, const void *key, int len, const EVP_MD *md) { if (key && md) HMAC_CTX_init(ctx); return HMAC_Init_ex(ctx, key, len, md, NULL); } +#endif int HMAC_Update(HMAC_CTX *ctx, const unsigned char *data, size_t len) { @@ -190,7 +192,7 @@ unsigned char *HMAC(const EVP_MD *evp_md, const void *key, int key_len, if (md == NULL) md = m; HMAC_CTX_init(&c); - if (!HMAC_Init(&c, key, key_len, evp_md)) + if (!HMAC_Init_ex(&c, key, key_len, evp_md, NULL)) goto err; if (!HMAC_Update(&c, d, n)) goto err; diff --git a/crypto/hmac/hmac.h b/crypto/hmac/hmac.h index 2404e530ee..81aa49da49 100644 --- a/crypto/hmac/hmac.h +++ b/crypto/hmac/hmac.h @@ -82,12 +82,15 @@ typedef struct hmac_ctx_st { void HMAC_CTX_init(HMAC_CTX *ctx); void HMAC_CTX_cleanup(HMAC_CTX *ctx); +#ifdef OPENSSL_USE_DEPRECATED /* deprecated */ # define HMAC_cleanup(ctx) HMAC_CTX_cleanup(ctx) /* deprecated */ -__owur int HMAC_Init(HMAC_CTX *ctx, const void *key, int len, - const EVP_MD *md); +DECLARE_DEPRECATED(__owur int HMAC_Init(HMAC_CTX *ctx, const void *key, int len, + const EVP_MD *md)); + +#endif /*__owur*/ int HMAC_Init_ex(HMAC_CTX *ctx, const void *key, int len, const EVP_MD *md, ENGINE *impl); /*__owur*/ int HMAC_Update(HMAC_CTX *ctx, const unsigned char *data, |