git ssb

0+

cel / sslh



Commit 6cc33820d166bc790c79f8e42aec8f53bcefd2ba

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>
Jonathan McCrohan committed on 6/6/2017, 12:11:29 AM
Parent: 00d5872aa176a23588f143551aa4b7e8dd1c0ca6

Files changed

tls.cchanged
tls.cView
@@ -29,8 +29,9 @@
2929 * TLS handshake and RFC4366.
3030 */
3131 #include <stdio.h>
3232 #include <stdlib.h> /* malloc() */
33+#include <fnmatch.h> /* fnmatch() */
3334 #include "tls.h"
3435
3536 #define TLS_HEADER_LEN 5
3637 #define TLS_HANDSHAKE_CONTENT_TYPE 0x16
@@ -289,9 +290,9 @@
289290 char **item;
290291
291292 for (item = list; *item; item++) {
292293 if (verbose) fprintf(stderr, "matching [%.*s] with [%s]\n", (int)name_len, name, *item);
293- if(!strncmp(*item, name, name_len)) {
294+ if(!fnmatch(*item, name, 0)) {
294295 return 1;
295296 }
296297 }
297298 return 0;

Built with git-ssb-web