Skip to content

Commit

Permalink
fixup! Add support for integrity-only cipher suites for TLS v1.3
Browse files Browse the repository at this point in the history
  • Loading branch information
rajeev-0 committed Mar 7, 2024
1 parent 0b3234f commit 7436311
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
9 changes: 3 additions & 6 deletions providers/implementations/ciphers/cipher_enull_hmac.c
Original file line number Diff line number Diff line change
Expand Up @@ -58,15 +58,12 @@ static void *enull_hmac_dupctx(void *vctx)
if (dupctx == NULL)
return NULL;

if (!ossl_assert(dupctx->base.tlsmac == NULL))
goto err;

if (!ossl_prov_digest_copy(&dupctx->md, &ctx->md))
goto err;

if (dupctx->base.tlsmac != NULL && dupctx->base.alloced) {
dupctx->base.tlsmac = OPENSSL_memdup(dupctx->base.tlsmac,
dupctx->base.tlsmacsize);
if (dupctx->base.tlsmac == NULL)
goto err;
}
if ((dupctx->hmac = HMAC_CTX_new()) == NULL)
goto err;

Expand Down
3 changes: 2 additions & 1 deletion providers/implementations/ciphers/cipher_enull_hmac_hw.c
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,8 @@ static int enull_hmac_cipher(PROV_CIPHER_CTX *bctx, unsigned char *out,
return 0;

if (!bctx->enc) {
if (CRYPTO_memcmp(ltag, ctx->tag, ctx->tag_len) != 0)
if (ltag_len != ctx->tag_len
|| CRYPTO_memcmp(ltag, ctx->tag, ctx->tag_len) != 0)
return 0;
}
}
Expand Down

0 comments on commit 7436311

Please sign in to comment.