mirror of
https://github.com/yrutschle/sslh.git
synced 2026-10-22 18:12:10 +03:00
tls: permit wildcard ALPN/SNI values
Use fnmatch(3) to provide support for glob style wildcard values in the ALPN and SNI parameters of the TLS probe. Signed-off-by: Jonathan McCrohan <jmccrohan@gmail.com>
This commit is contained in:
1 parent
00d5872aa1
commit
6cc33820d1
1 file changed
+2
-1
@@ -30,6 +30,7 @@
|
|||||||
*/
|
*/
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdlib.h> /* malloc() */
|
#include <stdlib.h> /* malloc() */
|
||||||
|
#include <fnmatch.h> /* fnmatch() */
|
||||||
#include "tls.h"
|
#include "tls.h"
|
||||||
|
|
||||||
#define TLS_HEADER_LEN 5
|
#define TLS_HEADER_LEN 5
|
||||||
@@ -290,7 +291,7 @@ has_match(char** list, const char* name, size_t name_len) {
|
|||||||
|
|
||||||
for (item = list; *item; item++) {
|
for (item = list; *item; item++) {
|
||||||
if (verbose) fprintf(stderr, "matching [%.*s] with [%s]\n", (int)name_len, name, *item);
|
if (verbose) fprintf(stderr, "matching [%.*s] with [%s]\n", (int)name_len, name, *item);
|
||||||
if(!strncmp(*item, name, name_len)) {
|
if(!fnmatch(*item, name, 0)) {
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in new issue
Block a user