Do not print extensions in Certificate message for TLS1.2 and lower
authorDaniil Zotkin <zotkin@rutoken.ru>
Tue, 24 Sep 2019 08:08:23 +0000 (11:08 +0300)
committerPauli <paul.dale@oracle.com>
Thu, 3 Oct 2019 00:30:57 +0000 (10:30 +1000)
According to RFC8446 CertificateEntry in Certificate message contains
extensions that were not present in the Certificate message in RFC5246.

CLA: trivial

Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Paul Dale <paul.dale@oracle.com>
(Merged from https://github.com/openssl/openssl/pull/9994)

(cherry picked from commit 65c76cd2c9e8da9468dd490b334e56c51dbef582)

ssl/t1_trce.c

index 0559fba9d993468c6895c8a5d26b2a95da3cc47d..5c84339314cdf928370044f103699846862767f1 100644 (file)
@@ -1246,8 +1246,9 @@ static int ssl_print_certificates(BIO *bio, const SSL *ssl, int server,
     while (clen > 0) {
         if (!ssl_print_certificate(bio, indent + 2, &msg, &clen))
             return 0;
-        if (!ssl_print_extensions(bio, indent + 2, server, SSL3_MT_CERTIFICATE,
-                                  &msg, &clen))
+        if (SSL_IS_TLS13(ssl)
+            && !ssl_print_extensions(bio, indent + 2, server,
+                                     SSL3_MT_CERTIFICATE, &msg, &clen))
             return 0;
 
     }