Skip to content

Commit 768e088

Browse files
committed
Correct return values for tls_construct_stoc_next_proto_neg
Return EXT_RETURN_NOT_SENT in the event that we don't send the extension, rather than EXT_RETURN_SENT. This actually makes no difference at all to the current control flow since this return value is ignored in this case anyway. But lets make it correct anyway. Follow on from CVE-2024-5535 (cherry picked from commit 189a7ed3e380e34ea38fe4190a7c9396bace0fb7)
1 parent 1b45f6a commit 768e088

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

ssl/statem/extensions_srvr.c

+2-1
Original file line numberDiff line numberDiff line change
@@ -1652,9 +1652,10 @@ EXT_RETURN tls_construct_stoc_next_proto_neg(SSL *s, WPACKET *pkt,
16521652
return EXT_RETURN_FAIL;
16531653
}
16541654
s->s3->npn_seen = 1;
1655+
return EXT_RETURN_SENT;
16551656
}
16561657

1657-
return EXT_RETURN_SENT;
1658+
return EXT_RETURN_NOT_SENT;
16581659
}
16591660
#endif
16601661

ssl/statem_ntls/extensions_srvr.c

+2-1
Original file line numberDiff line numberDiff line change
@@ -1238,9 +1238,10 @@ EXT_RETURN tls_construct_stoc_next_proto_neg_ntls(SSL *s, WPACKET *pkt,
12381238
return EXT_RETURN_FAIL;
12391239
}
12401240
s->s3->npn_seen = 1;
1241+
return EXT_RETURN_SENT;
12411242
}
12421243

1243-
return EXT_RETURN_SENT;
1244+
return EXT_RETURN_NOT_SENT;
12441245
}
12451246
# endif
12461247

0 commit comments

Comments
 (0)