diff options
| author | bluhm <> | 2017-03-09 13:58:00 +0000 |
|---|---|---|
| committer | bluhm <> | 2017-03-09 13:58:00 +0000 |
| commit | 0edff35405482628ec3f435a64b3e21d1e573f29 (patch) | |
| tree | b39378fa56c866122b1112cf5992e8c476551a85 /src/usr.bin/nc/netcat.c | |
| parent | 9515b45875cb0bffcfce617d07d12fc2622f92a0 (diff) | |
| download | openbsd-0edff35405482628ec3f435a64b3e21d1e573f29.tar.gz openbsd-0edff35405482628ec3f435a64b3e21d1e573f29.tar.bz2 openbsd-0edff35405482628ec3f435a64b3e21d1e573f29.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 '')
| -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 { |
