diff options
author | bluhm <> | 2017-03-09 13:58:00 +0000 |
---|---|---|
committer | bluhm <> | 2017-03-09 13:58:00 +0000 |
commit | e0b21f4db9f1f5088a21858c6a147512928f29b1 (patch) | |
tree | b39378fa56c866122b1112cf5992e8c476551a85 /src | |
parent | 62cee9027bcc29cd46fff1eae6ea166b699f0376 (diff) | |
download | openbsd-e0b21f4db9f1f5088a21858c6a147512928f29b1.tar.gz openbsd-e0b21f4db9f1f5088a21858c6a147512928f29b1.tar.bz2 openbsd-e0b21f4db9f1f5088a21858c6a147512928f29b1.zip |
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@
Diffstat (limited to 'src')
-rw-r--r-- | src/usr.bin/nc/netcat.c | 4 |
1 files changed, 2 insertions, 2 deletions
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 @@ | |||
1 | /* $OpenBSD: netcat.c,v 1.177 2017/02/09 22:55:45 bluhm Exp $ */ | 1 | /* $OpenBSD: netcat.c,v 1.178 2017/03/09 13:58:00 bluhm Exp $ */ |
2 | /* | 2 | /* |
3 | * Copyright (c) 2001 Eric Jackson <ericj@monkey.org> | 3 | * Copyright (c) 2001 Eric Jackson <ericj@monkey.org> |
4 | * Copyright (c) 2015 Bob Beck. All rights reserved. | 4 | * Copyright (c) 2015 Bob Beck. All rights reserved. |
@@ -777,7 +777,7 @@ tls_setup_server(struct tls *tls_ctx, int connfd, char *host) | |||
777 | if (tls_accept_socket(tls_ctx, &tls_cctx, connfd) == -1) { | 777 | if (tls_accept_socket(tls_ctx, &tls_cctx, connfd) == -1) { |
778 | warnx("tls accept failed (%s)", tls_error(tls_ctx)); | 778 | warnx("tls accept failed (%s)", tls_error(tls_ctx)); |
779 | } else if (timeout_tls(connfd, tls_cctx, tls_handshake) == -1) { | 779 | } else if (timeout_tls(connfd, tls_cctx, tls_handshake) == -1) { |
780 | if ((errstr = tls_error(tls_ctx)) == NULL) | 780 | if ((errstr = tls_error(tls_cctx)) == NULL) |
781 | errstr = strerror(errno); | 781 | errstr = strerror(errno); |
782 | warnx("tls handshake failed (%s)", errstr); | 782 | warnx("tls handshake failed (%s)", errstr); |
783 | } else { | 783 | } else { |