forked from Floorp-Projects/Floorp
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Bug 1296180 - Replace more uses of PR_ARRAY_SIZE with mozilla::ArrayL…
…engh. r=mt
- Loading branch information
Showing
4 changed files
with
45 additions
and
45 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,28 +6,27 @@ | |
|
||
// Original author: [email protected] | ||
|
||
#include <queue> | ||
#include "transportlayerdtls.h" | ||
|
||
#include <algorithm> | ||
#include <queue> | ||
#include <sstream> | ||
|
||
#include "mozilla/UniquePtr.h" | ||
|
||
#include "logging.h" | ||
#include "ssl.h" | ||
#include "sslerr.h" | ||
#include "sslproto.h" | ||
#include "dtlsidentity.h" | ||
#include "keyhi.h" | ||
|
||
#include "logging.h" | ||
#include "mozilla/UniquePtr.h" | ||
#include "nsCOMPtr.h" | ||
#include "nsComponentManagerUtils.h" | ||
#include "nsComponentManagerUtils.h" | ||
#include "nsIEventTarget.h" | ||
#include "nsNetCID.h" | ||
#include "nsComponentManagerUtils.h" | ||
#include "nsServiceManagerUtils.h" | ||
|
||
#include "dtlsidentity.h" | ||
#include "ssl.h" | ||
#include "sslerr.h" | ||
#include "sslproto.h" | ||
#include "transportflow.h" | ||
#include "transportlayerdtls.h" | ||
|
||
|
||
namespace mozilla { | ||
|
||
|
@@ -739,31 +738,31 @@ bool TransportLayerDtls::SetupCipherSuites(PRFileDesc* ssl_fd) const { | |
} | ||
} | ||
|
||
for (size_t i = 0; i < PR_ARRAY_SIZE(EnabledCiphers); ++i) { | ||
MOZ_MTLOG(ML_DEBUG, LAYER_INFO << "Enabling: " << EnabledCiphers[i]); | ||
rv = SSL_CipherPrefSet(ssl_fd, EnabledCiphers[i], PR_TRUE); | ||
for (const auto& cipher : EnabledCiphers) { | ||
MOZ_MTLOG(ML_DEBUG, LAYER_INFO << "Enabling: " << cipher); | ||
rv = SSL_CipherPrefSet(ssl_fd, cipher, PR_TRUE); | ||
if (rv != SECSuccess) { | ||
MOZ_MTLOG(ML_ERROR, LAYER_INFO << | ||
"Unable to enable suite: " << EnabledCiphers[i]); | ||
"Unable to enable suite: " << cipher); | ||
return false; | ||
} | ||
} | ||
|
||
for (size_t i = 0; i < PR_ARRAY_SIZE(DisabledCiphers); ++i) { | ||
MOZ_MTLOG(ML_DEBUG, LAYER_INFO << "Disabling: " << DisabledCiphers[i]); | ||
for (const auto& cipher : DisabledCiphers) { | ||
MOZ_MTLOG(ML_DEBUG, LAYER_INFO << "Disabling: " << cipher); | ||
|
||
PRBool enabled = false; | ||
rv = SSL_CipherPrefGet(ssl_fd, DisabledCiphers[i], &enabled); | ||
rv = SSL_CipherPrefGet(ssl_fd, cipher, &enabled); | ||
if (rv != SECSuccess) { | ||
MOZ_MTLOG(ML_NOTICE, LAYER_INFO << | ||
"Unable to check if suite is enabled: " << DisabledCiphers[i]); | ||
"Unable to check if suite is enabled: " << cipher); | ||
return false; | ||
} | ||
if (enabled) { | ||
rv = SSL_CipherPrefSet(ssl_fd, DisabledCiphers[i], PR_FALSE); | ||
rv = SSL_CipherPrefSet(ssl_fd, cipher, PR_FALSE); | ||
if (rv != SECSuccess) { | ||
MOZ_MTLOG(ML_NOTICE, LAYER_INFO << | ||
"Unable to disable suite: " << DisabledCiphers[i]); | ||
"Unable to disable suite: " << cipher); | ||
return false; | ||
} | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters