Chromium Code Reviews| Index: net/socket/ssl_client_socket_nss.cc |
| =================================================================== |
| --- net/socket/ssl_client_socket_nss.cc (revision 228029) |
| +++ net/socket/ssl_client_socket_nss.cc (working copy) |
| @@ -1287,6 +1287,16 @@ |
| // Start with it. |
| SSL_OptionSet(socket, SSL_ENABLE_FALSE_START, PR_FALSE); |
| } |
| + } else { |
| + // Disallow the server certificate to change in a renegotiation. |
|
wtc
2013/10/14 23:11:11
This can also be enforced by NSS.
|
| + CERTCertificate* old_cert = core->nss_handshake_state_.server_cert_chain[0]; |
| + CERTCertificate* new_cert = SSL_PeerCertificate(socket); |
| + if (new_cert->derCert.len != old_cert->derCert.len || |
| + memcmp(new_cert->derCert.data, old_cert->derCert.data, |
| + new_cert->derCert.len) != 0) { |
| + PORT_SetError(SSL_ERROR_BAD_CERTIFICATE); |
| + return SECFailure; |
| + } |
| } |
| // Tell NSS to not verify the certificate. |