diff options
author | Joel Sing <jsing@cvs.openbsd.org> | 2015-09-09 19:23:04 +0000 |
---|---|---|
committer | Joel Sing <jsing@cvs.openbsd.org> | 2015-09-09 19:23:04 +0000 |
commit | a7f868b1c0b00915dc9b2316c5a2e5663b65c155 (patch) | |
tree | 86edfabe7caf17ad26c5cb755394710c2224706f /usr.bin/ftp | |
parent | 2cb1dc6cfb899f2b0a4a74386ab90874d27c85f4 (diff) |
Make sure we check TLS_WRITE_AGAIN when calling tls_read() and if
tls_read() fails, print the tls_error() rather than just the return value.
ok beck@
Diffstat (limited to 'usr.bin/ftp')
-rw-r--r-- | usr.bin/ftp/fetch.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/usr.bin/ftp/fetch.c b/usr.bin/ftp/fetch.c index ce1a88ff6fd..a4aadcf6bd7 100644 --- a/usr.bin/ftp/fetch.c +++ b/usr.bin/ftp/fetch.c @@ -1,4 +1,4 @@ -/* $OpenBSD: fetch.c,v 1.139 2015/07/18 21:50:47 bluhm Exp $ */ +/* $OpenBSD: fetch.c,v 1.140 2015/09/09 19:23:03 jsing Exp $ */ /* $NetBSD: fetch.c,v 1.14 1997/08/18 10:20:20 lukem Exp $ */ /*- @@ -1549,10 +1549,10 @@ SSL_readline(struct tls *tls, size_t *lenp) } again: ret = tls_read(tls, &c, 1, &nr); - if (ret == TLS_READ_AGAIN) + if (ret == TLS_READ_AGAIN || ret == TLS_WRITE_AGAIN) goto again; if (ret != 0) - errx(1, "SSL read error: %u", ret); + errx(1, "SSL read error: %s", tls_error(tls)); buf[i] = c; if (c == '\n') |