summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Thomson <martin.thomson@gmail.com>2017-11-21 17:32:59 +1100
committerMartin Thomson <martin.thomson@gmail.com>2017-11-21 17:32:59 +1100
commit9350b5437e402600d336d4220e26a8f4b69bc493 (patch)
tree38ce5364c958505db0857f314cab5d24c06312cf
parentf415f902eac3ee4dfb678079ffd8a073fc80646a (diff)
downloadnss-hg-9350b5437e402600d336d4220e26a8f4b69bc493.tar.gz
Bug 1413787 - Move initialization functions for more coverage, r=franziskus
-rw-r--r--lib/ssl/ssl3con.c7
-rw-r--r--lib/ssl/sslsock.c12
2 files changed, 5 insertions, 14 deletions
diff --git a/lib/ssl/ssl3con.c b/lib/ssl/ssl3con.c
index b1bc5afa7..1e3dd870d 100644
--- a/lib/ssl/ssl3con.c
+++ b/lib/ssl/ssl3con.c
@@ -12245,13 +12245,6 @@ ssl_InitSecState(sslSecurityInfo *sec)
sec->keaGroup = NULL;
}
-/* Called from: ssl3_SendRecord
-** ssl3_SendClientHello()
-** ssl3_HandleV2ClientHello()
-** ssl3_HandleRecord()
-**
-** This function should perhaps acquire and release the SpecWriteLock.
-*/
SECStatus
ssl3_InitState(sslSocket *ss)
{
diff --git a/lib/ssl/sslsock.c b/lib/ssl/sslsock.c
index c1aae8abf..711f79d81 100644
--- a/lib/ssl/sslsock.c
+++ b/lib/ssl/sslsock.c
@@ -364,6 +364,7 @@ ssl_DupSocket(sslSocket *os)
goto loser;
}
}
+
return ss;
loser:
@@ -1839,13 +1840,6 @@ ssl_ImportFD(PRFileDesc *model, PRFileDesc *fd, SSLProtocolVariant variant)
if (ns == NULL)
return NULL;
- status = ssl3_InitState(ns);
- if (status != SECSuccess) {
- ssl_FreeSocket(ns);
- PORT_SetError(SEC_ERROR_LIBRARY_FAILURE);
- return NULL;
- }
-
rv = ssl_PushIOLayer(ns, fd, PR_TOP_IO_LAYER);
if (rv != PR_SUCCESS) {
ssl_FreeSocket(ns);
@@ -3869,6 +3863,10 @@ ssl_NewSocket(PRBool makeLocks, SSLProtocolVariant protocolVariant)
rv = ssl3_InitGather(&ss->gs);
if (rv != SECSuccess)
goto loser;
+ rv = ssl3_InitState(ss);
+ if (rv != SECSuccess) {
+ goto loser;
+ }
return ss;
loser: