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..fe6b6f5b16c67867b71c758cde73f7fc2558b159 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); |
+ 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,17 @@ 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; |
+ |
if (hasContext) { |
val[i++] = contextLen >> 8; |
val[i++] = contextLen; |
@@ -415,6 +424,8 @@ SSL_ExportKeyingMaterial(PRFileDesc *fd, |
valLen, out, outLen); |
} |
ssl_ReleaseSpecReadLock(ss); |
+ ssl_ReleaseSSL3HandshakeLock(ss); |
+ ssl_ReleaseRecvBufLock(ss); |
PORT_ZFree(val, valLen); |
return rv; |