summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTim Taubert <ttaubert@mozilla.com>2016-05-31 11:03:26 +0200
committerTim Taubert <ttaubert@mozilla.com>2016-05-31 11:03:26 +0200
commit865d9d828100b1c94499f1835634d6193b4f232a (patch)
tree4fc2f341ce7dab942ad33cea69df0cab367f4a10
parentcf3673fbb1d5c8e0d6e63436836191a8f4bdd409 (diff)
downloadnss-hg-865d9d828100b1c94499f1835634d6193b4f232a.tar.gz
Bug 1276618 - Follow-up to fix unused variable warning r=bustage
-rw-r--r--lib/ssl/tls13con.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/lib/ssl/tls13con.c b/lib/ssl/tls13con.c
index fec7c823e..b3d959e3b 100644
--- a/lib/ssl/tls13con.c
+++ b/lib/ssl/tls13con.c
@@ -391,6 +391,12 @@ tls13_RecoverWrappedSharedSecret(sslSocket *ss, sslSessionID *sid)
return SECFailure;
}
+ hashType = tls13_GetHash(ss);
+ if (hashType != ssl_hash_sha256 && hashType != ssl_hash_sha384) {
+ PORT_Assert(0);
+ return SECFailure;
+ }
+
/* If we are the server, we compute the wrapping key, but if we
* are the client, it's coordinates are stored with the ticket. */
if (ss->sec.isServer) {
@@ -422,8 +428,6 @@ tls13_RecoverWrappedSharedSecret(sslSocket *ss, sslSessionID *sid)
wrappedMS.len = sid->u.ssl3.keys.wrapped_master_secret_len;
/* unwrap the "master secret" which becomes SS. */
- hashType = tls13_GetHash(ss);
- PORT_Assert(hashType == ssl_hash_sha256 || hashType == ssl_hash_sha384);
SS = PK11_UnwrapSymKeyWithFlags(wrapKey, sid->u.ssl3.masterWrapMech,
NULL, &wrappedMS,
CKM_SSL3_MASTER_KEY_DERIVE,