Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(507)

Unified Diff: net/socket/nss_ssl_util.cc

Issue 266243004: Clang format slam. Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: net/socket/nss_ssl_util.cc
diff --git a/net/socket/nss_ssl_util.cc b/net/socket/nss_ssl_util.cc
index 7b068545a55290b6368816a992cca3f7161d720e..66c49a858bd0e84607b2e9a11b20e945503cadeb 100644
--- a/net/socket/nss_ssl_util.cc
+++ b/net/socket/nss_ssl_util.cc
@@ -38,7 +38,7 @@ namespace {
bool CiphersRemove(const uint16* to_remove, uint16* ciphers, size_t num) {
size_t i, found = 0;
- for (i = 0; ; i++) {
+ for (i = 0;; i++) {
if (to_remove[i] == 0)
break;
@@ -70,7 +70,7 @@ void CiphersCompact(uint16* ciphers, size_t num) {
// CiphersCopy copies the zero-terminated array |in| to |out|. It returns the
// number of cipher suite ids copied.
size_t CiphersCopy(const uint16* in, uint16* out) {
- for (size_t i = 0; ; i++) {
+ for (size_t i = 0;; i++) {
if (in[i] == 0)
return i;
out[i] = in[i];
@@ -103,8 +103,8 @@ class NSSSSLInitSingleton {
// Explicitly enable exactly those ciphers with keys of at least 80 bits
for (int i = 0; i < num_ciphers; i++) {
SSLCipherSuiteInfo info;
- if (SSL_GetCipherSuiteInfo(ssl_ciphers[i], &info,
- sizeof(info)) == SECSuccess) {
+ if (SSL_GetCipherSuiteInfo(ssl_ciphers[i], &info, sizeof(info)) ==
+ SECSuccess) {
bool enabled = info.effectiveKeyBits >= 80;
if (info.authAlgorithm == ssl_auth_ecdsa && disableECDSA)
enabled = false;
@@ -116,8 +116,7 @@ class NSSSSLInitSingleton {
info.symCipher == ssl_calg_seed ||
(info.symCipher == ssl_calg_3des && info.keaType != ssl_kea_rsa) ||
info.authAlgorithm == ssl_auth_dsa ||
- info.macAlgorithm == ssl_hmac_sha256 ||
- info.nonStandard ||
+ info.macAlgorithm == ssl_hmac_sha256 || info.nonStandard ||
strcmp(info.keaTypeName, "ECDH") == 0) {
enabled = false;
}
@@ -142,18 +141,16 @@ class NSSSSLInitSingleton {
// we prefer AES-GCM, otherwise ChaCha20. The remainder of the cipher suite
// preference is inheriented from NSS. */
static const uint16 chacha_ciphers[] = {
- TLS_ECDHE_ECDSA_WITH_CHACHA20_POLY1305,
- TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305,
- 0,
+ TLS_ECDHE_ECDSA_WITH_CHACHA20_POLY1305,
+ TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305, 0,
};
static const uint16 aes_gcm_ciphers[] = {
- TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256,
- TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256,
- TLS_DHE_RSA_WITH_AES_128_GCM_SHA256,
- 0,
+ TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256,
+ TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256,
+ TLS_DHE_RSA_WITH_AES_128_GCM_SHA256, 0,
};
scoped_ptr<uint16[]> ciphers(new uint16[num_ciphers]);
- memcpy(ciphers.get(), ssl_ciphers, sizeof(uint16)*num_ciphers);
+ memcpy(ciphers.get(), ssl_ciphers, sizeof(uint16) * num_ciphers);
if (CiphersRemove(chacha_ciphers, ciphers.get(), num_ciphers) &&
CiphersRemove(aes_gcm_ciphers, ciphers.get(), num_ciphers)) {
@@ -186,9 +183,7 @@ class NSSSSLInitSingleton {
// SSLServerSocket.
}
- PRFileDesc* GetModelSocket() {
- return model_fd_;
- }
+ PRFileDesc* GetModelSocket() { return model_fd_; }
~NSSSSLInitSingleton() {
// Have to clear the cache, or NSS_Shutdown fails with SEC_ERROR_BUSY.
@@ -225,7 +220,7 @@ PRFileDesc* GetNSSModelSocket() {
// See _MD_unix_map_default_error in the NSS source
// tree for inspiration.
PRErrorCode MapErrorToNSS(int result) {
- if (result >=0)
+ if (result >= 0)
return result;
switch (result) {
@@ -239,7 +234,7 @@ PRErrorCode MapErrorToNSS(int result) {
return PR_NOT_IMPLEMENTED_ERROR;
case ERR_SOCKET_NOT_CONNECTED:
return PR_NOT_CONNECTED_ERROR;
- case ERR_INTERNET_DISCONNECTED: // Equivalent to ENETDOWN.
+ case ERR_INTERNET_DISCONNECTED: // Equivalent to ENETDOWN.
return PR_NETWORK_UNREACHABLE_ERROR; // Best approximation.
case ERR_CONNECTION_TIMED_OUT:
case ERR_TIMED_OUT:
@@ -395,8 +390,8 @@ void LogFailedNSSFunction(const BoundNetLog& net_log,
DCHECK(param);
net_log.AddEvent(
NetLog::TYPE_SSL_NSS_ERROR,
- base::Bind(&NetLogSSLFailedNSSFunctionCallback,
- function, param, PR_GetError()));
+ base::Bind(
+ &NetLogSSLFailedNSSFunctionCallback, function, param, PR_GetError()));
}
} // namespace net

Powered by Google App Engine
This is Rietveld 408576698