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:
Jonathan McCrohan committed 2017-06-06 01:11:29 +01:00
1 parent 00d5872aa1
commit 6cc33820d1
1 file changed
+2 -1
+2 -1
View File
@@ -30,6 +30,7 @@
*/
#include <stdio.h>
#include <stdlib.h> /* malloc() */
#include <fnmatch.h> /* fnmatch() */
#include "tls.h"
#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++) {
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;
}
}