Logically dead code.

This commit is contained in:
Stanislav Klima
2020-01-29 17:34:40 +01:00
parent 37386f5fb5
commit 2db62f744a

View File

@ -17125,39 +17125,14 @@ int wolfSSL_EVP_MD_type(const WOLFSSL_EVP_MD *md)
case AES_256_GCM_TYPE :
WOLFSSL_MSG("AES GCM");
if (ctx->enc) {
if (dst){
/* encrypt confidential data*/
ret = wc_AesGcmEncrypt(&ctx->cipher.aes, dst, src, len,
ret = wc_AesGcmEncrypt(&ctx->cipher.aes, dst, src, len,
ctx->iv, ctx->ivSz, ctx->authTag, ctx->authTagSz,
NULL, 0);
}
else {
/* authenticated, non-confidential data */
ret = wc_AesGcmEncrypt(&ctx->cipher.aes, NULL, NULL, 0,
ctx->iv, ctx->ivSz, ctx->authTag, ctx->authTagSz,
src, len);
/* Reset partial authTag error for AAD*/
if (ret == AES_GCM_AUTH_E)
ret = 0;
}
}
else {
if (dst){
/* decrypt confidential data*/
ret = wc_AesGcmDecrypt(&ctx->cipher.aes, dst, src, len,
ret = wc_AesGcmDecrypt(&ctx->cipher.aes, dst, src, len,
ctx->iv, ctx->ivSz, ctx->authTag, ctx->authTagSz,
NULL, 0);
}
else {
/* authenticated, non-confidential data*/
ret = wc_AesGcmDecrypt(&ctx->cipher.aes, NULL, NULL, 0,
ctx->iv, ctx->ivSz,
ctx->authTag, ctx->authTagSz,
src, len);
/* Reset partial authTag error for AAD*/
if (ret == AES_GCM_AUTH_E)
ret = 0;
}
}
break;
#endif /* HAVE_AESGCM */