diff options
Diffstat (limited to 'src/crypto/evp/p_hmac.c')
-rw-r--r-- | src/crypto/evp/p_hmac.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/crypto/evp/p_hmac.c b/src/crypto/evp/p_hmac.c index 21703ed..7d3254a 100644 --- a/src/crypto/evp/p_hmac.c +++ b/src/crypto/evp/p_hmac.c @@ -64,6 +64,7 @@ #include <openssl/obj.h> #include "internal.h" +#include "../digest/internal.h" typedef struct { @@ -142,15 +143,14 @@ static int pkey_hmac_keygen(EVP_PKEY_CTX *ctx, EVP_PKEY *pkey) { return 1; } -static int int_update(EVP_MD_CTX *ctx, const void *data, size_t count) { +static void int_update(EVP_MD_CTX *ctx, const void *data, size_t count) { HMAC_PKEY_CTX *hctx = ctx->pctx->data; - return HMAC_Update(&hctx->ctx, data, count); + HMAC_Update(&hctx->ctx, data, count); } static int hmac_signctx_init(EVP_PKEY_CTX *ctx, EVP_MD_CTX *mctx) { - HMAC_PKEY_CTX *hctx = ctx->data; - - HMAC_CTX_set_flags(&hctx->ctx, mctx->flags & ~EVP_MD_CTX_FLAG_NO_INIT); + /* |mctx| gets repurposed as a hook to call |HMAC_Update|. Suppress the + * automatic setting of |mctx->update| and the rest of its initialization. */ EVP_MD_CTX_set_flags(mctx, EVP_MD_CTX_FLAG_NO_INIT); mctx->update = int_update; return 1; |