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

Unified Diff: net/third_party/nss/patches/nssrwlock.patch

Issue 1844813002: Uprev NSS to 3.23 on iOS (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: One more GN fix Created 4 years, 8 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
« no previous file with comments | « net/third_party/nss/patches/nobypass.patch ('k') | net/third_party/nss/patches/reorderextensions.patch » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/third_party/nss/patches/nssrwlock.patch
diff --git a/net/third_party/nss/patches/nssrwlock.patch b/net/third_party/nss/patches/nssrwlock.patch
deleted file mode 100644
index ed0e9109ef41b52390a7563b3ff6ee0a1bd63771..0000000000000000000000000000000000000000
--- a/net/third_party/nss/patches/nssrwlock.patch
+++ /dev/null
@@ -1,238 +0,0 @@
-diff --git a/lib/ssl/ssl3con.c b/lib/ssl/ssl3con.c
-index afab931..e5e620f 100644
---- a/lib/ssl/ssl3con.c
-+++ b/lib/ssl/ssl3con.c
-@@ -5436,7 +5436,7 @@ ssl3_SendClientHello(sslSocket *ss, PRBool resending)
- * the lock across the calls to ssl3_CallHelloExtensionSenders.
- */
- if (sid->u.ssl3.lock) {
-- PR_RWLock_Rlock(sid->u.ssl3.lock);
-+ NSSRWLock_LockRead(sid->u.ssl3.lock);
- }
-
- if (isTLS || (ss->firstHsDone && ss->peerRequestedProtection)) {
-@@ -5445,7 +5445,7 @@ ssl3_SendClientHello(sslSocket *ss, PRBool resending)
-
- extLen = ssl3_CallHelloExtensionSenders(ss, PR_FALSE, maxBytes, NULL);
- if (extLen < 0) {
-- if (sid->u.ssl3.lock) { PR_RWLock_Unlock(sid->u.ssl3.lock); }
-+ if (sid->u.ssl3.lock) { NSSRWLock_UnlockRead(sid->u.ssl3.lock); }
- return SECFailure;
- }
- total_exten_len += extLen;
-@@ -5472,7 +5472,7 @@ ssl3_SendClientHello(sslSocket *ss, PRBool resending)
- /* how many suites are permitted by policy and user preference? */
- num_suites = count_cipher_suites(ss, ss->ssl3.policy, PR_TRUE);
- if (!num_suites) {
-- if (sid->u.ssl3.lock) { PR_RWLock_Unlock(sid->u.ssl3.lock); }
-+ if (sid->u.ssl3.lock) { NSSRWLock_UnlockRead(sid->u.ssl3.lock); }
- return SECFailure; /* count_cipher_suites has set error code. */
- }
-
-@@ -5517,7 +5517,7 @@ ssl3_SendClientHello(sslSocket *ss, PRBool resending)
-
- rv = ssl3_AppendHandshakeHeader(ss, client_hello, length);
- if (rv != SECSuccess) {
-- if (sid->u.ssl3.lock) { PR_RWLock_Unlock(sid->u.ssl3.lock); }
-+ if (sid->u.ssl3.lock) { NSSRWLock_UnlockRead(sid->u.ssl3.lock); }
- return rv; /* err set by ssl3_AppendHandshake* */
- }
-
-@@ -5536,21 +5536,21 @@ ssl3_SendClientHello(sslSocket *ss, PRBool resending)
- rv = ssl3_AppendHandshakeNumber(ss, ss->clientHelloVersion, 2);
- }
- if (rv != SECSuccess) {
-- if (sid->u.ssl3.lock) { PR_RWLock_Unlock(sid->u.ssl3.lock); }
-+ if (sid->u.ssl3.lock) { NSSRWLock_UnlockRead(sid->u.ssl3.lock); }
- return rv; /* err set by ssl3_AppendHandshake* */
- }
-
- if (!resending) { /* Don't re-generate if we are in DTLS re-sending mode */
- rv = ssl3_GetNewRandom(&ss->ssl3.hs.client_random);
- if (rv != SECSuccess) {
-- if (sid->u.ssl3.lock) { PR_RWLock_Unlock(sid->u.ssl3.lock); }
-+ if (sid->u.ssl3.lock) { NSSRWLock_UnlockRead(sid->u.ssl3.lock); }
- return rv; /* err set by GetNewRandom. */
- }
- }
- rv = ssl3_AppendHandshake(ss, &ss->ssl3.hs.client_random,
- SSL3_RANDOM_LENGTH);
- if (rv != SECSuccess) {
-- if (sid->u.ssl3.lock) { PR_RWLock_Unlock(sid->u.ssl3.lock); }
-+ if (sid->u.ssl3.lock) { NSSRWLock_UnlockRead(sid->u.ssl3.lock); }
- return rv; /* err set by ssl3_AppendHandshake* */
- }
-
-@@ -5560,7 +5560,7 @@ ssl3_SendClientHello(sslSocket *ss, PRBool resending)
- else
- rv = ssl3_AppendHandshakeNumber(ss, 0, 1);
- if (rv != SECSuccess) {
-- if (sid->u.ssl3.lock) { PR_RWLock_Unlock(sid->u.ssl3.lock); }
-+ if (sid->u.ssl3.lock) { NSSRWLock_UnlockRead(sid->u.ssl3.lock); }
- return rv; /* err set by ssl3_AppendHandshake* */
- }
-
-@@ -5568,14 +5568,14 @@ ssl3_SendClientHello(sslSocket *ss, PRBool resending)
- rv = ssl3_AppendHandshakeVariable(
- ss, ss->ssl3.hs.cookie, ss->ssl3.hs.cookieLen, 1);
- if (rv != SECSuccess) {
-- if (sid->u.ssl3.lock) { PR_RWLock_Unlock(sid->u.ssl3.lock); }
-+ if (sid->u.ssl3.lock) { NSSRWLock_UnlockRead(sid->u.ssl3.lock); }
- return rv; /* err set by ssl3_AppendHandshake* */
- }
- }
-
- rv = ssl3_AppendHandshakeNumber(ss, num_suites*sizeof(ssl3CipherSuite), 2);
- if (rv != SECSuccess) {
-- if (sid->u.ssl3.lock) { PR_RWLock_Unlock(sid->u.ssl3.lock); }
-+ if (sid->u.ssl3.lock) { NSSRWLock_UnlockRead(sid->u.ssl3.lock); }
- return rv; /* err set by ssl3_AppendHandshake* */
- }
-
-@@ -5584,7 +5584,7 @@ ssl3_SendClientHello(sslSocket *ss, PRBool resending)
- rv = ssl3_AppendHandshakeNumber(ss, TLS_EMPTY_RENEGOTIATION_INFO_SCSV,
- sizeof(ssl3CipherSuite));
- if (rv != SECSuccess) {
-- if (sid->u.ssl3.lock) { PR_RWLock_Unlock(sid->u.ssl3.lock); }
-+ if (sid->u.ssl3.lock) { NSSRWLock_UnlockRead(sid->u.ssl3.lock); }
- return rv; /* err set by ssl3_AppendHandshake* */
- }
- actual_count++;
-@@ -5593,7 +5593,7 @@ ssl3_SendClientHello(sslSocket *ss, PRBool resending)
- rv = ssl3_AppendHandshakeNumber(ss, TLS_FALLBACK_SCSV,
- sizeof(ssl3CipherSuite));
- if (rv != SECSuccess) {
-- if (sid->u.ssl3.lock) { PR_RWLock_Unlock(sid->u.ssl3.lock); }
-+ if (sid->u.ssl3.lock) { NSSRWLock_UnlockRead(sid->u.ssl3.lock); }
- return rv; /* err set by ssl3_AppendHandshake* */
- }
- actual_count++;
-@@ -5603,7 +5603,7 @@ ssl3_SendClientHello(sslSocket *ss, PRBool resending)
- if (config_match(suite, ss->ssl3.policy, PR_TRUE, &ss->vrange, ss)) {
- actual_count++;
- if (actual_count > num_suites) {
-- if (sid->u.ssl3.lock) { PR_RWLock_Unlock(sid->u.ssl3.lock); }
-+ if (sid->u.ssl3.lock) { NSSRWLock_UnlockRead(sid->u.ssl3.lock); }
- /* set error card removal/insertion error */
- PORT_SetError(SSL_ERROR_TOKEN_INSERTION_REMOVAL);
- return SECFailure;
-@@ -5611,7 +5611,7 @@ ssl3_SendClientHello(sslSocket *ss, PRBool resending)
- rv = ssl3_AppendHandshakeNumber(ss, suite->cipher_suite,
- sizeof(ssl3CipherSuite));
- if (rv != SECSuccess) {
-- if (sid->u.ssl3.lock) { PR_RWLock_Unlock(sid->u.ssl3.lock); }
-+ if (sid->u.ssl3.lock) { NSSRWLock_UnlockRead(sid->u.ssl3.lock); }
- return rv; /* err set by ssl3_AppendHandshake* */
- }
- }
-@@ -5622,14 +5622,14 @@ ssl3_SendClientHello(sslSocket *ss, PRBool resending)
- * the server.. */
- if (actual_count != num_suites) {
- /* Card removal/insertion error */
-- if (sid->u.ssl3.lock) { PR_RWLock_Unlock(sid->u.ssl3.lock); }
-+ if (sid->u.ssl3.lock) { NSSRWLock_UnlockRead(sid->u.ssl3.lock); }
- PORT_SetError(SSL_ERROR_TOKEN_INSERTION_REMOVAL);
- return SECFailure;
- }
-
- rv = ssl3_AppendHandshakeNumber(ss, numCompressionMethods, 1);
- if (rv != SECSuccess) {
-- if (sid->u.ssl3.lock) { PR_RWLock_Unlock(sid->u.ssl3.lock); }
-+ if (sid->u.ssl3.lock) { NSSRWLock_UnlockRead(sid->u.ssl3.lock); }
- return rv; /* err set by ssl3_AppendHandshake* */
- }
- for (i = 0; i < compressionMethodsCount; i++) {
-@@ -5637,7 +5637,7 @@ ssl3_SendClientHello(sslSocket *ss, PRBool resending)
- continue;
- rv = ssl3_AppendHandshakeNumber(ss, compressions[i], 1);
- if (rv != SECSuccess) {
-- if (sid->u.ssl3.lock) { PR_RWLock_Unlock(sid->u.ssl3.lock); }
-+ if (sid->u.ssl3.lock) { NSSRWLock_UnlockRead(sid->u.ssl3.lock); }
- return rv; /* err set by ssl3_AppendHandshake* */
- }
- }
-@@ -5648,20 +5648,20 @@ ssl3_SendClientHello(sslSocket *ss, PRBool resending)
-
- rv = ssl3_AppendHandshakeNumber(ss, maxBytes, 2);
- if (rv != SECSuccess) {
-- if (sid->u.ssl3.lock) { PR_RWLock_Unlock(sid->u.ssl3.lock); }
-+ if (sid->u.ssl3.lock) { NSSRWLock_UnlockRead(sid->u.ssl3.lock); }
- return rv; /* err set by AppendHandshake. */
- }
-
- extLen = ssl3_CallHelloExtensionSenders(ss, PR_TRUE, maxBytes, NULL);
- if (extLen < 0) {
-- if (sid->u.ssl3.lock) { PR_RWLock_Unlock(sid->u.ssl3.lock); }
-+ if (sid->u.ssl3.lock) { NSSRWLock_UnlockRead(sid->u.ssl3.lock); }
- return SECFailure;
- }
- maxBytes -= extLen;
-
- extLen = ssl3_AppendPaddingExtension(ss, paddingExtensionLen, maxBytes);
- if (extLen < 0) {
-- if (sid->u.ssl3.lock) { PR_RWLock_Unlock(sid->u.ssl3.lock); }
-+ if (sid->u.ssl3.lock) { NSSRWLock_UnlockRead(sid->u.ssl3.lock); }
- return SECFailure;
- }
- maxBytes -= extLen;
-@@ -5670,7 +5670,7 @@ ssl3_SendClientHello(sslSocket *ss, PRBool resending)
- }
-
- if (sid->u.ssl3.lock) {
-- PR_RWLock_Unlock(sid->u.ssl3.lock);
-+ NSSRWLock_UnlockRead(sid->u.ssl3.lock);
- }
-
- if (ss->xtnData.sentSessionTicketInClientHello) {
-diff --git a/lib/ssl/sslimpl.h b/lib/ssl/sslimpl.h
-index 3403091..874e59c 100644
---- a/lib/ssl/sslimpl.h
-+++ b/lib/ssl/sslimpl.h
-@@ -742,7 +742,7 @@ struct sslSessionIDStr {
- * cached. Before then, there is no need to lock anything because
- * the sid isn't being shared by anything.
- */
-- PRRWLock *lock;
-+ NSSRWLock *lock;
-
- /* The lock must be held while reading or writing these members
- * because they change while the sid is cached.
-diff --git a/lib/ssl/sslnonce.c b/lib/ssl/sslnonce.c
-index cefdda6..28ad364 100644
---- a/lib/ssl/sslnonce.c
-+++ b/lib/ssl/sslnonce.c
-@@ -136,7 +136,7 @@ ssl_DestroySID(sslSessionID *sid)
- }
-
- if (sid->u.ssl3.lock) {
-- PR_DestroyRWLock(sid->u.ssl3.lock);
-+ NSSRWLock_Destroy(sid->u.ssl3.lock);
- }
- }
-
-@@ -308,7 +308,7 @@ CacheSID(sslSessionID *sid)
- PRINT_BUF(8, (0, "sessionID:",
- sid->u.ssl3.sessionID, sid->u.ssl3.sessionIDLength));
-
-- sid->u.ssl3.lock = PR_NewRWLock(PR_RWLOCK_RANK_NONE, NULL);
-+ sid->u.ssl3.lock = NSSRWLock_New(NSS_RWLOCK_RANK_NONE, NULL);
- if (!sid->u.ssl3.lock) {
- return;
- }
-@@ -450,7 +450,7 @@ ssl3_SetSIDSessionTicket(sslSessionID *sid,
- * yet, so no locking is needed.
- */
- if (sid->u.ssl3.lock) {
-- PR_RWLock_Wlock(sid->u.ssl3.lock);
-+ NSSRWLock_LockWrite(sid->u.ssl3.lock);
- if (sid->u.ssl3.locked.sessionTicket.ticket.data) {
- SECITEM_FreeItem(&sid->u.ssl3.locked.sessionTicket.ticket,
- PR_FALSE);
-@@ -465,6 +465,6 @@ ssl3_SetSIDSessionTicket(sslSessionID *sid,
- newSessionTicket->ticket.len = 0;
-
- if (sid->u.ssl3.lock) {
-- PR_RWLock_Unlock(sid->u.ssl3.lock);
-+ NSSRWLock_UnlockWrite(sid->u.ssl3.lock);
- }
- }
« no previous file with comments | « net/third_party/nss/patches/nobypass.patch ('k') | net/third_party/nss/patches/reorderextensions.patch » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698