From e93d7d3c93d5445832be0fb9032b71039a907029 Mon Sep 17 00:00:00 2001 From: Takashi Kojo Date: Thu, 23 Nov 2017 07:00:37 +0900 Subject: [PATCH] fix for MD5 case, "recover hmac", in HMAC_init --- src/ssl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ssl.c b/src/ssl.c index 615b93a0b..5f20d9812 100644 --- a/src/ssl.c +++ b/src/ssl.c @@ -24812,7 +24812,7 @@ int wolfSSL_HMAC_Init(WOLFSSL_HMAC_CTX* ctx, const void* key, int keylen, ctx->save_len = keylen; } /* OpenSSL compat, no error */ - } else if(ctx->type) { + } else if(ctx->type >= 0) { /* MD5 == 0 */ WOLFSSL_MSG("recover hmac"); if (wc_HmacInit(&ctx->hmac, NULL, INVALID_DEVID) == 0) { wc_HmacSetKey(&ctx->hmac, ctx->type, (byte *)&ctx->save_key,