Don't treat PACKET_remaining() as boolean
authorTatsuhiro Tsujikawa <tatsuhiro.t@gmail.com>
Fri, 21 Apr 2017 13:10:32 +0000 (22:10 +0900)
committerMatt Caswell <matt@openssl.org>
Wed, 26 Apr 2017 15:56:37 +0000 (16:56 +0100)
Reviewed-by: Rich Salz <rsalz@openssl.org>
Reviewed-by: Matt Caswell <matt@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/3244)

ssl/statem/statem_clnt.c
ssl/statem/statem_srvr.c

index 0b4931d..a66dd40 100644 (file)
@@ -1712,9 +1712,9 @@ MSG_PROCESS_RETURN tls_process_server_certificate(SSL *s, PACKET *pkt)
             if (!tls_collect_extensions(s, &extensions,
                                         SSL_EXT_TLS1_3_CERTIFICATE, &rawexts,
                                         &al, NULL, chainidx == 0)
-                    || !tls_parse_all_extensions(s, SSL_EXT_TLS1_3_CERTIFICATE,
-                                                 rawexts, x, chainidx, &al,
-                                                 !PACKET_remaining(pkt))) {
+                || !tls_parse_all_extensions(s, SSL_EXT_TLS1_3_CERTIFICATE,
+                                             rawexts, x, chainidx, &al,
+                                             PACKET_remaining(pkt) == 0)) {
                 OPENSSL_free(rawexts);
                 goto f_err;
             }
index f6ecbf7..9dfdbe5 100644 (file)
@@ -3218,9 +3218,9 @@ MSG_PROCESS_RETURN tls_process_client_certificate(SSL *s, PACKET *pkt)
             if (!tls_collect_extensions(s, &extensions,
                                         SSL_EXT_TLS1_3_CERTIFICATE, &rawexts,
                                         &al, NULL, chainidx == 0)
-                    || !tls_parse_all_extensions(s, SSL_EXT_TLS1_3_CERTIFICATE,
-                                                 rawexts, x, chainidx, &al,
-                                                 !PACKET_remaining(&spkt))) {
+                || !tls_parse_all_extensions(s, SSL_EXT_TLS1_3_CERTIFICATE,
+                                             rawexts, x, chainidx, &al,
+                                             PACKET_remaining(&spkt) == 0)) {
                 OPENSSL_free(rawexts);
                 goto f_err;
             }