Index: net/socket/ssl_server_socket_nss.cc |
diff --git a/net/socket/ssl_server_socket_nss.cc b/net/socket/ssl_server_socket_nss.cc |
index 6abb531603dee36083f88aca4223a0183fe83052..2e311507fe249a81d22d9e6be3f14992b1aa812e 100644 |
--- a/net/socket/ssl_server_socket_nss.cc |
+++ b/net/socket/ssl_server_socket_nss.cc |
@@ -162,9 +162,14 @@ int SSLServerSocketNSS::ExportKeyingMaterial(const base::StringPiece& label, |
if (!IsConnected()) |
return ERR_SOCKET_NOT_CONNECTED; |
SECStatus result = SSL_ExportKeyingMaterial( |
- nss_fd_, label.data(), label.size(), has_context, |
+ nss_fd_, |
+ label.data(), |
+ label.size(), |
+ has_context, |
reinterpret_cast<const unsigned char*>(context.data()), |
- context.length(), out, outlen); |
+ context.length(), |
+ out, |
+ outlen); |
if (result != SECSuccess) { |
LogFailedNSSFunction(net_log_, "SSL_ExportKeyingMaterial", ""); |
return MapNSSError(PORT_GetError()); |
@@ -177,9 +182,8 @@ int SSLServerSocketNSS::GetTLSUniqueChannelBinding(std::string* out) { |
return ERR_SOCKET_NOT_CONNECTED; |
unsigned char buf[64]; |
unsigned int len; |
- SECStatus result = SSL_GetChannelBinding(nss_fd_, |
- SSL_CHANNEL_BINDING_TLS_UNIQUE, |
- buf, &len, arraysize(buf)); |
+ SECStatus result = SSL_GetChannelBinding( |
+ nss_fd_, SSL_CHANNEL_BINDING_TLS_UNIQUE, buf, &len, arraysize(buf)); |
if (result != SECSuccess) { |
LogFailedNSSFunction(net_log_, "SSL_GetChannelBinding", ""); |
return MapNSSError(PORT_GetError()); |
@@ -193,7 +197,8 @@ int SSLServerSocketNSS::Connect(const CompletionCallback& callback) { |
return ERR_NOT_IMPLEMENTED; |
} |
-int SSLServerSocketNSS::Read(IOBuffer* buf, int buf_len, |
+int SSLServerSocketNSS::Read(IOBuffer* buf, |
+ int buf_len, |
const CompletionCallback& callback) { |
DCHECK(user_read_callback_.is_null()); |
DCHECK(user_handshake_callback_.is_null()); |
@@ -217,7 +222,8 @@ int SSLServerSocketNSS::Read(IOBuffer* buf, int buf_len, |
return rv; |
} |
-int SSLServerSocketNSS::Write(IOBuffer* buf, int buf_len, |
+int SSLServerSocketNSS::Write(IOBuffer* buf, |
+ int buf_len, |
const CompletionCallback& callback) { |
DCHECK(user_write_callback_.is_null()); |
DCHECK(!user_write_buf_.get()); |
@@ -365,7 +371,8 @@ int SSLServerSocketNSS::InitializeSSLOptions() { |
for (std::vector<uint16>::const_iterator it = |
ssl_config_.disabled_cipher_suites.begin(); |
- it != ssl_config_.disabled_cipher_suites.end(); ++it) { |
+ it != ssl_config_.disabled_cipher_suites.end(); |
+ ++it) { |
// This will fail if the specified cipher is not implemented by NSS, but |
// the failure is harmless. |
SSL_CipherPrefSet(nss_fd_, *it, PR_FALSE); |
@@ -421,9 +428,9 @@ int SSLServerSocketNSS::InitializeSSLOptions() { |
return ERR_UNEXPECTED; |
SECItem der_cert; |
- der_cert.data = reinterpret_cast<unsigned char*>(const_cast<char*>( |
- der_string.data())); |
- der_cert.len = der_string.length(); |
+ der_cert.data = |
+ reinterpret_cast<unsigned char*>(const_cast<char*>(der_string.data())); |
+ der_cert.len = der_string.length(); |
der_cert.type = siDERCertBuffer; |
// Parse into a CERTCertificate structure. |
@@ -449,8 +456,7 @@ int SSLServerSocketNSS::InitializeSSLOptions() { |
} |
SECItem der_private_key_info; |
- der_private_key_info.data = |
- const_cast<unsigned char*>(&key_vector.front()); |
+ der_private_key_info.data = const_cast<unsigned char*>(&key_vector.front()); |
der_private_key_info.len = key_vector.size(); |
// The server's RSA private key must be imported into NSS with the |
// following key usage bits: |
@@ -458,9 +464,15 @@ int SSLServerSocketNSS::InitializeSSLOptions() { |
// - KU_DIGITAL_SIGNATURE, required for the DHE_RSA and ECDHE_RSA key |
// exchange algorithms. |
const unsigned int key_usage = KU_KEY_ENCIPHERMENT | KU_DIGITAL_SIGNATURE; |
- rv = PK11_ImportDERPrivateKeyInfoAndReturnKey( |
- slot, &der_private_key_info, NULL, NULL, PR_FALSE, PR_FALSE, |
- key_usage, &private_key, NULL); |
+ rv = PK11_ImportDERPrivateKeyInfoAndReturnKey(slot, |
+ &der_private_key_info, |
+ NULL, |
+ NULL, |
+ PR_FALSE, |
+ PR_FALSE, |
+ key_usage, |
+ &private_key, |
+ NULL); |
PK11_FreeSlot(slot); |
if (rv != SECSuccess) { |
CERT_DestroyCertificate(cert); |
@@ -576,7 +588,8 @@ void SSLServerSocketNSS::BufferSendComplete(int result) { |
} |
int SSLServerSocketNSS::BufferRecv(void) { |
- if (transport_recv_busy_) return ERR_IO_PENDING; |
+ if (transport_recv_busy_) |
+ return ERR_IO_PENDING; |
char* buf; |
int nb = memio_GetReadParams(nss_bufs_, &buf); |
@@ -822,8 +835,7 @@ SECStatus SSLServerSocketNSS::OwnAuthCertHandler(void* arg, |
// static |
// NSS calls this when handshake is completed. |
// After the SSL handshake is finished we need to verify the certificate. |
-void SSLServerSocketNSS::HandshakeCallback(PRFileDesc* socket, |
- void* arg) { |
+void SSLServerSocketNSS::HandshakeCallback(PRFileDesc* socket, void* arg) { |
// TODO(hclam): Implement. |
} |