"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "src/util/parse_proxy_v2.c" between
hitch-1.6.1.tar.gz and hitch-1.7.0.tar.gz

About: Hitch is a libev-based high performance SSL/TLS proxy that terminates TLS/SSL connections and forwards the unencrypted traffic to some backend.

parse_proxy_v2.c  (hitch-1.6.1):parse_proxy_v2.c  (hitch-1.7.0)
skipping to change at line 201 skipping to change at line 201
sublen, extensions + j); sublen, extensions + j);
break; break;
case PP2_SUBTYPE_SSL_CIPHER: case PP2_SUBTYPE_SSL_CIPHER:
printf("SSL_CIPHER:\t%.*s\n", printf("SSL_CIPHER:\t%.*s\n",
sublen, extensions + j); sublen, extensions + j);
break; break;
} }
j += sublen; j += sublen;
} }
break; break;
case 0xe0:
printf("TLV 0xe0: len=%d\n", l);
printf("%*s\n", l, extensions + i);
break;
default: default:
printf("ERROR:\tUnknown extension %d\n", type); printf("ERROR:\tUnknown extension %d\n", type);
break; break;
} }
i += l - 1; i += l - 1;
} }
if (i != extensions_len) { if (i != extensions_len) {
printf("ERROR:\tBuffer overrun (%d / %d)\n", i, extensions_len); printf("ERROR:\tBuffer overrun (%d / %d)\n", i, extensions_len);
return (1); return (1);
} }
return (0); return (0);
} }
int int
main(int argc, const char **argv) main(int argc, const char **argv)
{ {
unsigned char proxy_header[PP2_HEADER_MAX + 1]; unsigned char proxy_header[BUFSIZ];
ssize_t n = 0; ssize_t n = 0;
int address_len = 0; int address_len = 0;
if (argc == 1) if (argc == 1)
n = read(STDIN_FILENO, proxy_header, PP2_HEADER_MAX); n = read(STDIN_FILENO, proxy_header, sizeof(proxy_header));
else if (argc == 2) else if (argc == 2)
n = read_from_socket(argv[1], proxy_header, PP2_HEADER_MAX); n = read_from_socket(argv[1], proxy_header,
sizeof(proxy_header));
else { else {
fprintf(stderr, "Usage: parse_proxy_v2 [port]\n"); fprintf(stderr, "Usage: parse_proxy_v2 [port]\n");
return (1); return (1);
} }
if (n < 16) { if (n < 16) {
printf("ERROR:\tread too few bytes.\n"); printf("ERROR:\tread too few bytes.\n");
return (1); return (1);
} }
proxy_header[n] = '\0'; proxy_header[n] = '\0';
 End of changes. 4 change blocks. 
3 lines changed or deleted 8 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)