Skip to content

Commit 6a3467e

Browse files
Code review feedback
1 parent e4657d2 commit 6a3467e

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

src/tls13.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1003,8 +1003,9 @@ int Tls13_Exporter(WOLFSSL* ssl, unsigned char *out, size_t outLen,
10031003
if (outLen > WOLFSSL_MAX_16BIT)
10041004
return BAD_FUNC_ARG;
10051005
/* RFC 8446 HkdfLabel encodes the label length in a single byte, so
1006-
* anything > 255 cannot be represented and must be rejected. */
1007-
if (labelLen > (WOLFSSL_MAX_8BIT - protocolLen))
1006+
* anything > 255 cannot be represented and must be rejected.
1007+
* The protocol length is included in the label. */
1008+
if ((labelLen + protocolLen) > WOLFSSL_MAX_8BIT)
10081009
return BAD_FUNC_ARG;
10091010

10101011
switch (ssl->specs.mac_algorithm) {

0 commit comments

Comments
 (0)