Bug 1321809 - Only increment the advertised extensions when appending rather than on both passes. r=mt
authorEKR <ekr@rtfm.com>
Fri, 02 Dec 2016 16:32:09 +0100
changeset 12940 433172d35f525c82db3eb0b583f40e93a7d3a7c8
parent 12939 5f2db99c258feee0dbbebdb2f06f10193ef79652
child 12941 80b1c5d01155bfa3a5fcb64a8a78a350e95ae031
push id1851
push userttaubert@mozilla.com
push dateFri, 02 Dec 2016 15:33:46 +0000
reviewersmt
bugs1321809
Bug 1321809 - Only increment the advertised extensions when appending rather than on both passes. r=mt Differential Revision: https://nss-review.dev.mozaws.net/D111
lib/ssl/tls13exthandle.c
--- a/lib/ssl/tls13exthandle.c
+++ b/lib/ssl/tls13exthandle.c
@@ -742,20 +742,21 @@ tls13_ClientSendEarlyDataXtn(const sslSo
     if (append) {
         rv = ssl3_ExtAppendHandshakeNumber(ss, ssl_tls13_early_data_xtn, 2);
         if (rv != SECSuccess)
             return -1;
 
         rv = ssl3_ExtAppendHandshakeNumber(ss, 0, 2);
         if (rv != SECSuccess)
             return -1;
+
+        xtnData->advertised[xtnData->numAdvertised++] =
+                ssl_tls13_early_data_xtn;
     }
 
-    xtnData->advertised[xtnData->numAdvertised++] =
-        ssl_tls13_early_data_xtn;
 
     return extension_length;
 }
 
 SECStatus
 tls13_ServerHandleEarlyDataXtn(const sslSocket *ss, TLSExtensionData *xtnData, PRUint16 ex_type,
                                SECItem *data)
 {