From e0b21f4db9f1f5088a21858c6a147512928f29b1 Mon Sep 17 00:00:00 2001 From: bluhm <> Date: Thu, 9 Mar 2017 13:58:00 +0000 Subject: The netcat server did not print the correct TLS error message if the handshake after accept had failed. Use the context of the accepted TLS connection. OK beck@ --- src/usr.bin/nc/netcat.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/usr.bin/nc/netcat.c b/src/usr.bin/nc/netcat.c index 4580356dfb..e222e1e731 100644 --- a/src/usr.bin/nc/netcat.c +++ b/src/usr.bin/nc/netcat.c @@ -1,4 +1,4 @@ -/* $OpenBSD: netcat.c,v 1.177 2017/02/09 22:55:45 bluhm Exp $ */ +/* $OpenBSD: netcat.c,v 1.178 2017/03/09 13:58:00 bluhm Exp $ */ /* * Copyright (c) 2001 Eric Jackson * Copyright (c) 2015 Bob Beck. All rights reserved. @@ -777,7 +777,7 @@ tls_setup_server(struct tls *tls_ctx, int connfd, char *host) if (tls_accept_socket(tls_ctx, &tls_cctx, connfd) == -1) { warnx("tls accept failed (%s)", tls_error(tls_ctx)); } else if (timeout_tls(connfd, tls_cctx, tls_handshake) == -1) { - if ((errstr = tls_error(tls_ctx)) == NULL) + if ((errstr = tls_error(tls_cctx)) == NULL) errstr = strerror(errno); warnx("tls handshake failed (%s)", errstr); } else { -- cgit v1.2.3-55-g6feb