summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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,