summaryrefslogtreecommitdiff
path: root/src/lib/libtls/tls.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/libtls/tls.c')
-rw-r--r--src/lib/libtls/tls.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/lib/libtls/tls.c b/src/lib/libtls/tls.c
index 448b048b33..4378c5980a 100644
--- a/src/lib/libtls/tls.c
+++ b/src/lib/libtls/tls.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: tls.c,v 1.22 2015/09/10 10:26:49 beck Exp $ */ 1/* $OpenBSD: tls.c,v 1.23 2015/09/10 10:59:22 beck Exp $ */
2/* 2/*
3 * Copyright (c) 2014 Joel Sing <jsing@openbsd.org> 3 * Copyright (c) 2014 Joel Sing <jsing@openbsd.org>
4 * 4 *
@@ -379,6 +379,7 @@ tls_handshake(struct tls *ctx)
379 else if ((ctx->flags & TLS_SERVER_CONN) != 0) 379 else if ((ctx->flags & TLS_SERVER_CONN) != 0)
380 rv = tls_handshake_server(ctx); 380 rv = tls_handshake_server(ctx);
381 381
382 /* Prevent callers from performing incorrect error handling */
382 errno = 0; 383 errno = 0;
383 return (rv); 384 return (rv);
384} 385}
@@ -406,6 +407,7 @@ tls_read(struct tls *ctx, void *buf, size_t buflen)
406 407
407 rv = (ssize_t)tls_ssl_error(ctx, ctx->ssl_conn, ssl_ret, "read"); 408 rv = (ssize_t)tls_ssl_error(ctx, ctx->ssl_conn, ssl_ret, "read");
408 out: 409 out:
410 /* Prevent callers from performing incorrect error handling */
409 errno = 0; 411 errno = 0;
410 return (rv); 412 return (rv);
411} 413}
@@ -433,6 +435,7 @@ tls_write(struct tls *ctx, const void *buf, size_t buflen)
433 435
434 rv = (ssize_t)tls_ssl_error(ctx, ctx->ssl_conn, ssl_ret, "write"); 436 rv = (ssize_t)tls_ssl_error(ctx, ctx->ssl_conn, ssl_ret, "write");
435 out: 437 out:
438 /* Prevent callers from performing incorrect error handling */
436 errno = 0; 439 errno = 0;
437 return (rv); 440 return (rv);
438} 441}
@@ -470,6 +473,7 @@ tls_close(struct tls *ctx)
470 ctx->socket = -1; 473 ctx->socket = -1;
471 } 474 }
472 out: 475 out:
476 /* Prevent callers from performing incorrect error handling */
473 errno = 0; 477 errno = 0;
474 return (rv); 478 return (rv);
475} 479}