ssl/t1_enc: Fix kTLS RX offload path
authorDmytro Podgornyi <dmytrop@nvidia.com>
Wed, 12 Jan 2022 17:25:23 +0000 (19:25 +0200)
committerPauli <pauli@openssl.org>
Mon, 17 Jan 2022 02:16:26 +0000 (13:16 +1100)
During counting of the unprocessed records, return code is treated in a
wrong way. This forces kTLS RX path to be skipped in case of presence
of unprocessed records.

CLA: trivial

Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Paul Dale <pauli@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/17492)

(cherry picked from commit d73a7a3a71270aaadb4e4e678ae9bd3cef8b9cbd)

ssl/t1_enc.c

index 51688d4f2eac70f469118ed79d2486130231aa27..101cba6490935a29ca9d2217a59e9b9a1123c654 100644 (file)
@@ -122,7 +122,7 @@ static int count_unprocessed_records(SSL *s)
             return -1;
 
         /* Read until next record */
-        if (PACKET_get_length_prefixed_2(&pkt, &subpkt))
+        if (!PACKET_get_length_prefixed_2(&pkt, &subpkt))
             return -1;
 
         count += 1;