Correct tag len check when determining how much space we have in the pkt

If the available space is equal to the tag length then we have no available
space for plaintext data.

Fixes #22699

Reviewed-by: Hugo Landau <hlandau@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/22715)
This commit is contained in:
Matt Caswell 2023-11-13 11:27:54 +00:00 committed by Tomas Mraz
parent aa6ac60728
commit 46376fcf4b
1 changed files with 1 additions and 1 deletions

View File

@ -422,7 +422,7 @@ int ossl_qtx_calculate_plaintext_payload_len(OSSL_QTX *qtx, uint32_t enc_level,
tag_len = ossl_qrl_get_suite_cipher_tag_len(el->suite_id);
if (ciphertext_len < tag_len) {
if (ciphertext_len <= tag_len) {
*plaintext_len = 0;
return 0;
}