Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / net / third_party / nss / patches / secretexporterlocks.patch
blob7716f938dc29a1e44cf2fcbe6ee9e26b1a23aa78
1 diff --git a/ssl/sslinfo.c b/ssl/sslinfo.c
2 index 00f2f38..ba230d2 100644
3 --- a/ssl/sslinfo.c
4 +++ b/ssl/sslinfo.c
5 @@ -350,8 +350,13 @@ SSL_ExportKeyingMaterial(PRFileDesc *fd,
6 return SECFailure;
9 + ssl_GetRecvBufLock(ss);
10 + ssl_GetSSL3HandshakeLock(ss);
12 if (ss->version < SSL_LIBRARY_VERSION_3_1_TLS) {
13 PORT_SetError(SSL_ERROR_FEATURE_NOT_SUPPORTED_FOR_VERSION);
14 + ssl_ReleaseSSL3HandshakeLock(ss);
15 + ssl_ReleaseRecvBufLock(ss);
16 return SECFailure;
19 @@ -362,13 +367,17 @@ SSL_ExportKeyingMaterial(PRFileDesc *fd,
21 val = PORT_Alloc(valLen);
22 if (!val) {
23 + ssl_ReleaseSSL3HandshakeLock(ss);
24 + ssl_ReleaseRecvBufLock(ss);
25 return SECFailure;
27 i = 0;
29 PORT_Memcpy(val + i, &ss->ssl3.hs.client_random.rand, SSL3_RANDOM_LENGTH);
30 i += SSL3_RANDOM_LENGTH;
31 PORT_Memcpy(val + i, &ss->ssl3.hs.server_random.rand, SSL3_RANDOM_LENGTH);
32 i += SSL3_RANDOM_LENGTH;
34 if (hasContext) {
35 val[i++] = contextLen >> 8;
36 val[i++] = contextLen;
37 @@ -389,6 +398,8 @@ SSL_ExportKeyingMaterial(PRFileDesc *fd,
38 valLen, out, outLen);
40 ssl_ReleaseSpecReadLock(ss);
41 + ssl_ReleaseSSL3HandshakeLock(ss);
42 + ssl_ReleaseRecvBufLock(ss);
44 PORT_ZFree(val, valLen);
45 return rv;