Bug 1428928 - Move SSL_TRC call for bad extension, r=franziskus
authorMartin Thomson <martin.thomson@gmail.com>
Tue, 02 Jan 2018 17:14:18 +1100
changeset 14218 cbf60c59ed7e0112432aaa9fac1459e8b3e08375
parent 14217 fa1f3948cb000ea3dba1c12a00426eb8a94d46f9
child 14219 20e4845ecab499e722290376ce192d385c2addd7
push id2961
push usermartin.thomson@gmail.com
push dateWed, 17 Jan 2018 07:23:37 +0000
reviewersfranziskus
bugs1428928
Bug 1428928 - Move SSL_TRC call for bad extension, r=franziskus
lib/ssl/ssl3ext.c
lib/ssl/tls13con.c
--- a/lib/ssl/ssl3ext.c
+++ b/lib/ssl/ssl3ext.c
@@ -514,16 +514,18 @@ ssl3_HandleParsedExtensions(sslSocket *s
                 case tls13_extension_allowed:
                     break;
                 case tls13_extension_unknown:
                     if (allowNotOffered) {
                         continue; /* Skip over unknown extensions. */
                     }
                 /* Fall through. */
                 case tls13_extension_disallowed:
+                    SSL_TRC(3, ("%d: TLS13: unexpected extension %d in message %d",
+                                SSL_GETPID(), extension, message));
                     tls13_FatalError(ss, SSL_ERROR_EXTENSION_DISALLOWED_FOR_VERSION,
                                      unsupported_extension);
                     return SECFailure;
             }
         }
 
         /* Special check for this being the last extension if it's
          * PreSharedKey */
--- a/lib/ssl/tls13con.c
+++ b/lib/ssl/tls13con.c
@@ -4765,19 +4765,16 @@ tls13_ExtensionStatus(PRUint16 extension
         }
     }
     if (i >= PR_ARRAY_SIZE(KnownExtensions)) {
         return tls13_extension_unknown;
     }
 
     /* Return "disallowed" if the message mask bit isn't set. */
     if (!(_M(message) & KnownExtensions[i].messages)) {
-        SSL_TRC(3, ("%d: TLS13: unexpected extension %d in message %d",
-                    SSL_GETPID(), extension, message));
-
         return tls13_extension_disallowed;
     }
 
     return tls13_extension_allowed;
 }
 
 #undef _M
 #undef _M1