mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-29 07:42:04 +00:00
Backed out changeset a5c2323ca151 (bug 769288)
This commit is contained in:
parent
284b9ead7e
commit
0d61b7bc1d
@ -2448,7 +2448,7 @@ loser:
|
||||
static nsresult
|
||||
nsSSLIOLayerSetOptions(PRFileDesc *fd, bool forSTARTTLS,
|
||||
const char *proxyHost, const char *host, int32_t port,
|
||||
nsNSSSocketInfo *infoObject)
|
||||
bool anonymousLoad, nsNSSSocketInfo *infoObject)
|
||||
{
|
||||
nsNSSShutDownPreventionLock locker;
|
||||
if (forSTARTTLS || proxyHost) {
|
||||
@ -2501,23 +2501,20 @@ nsSSLIOLayerSetOptions(PRFileDesc *fd, bool forSTARTTLS,
|
||||
}
|
||||
}
|
||||
|
||||
// Set the Peer ID so that SSL proxy connections work properly and to
|
||||
// separate anonymous and/or private browsing connections.
|
||||
uint32_t flags = infoObject->GetProviderFlags();
|
||||
nsAutoCString peerId;
|
||||
if (flags & nsISocketProvider::ANONYMOUS_CONNECT) { // See bug 466080
|
||||
peerId.Append("anon:");
|
||||
// Set the Peer ID so that SSL proxy connections work properly.
|
||||
char *peerId;
|
||||
if (anonymousLoad) { // See bug #466080. Separate the caches.
|
||||
peerId = PR_smprintf("anon:%s:%d", host, port);
|
||||
} else {
|
||||
peerId = PR_smprintf("%s:%d", host, port);
|
||||
}
|
||||
if (flags & nsISocketProvider::NO_PERMANENT_STORAGE) {
|
||||
peerId.Append("private:");
|
||||
}
|
||||
peerId.Append(host);
|
||||
peerId.Append(':');
|
||||
peerId.AppendInt(port);
|
||||
if (SECSuccess != SSL_SetSockPeerID(fd, peerId.get())) {
|
||||
|
||||
if (SECSuccess != SSL_SetSockPeerID(fd, peerId)) {
|
||||
PR_smprintf_free(peerId);
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
|
||||
PR_smprintf_free(peerId);
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
@ -2547,6 +2544,7 @@ nsSSLIOLayerAddToSocket(int32_t family,
|
||||
infoObject->SetHostName(host);
|
||||
infoObject->SetPort(port);
|
||||
|
||||
bool anonymousLoad = providerFlags & nsISocketProvider::ANONYMOUS_CONNECT;
|
||||
PRFileDesc *sslSock = nsSSLIOLayerImportFD(fd, infoObject, host);
|
||||
if (!sslSock) {
|
||||
NS_ASSERTION(false, "NSS: Error importing socket");
|
||||
@ -2555,7 +2553,8 @@ nsSSLIOLayerAddToSocket(int32_t family,
|
||||
|
||||
infoObject->SetFileDescPtr(sslSock);
|
||||
|
||||
rv = nsSSLIOLayerSetOptions(sslSock, forSTARTTLS, proxyHost, host, port,
|
||||
rv = nsSSLIOLayerSetOptions(sslSock,
|
||||
forSTARTTLS, proxyHost, host, port, anonymousLoad,
|
||||
infoObject);
|
||||
|
||||
if (NS_FAILED(rv))
|
||||
|
@ -63,9 +63,7 @@ public:
|
||||
|
||||
bool GetJoined() { return mJoined; }
|
||||
void SetSentClientCert() { mSentClientCert = true; }
|
||||
|
||||
uint32_t GetProviderFlags() const { return mProviderFlags; }
|
||||
|
||||
|
||||
mozilla::psm::SharedSSLState& SharedState();
|
||||
|
||||
// XXX: These are only used on for diagnostic purposes
|
||||
|
Loading…
Reference in New Issue
Block a user