summaryrefslogtreecommitdiff
path: root/src/lib/libssl/tls13_lib.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/libssl/tls13_lib.c')
-rw-r--r--src/lib/libssl/tls13_lib.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/src/lib/libssl/tls13_lib.c b/src/lib/libssl/tls13_lib.c
index 0151395be8..e371d71750 100644
--- a/src/lib/libssl/tls13_lib.c
+++ b/src/lib/libssl/tls13_lib.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: tls13_lib.c,v 1.6 2019/02/26 17:36:30 jsing Exp $ */ 1/* $OpenBSD: tls13_lib.c,v 1.7 2019/02/28 17:44:56 jsing Exp $ */
2/* 2/*
3 * Copyright (c) 2018, 2019 Joel Sing <jsing@openbsd.org> 3 * Copyright (c) 2018, 2019 Joel Sing <jsing@openbsd.org>
4 * 4 *
@@ -251,9 +251,12 @@ tls13_legacy_read_bytes(SSL *ssl, int type, unsigned char *buf, int len, int pee
251 SSLerror(ssl, ERR_R_SHOULD_NOT_HAVE_BEEN_CALLED); 251 SSLerror(ssl, ERR_R_SHOULD_NOT_HAVE_BEEN_CALLED);
252 return -1; 252 return -1;
253 } 253 }
254 if (len < 0) {
255 SSLerror(ssl, SSL_R_BAD_LENGTH);
256 return -1;
257 }
254 258
255 ret = tls13_read_application_data(ctx->rl, buf, len); 259 ret = tls13_read_application_data(ctx->rl, buf, len);
256
257 return tls13_legacy_return_code(ssl, ret); 260 return tls13_legacy_return_code(ssl, ret);
258} 261}
259 262
@@ -267,8 +270,11 @@ tls13_legacy_write_bytes(SSL *ssl, int type, const void *buf, int len)
267 SSLerror(ssl, ERR_R_SHOULD_NOT_HAVE_BEEN_CALLED); 270 SSLerror(ssl, ERR_R_SHOULD_NOT_HAVE_BEEN_CALLED);
268 return -1; 271 return -1;
269 } 272 }
273 if (len <= 0) {
274 SSLerror(ssl, SSL_R_BAD_LENGTH);
275 return -1;
276 }
270 277
271 ret = tls13_write_application_data(ctx->rl, buf, len); 278 ret = tls13_write_application_data(ctx->rl, buf, len);
272
273 return tls13_legacy_return_code(ssl, ret); 279 return tls13_legacy_return_code(ssl, ret);
274} 280}