Skip to content

Commit 5512c2d

Browse files
authored
Merge pull request #9541 from jackctj117/empty-hash-comment
Added comment with empty hash use
2 parents 85d40c8 + 585a8d2 commit 5512c2d

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/tls13.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1197,6 +1197,8 @@ int DeriveHandshakeSecret(WOLFSSL* ssl)
11971197
return ret;
11981198
#endif
11991199

1200+
/* Derive-Secret(., "derived", "") per RFC 8446 Section 7.1.
1201+
* Empty hash (NULL, 0) is required by the TLS 1.3 key schedule. */
12001202
ret = DeriveKeyMsg(ssl, key, -1, ssl->arrays->secret,
12011203
derivedLabel, DERIVED_LABEL_SZ,
12021204
NULL, 0, ssl->specs.mac_algorithm);
@@ -1232,6 +1234,8 @@ int DeriveMasterSecret(WOLFSSL* ssl)
12321234
return ret;
12331235
#endif
12341236

1237+
/* Derive-Secret(., "derived", "") per RFC 8446 Section 7.1.
1238+
* Empty hash (NULL, 0) is required by the TLS 1.3 key schedule. */
12351239
ret = DeriveKeyMsg(ssl, key, -1, ssl->arrays->preMasterSecret,
12361240
derivedLabel, DERIVED_LABEL_SZ,
12371241
NULL, 0, ssl->specs.mac_algorithm);

0 commit comments

Comments
 (0)