git ssb

0+

cel / sslh



Commit 960373f54f4b7127b4be72a3bad8bd74327fee96

Add shs (secret-handshake) protocol

cel committed on 8/29/2017, 7:34:32 PM
Parent: f4d2a8d2adb32056e656a73ce3d1d1d155f81046

Files changed

probe.cchanged
probe.cView
@@ -39,8 +39,9 @@
3939 static int is_xmpp_protocol(const char *p, int len, struct proto*);
4040 static int is_http_protocol(const char *p, int len, struct proto*);
4141 static int is_tls_protocol(const char *p, int len, struct proto*);
4242 static int is_adb_protocol(const char *p, int len, struct proto*);
43 +static int is_shs_protocol(const char *p, int len, struct proto*);
4344 static int is_true(const char *p, int len, struct proto* proto) { return 1; }
4445
4546 /* Table of protocols that have a built-in probe
4647 */
@@ -53,8 +54,9 @@
5354 { "http", NULL, NULL, 1, 0, is_http_protocol },
5455 { "ssl", NULL, NULL, 1, 0, is_tls_protocol },
5556 { "tls", NULL, NULL, 1, 0, is_tls_protocol },
5657 { "adb", NULL, NULL, 1, 0, is_adb_protocol },
58 + { "shs", NULL, NULL, 1, 0, is_shs_protocol },
5759 { "anyprot", NULL, NULL, 1, 0, is_true }
5860 };
5961
6062 static struct proto *protocols;
@@ -261,8 +263,16 @@
261263 */
262264 return !memcmp(&p[0], "CNXN", 4) && !memcmp(&p[24], "host:", 5);
263265 }
264266
267 +static int is_shs_protocol(const char *p, int len, struct proto *proto)
268 +{
269 + if (len < 64)
270 + return PROBE_AGAIN;
271 +
272 + return len == 64;
273 +}
274 +
265275 static int regex_probe(const char *p, int len, struct proto *proto)
266276 {
267277 #ifdef ENABLE_REGEX
268278 regex_t **probe = proto->data;

Built with git-ssb-web