evp.c: fixes in wolfSSL_EVP_CIPHER_CTX_ctrl() from peer review.

This commit is contained in:
Daniel Pouzzner
2021-07-16 17:52:28 -05:00
parent c97eff6e61
commit 785a8f83ed

View File

@ -4328,8 +4328,8 @@ int wolfSSL_EVP_MD_type(const WOLFSSL_EVP_MD *md)
WOLFSSL_MSG("Key or IV not set"); WOLFSSL_MSG("Key or IV not set");
break; break;
} }
if ((ret = wc_AesGcmSetExtIV(&ctx->cipher.aes, ctx->iv, if (wc_AesGcmSetExtIV(&ctx->cipher.aes, ctx->iv,
ctx->ivSz)) != 0) { ctx->ivSz) != 0) {
WOLFSSL_MSG("wc_AesGcmSetIV failed"); WOLFSSL_MSG("wc_AesGcmSetIV failed");
break; break;
} }
@ -4337,7 +4337,6 @@ int wolfSSL_EVP_MD_type(const WOLFSSL_EVP_MD *md)
/* Initialize using IV cached in Aes object. */ /* Initialize using IV cached in Aes object. */
if (wc_AesGcmInit(&ctx->cipher.aes, NULL, 0, NULL, 0) != 0) { if (wc_AesGcmInit(&ctx->cipher.aes, NULL, 0, NULL, 0) != 0) {
WOLFSSL_MSG("wc_AesGcmInit failed"); WOLFSSL_MSG("wc_AesGcmInit failed");
ret = WOLFSSL_FAILURE;
break; break;
} }
#endif /* WOLFSSL_AESGCM_STREAM */ #endif /* WOLFSSL_AESGCM_STREAM */