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

Unified Diff: net/third_party/nss/ssl/sslinfo.c

Issue 10454066: Move the core state machine of SSLClientSocketNSS into a thread-safe Core (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 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/third_party/nss/ssl/sslinfo.c
diff --git a/net/third_party/nss/ssl/sslinfo.c b/net/third_party/nss/ssl/sslinfo.c
index 0cb46d6e2f52a2ab06df61bd5de1b1a3b342dc89..6dc3cab16cd948f28513b100a35d7d9ef63de771 100644
--- a/net/third_party/nss/ssl/sslinfo.c
+++ b/net/third_party/nss/ssl/sslinfo.c
@@ -376,8 +376,13 @@ SSL_ExportKeyingMaterial(PRFileDesc *fd,
return SECFailure;
}
+ ssl_GetRecvBufLock(ss);
wtc 2012/05/30 22:54:29 The changes to this file should be moved to a sepa
Ryan Sleevi 2012/05/30 23:20:10 No, this is important to avoiding the need to modi
wtc 2012/05/31 01:23:42 I studied the functions in sslsecur.c as examples.
Ryan Sleevi 2012/05/31 01:31:14 1stHandshakeLock is itself guarded by RecvBufLock.
wtc 2012/06/01 01:02:38 1stHandshakeLock is broader than RecvBufLock. I f
Ryan Sleevi 2012/06/04 21:51:50 ssl3_SendClientHello expects HaveSSL3HandshakeLock
wtc 2012/06/04 23:44:58 I am not suggesting that we remove the ssl_GetSSL3
Ryan Sleevi 2012/06/05 00:01:59 Apologies, but I still don't understand why you're
+ ssl_GetSSL3HandshakeLock(ss);
+
if (ss->version < SSL_LIBRARY_VERSION_3_1_TLS) {
PORT_SetError(SSL_ERROR_UNSUPPORTED_VERSION);
+ ssl_ReleaseSSL3HandshakeLock(ss);
+ ssl_ReleaseRecvBufLock(ss);
return SECFailure;
}
@@ -388,13 +393,18 @@ SSL_ExportKeyingMaterial(PRFileDesc *fd,
}
val = PORT_Alloc(valLen);
if (!val) {
+ ssl_ReleaseSSL3HandshakeLock(ss);
+ ssl_ReleaseRecvBufLock(ss);
return SECFailure;
}
i = 0;
+
PORT_Memcpy(val + i, &ss->ssl3.hs.client_random.rand, SSL3_RANDOM_LENGTH);
i += SSL3_RANDOM_LENGTH;
PORT_Memcpy(val + i, &ss->ssl3.hs.server_random.rand, SSL3_RANDOM_LENGTH);
i += SSL3_RANDOM_LENGTH;
+ ssl_ReleaseSSL3HandshakeLock(ss);
wtc 2012/05/30 22:54:29 BUG: this function releases SSL3HandshakeLock twic
Ryan Sleevi 2012/05/30 23:20:10 Well spotted.
+
if (hasContext) {
val[i++] = contextLen >> 8;
val[i++] = contextLen;
@@ -415,6 +425,8 @@ SSL_ExportKeyingMaterial(PRFileDesc *fd,
valLen, out, outLen);
}
ssl_ReleaseSpecReadLock(ss);
+ ssl_ReleaseSSL3HandshakeLock(ss);
+ ssl_ReleaseRecvBufLock(ss);
PORT_ZFree(val, valLen);
return rv;
« net/socket/ssl_client_socket_unittest.cc ('K') | « net/socket/ssl_client_socket_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698