mirror of
https://github.com/yrutschle/sslh.git
synced 2025-06-20 00:43:53 +03:00
tls: proposed fix for incorrect SNI/ALPN matching
This commit is contained in:
parent
60df92c2b2
commit
e42f670112
4
tls.c
4
tls.c
@ -183,7 +183,7 @@ parse_extensions(const struct TLSProtocol *tls_data, const char *data, size_t da
|
|||||||
if (tls_data->use_alpn == 2) {
|
if (tls_data->use_alpn == 2) {
|
||||||
/* we want BOTH alpn and sni to match */
|
/* we want BOTH alpn and sni to match */
|
||||||
if (extension_type == 0x00) { /* Server Name */
|
if (extension_type == 0x00) { /* Server Name */
|
||||||
if (parse_server_name_extension(tls_data, data + pos + 4, len)) {
|
if (parse_server_name_extension(tls_data, data + pos + 4, len) > 0) {
|
||||||
/* SNI matched */
|
/* SNI matched */
|
||||||
if(last_matched) {
|
if(last_matched) {
|
||||||
/* this is only true if ALPN matched, so return true */
|
/* this is only true if ALPN matched, so return true */
|
||||||
@ -197,7 +197,7 @@ parse_extensions(const struct TLSProtocol *tls_data, const char *data, size_t da
|
|||||||
return -2;
|
return -2;
|
||||||
}
|
}
|
||||||
} else if (extension_type == 0x10) { /* ALPN */
|
} else if (extension_type == 0x10) { /* ALPN */
|
||||||
if (parse_alpn_extension(tls_data, data + pos + 4, len)) {
|
if (parse_alpn_extension(tls_data, data + pos + 4, len) > 0) {
|
||||||
/* ALPN matched */
|
/* ALPN matched */
|
||||||
if(last_matched) {
|
if(last_matched) {
|
||||||
/* this is only true if SNI matched, so return true */
|
/* this is only true if SNI matched, so return true */
|
||||||
|
Loading…
x
Reference in New Issue
Block a user