Bug 1229070: Fix incorrect comments in ssl3_SendServerHello and
authorWan-Teh Chang <wtc@google.com>
Mon, 30 Nov 2015 14:30:59 -0800
changeset 11746 ddfaae48f249b13c72a7ab2a9f54b8a3decab59e
parent 11744 e1e2087b898642187882549b19d5c65b70926e65
child 11747 41a8009129f1d0ff161fd01c4a0a2dbd50363c2c
push id876
push userwtc@google.com
push dateMon, 30 Nov 2015 22:31:06 +0000
bugs1229070
Bug 1229070: Fix incorrect comments in ssl3_SendServerHello and ssl3_HandleCertificateStatus. Don't assign a variable in a function call. Remove an ignored assignment. r=ekr
lib/ssl/ssl3con.c
--- a/lib/ssl/ssl3con.c
+++ b/lib/ssl/ssl3con.c
@@ -6538,17 +6538,18 @@ ssl3_HandleServerHello(sslSocket *ss, SS
 	errCode = SSL_ERROR_NO_CYPHER_OVERLAP;
 	goto alert_loser;
     }
     ss->ssl3.hs.cipher_suite = (ssl3CipherSuite)temp;
     ss->ssl3.hs.suite_def    = ssl_LookupCipherSuiteDef((ssl3CipherSuite)temp);
     ss->ssl3.hs.preliminaryInfo |= ssl_preinfo_cipher_suite;
     PORT_Assert(ss->ssl3.hs.suite_def);
     if (!ss->ssl3.hs.suite_def) {
-    	PORT_SetError(errCode = SEC_ERROR_LIBRARY_FAILURE);
+	errCode = SEC_ERROR_LIBRARY_FAILURE;
+	PORT_SetError(errCode);
 	goto loser;	/* we don't send alerts for our screw-ups. */
     }
 
     /* find selected compression method in our list. */
     temp = ssl3_ConsumeHandshakeNumber(ss, 1, &b, &length);
     if (temp < 0) {
     	goto loser; 	/* alert has been sent */
     }
@@ -6799,17 +6800,17 @@ ssl3_HandleServerHello(sslSocket *ss, SS
         ss->ssl3.hs.ws = wait_server_key;
     }
     return SECSuccess;
 
 alert_loser:
     (void)SSL3_SendAlert(ss, alert_fatal, desc);
 
 loser:
-    errCode = ssl_MapLowLevelError(errCode);
+    ssl_MapLowLevelError(errCode);
     return SECFailure;
 }
 
 
 /* Called from ssl3_HandleHandshakeMessage() when it has deciphered a complete
  * ssl3 ServerKeyExchange message.
  * Caller must hold Handshake and RecvBuf locks.
  */
@@ -8995,17 +8996,17 @@ ssl3_SendServerHello(sslSocket *ss)
 	return rv;	/* err set by AppendHandshake. */
     }
     if (extensions_len) {
 	PRInt32 sent_len;
 
     	extensions_len -= 2;
 	rv = ssl3_AppendHandshakeNumber(ss, extensions_len, 2);
 	if (rv != SECSuccess) 
-	    return rv;	/* err set by ssl3_SetupPendingCipherSpec */
+	    return rv;	/* err set by ssl3_AppendHandshakeNumber */
 	sent_len = ssl3_CallHelloExtensionSenders(ss, PR_TRUE, extensions_len,
 					   &ss->xtnData.serverSenders[0]);
         PORT_Assert(sent_len == extensions_len);
 	if (sent_len != extensions_len) {
 	    if (sent_len >= 0)
 	    	PORT_SetError(SEC_ERROR_LIBRARY_FAILURE);
 	    return SECFailure;
 	}
@@ -10388,18 +10389,16 @@ ssl3_CleanupPeerCerts(sslSocket *ss)
     if (arena) PORT_FreeArena(arena, PR_FALSE);
     ss->ssl3.peerCertArena = NULL;
     ss->ssl3.peerCertChain = NULL;
 }
 
 /* Called from ssl3_HandleHandshakeMessage() when it has deciphered a complete
  * ssl3 CertificateStatus message.
  * Caller must hold Handshake and RecvBuf locks.
- * This is always called before ssl3_HandleCertificate, even if the Certificate
- * message is sent first.
  */
 static SECStatus
 ssl3_HandleCertificateStatus(sslSocket *ss, SSL3Opaque *b, PRUint32 length)
 {
     PRInt32 status, len;
 
     if (ss->ssl3.hs.ws != wait_certificate_status) {
         (void)SSL3_SendAlert(ss, alert_fatal, unexpected_message);