Skip to content

Commit 30b3215

Browse files
committed
Increase sizes of bufs used in ClientHello parsing
as a defensive measure against modern TLS handshake sizes. suggested by @dpward in droe/sslsplit#342
1 parent 86777d9 commit 30b3215

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/protoautossl.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -258,7 +258,7 @@ protoautossl_peek_and_upgrade(pxy_conn_ctx_t *ctx)
258258

259259
/* peek the buffer */
260260
inbuf = bufferevent_get_input(ctx->src.bev);
261-
if (evbuffer_peek(inbuf, 2048, 0, vec_out, 1)) {
261+
if (evbuffer_peek(inbuf, 4096, 0, vec_out, 1)) {
262262
if (ssl_tls_clienthello_parse(vec_out[0].iov_base, vec_out[0].iov_len, 0, &chello, &ctx->sslctx->sni) == 0) {
263263
if (OPTS_DEBUG(ctx->global)) {
264264
log_dbg_printf("Peek found ClientHello\n");

src/protossl.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1354,7 +1354,7 @@ protossl_fd_readcb(evutil_socket_t fd, UNUSED short what, void *arg)
13541354
// Child connections will use the sni info obtained by the parent conn
13551355
/* for SSL, peek ClientHello and parse SNI from it */
13561356

1357-
unsigned char buf[2048];
1357+
unsigned char buf[4096];
13581358
ssize_t n;
13591359
const unsigned char *chello;
13601360
int rv;

0 commit comments

Comments
 (0)