From a7f868b1c0b00915dc9b2316c5a2e5663b65c155 Mon Sep 17 00:00:00 2001 From: Joel Sing Date: Wed, 9 Sep 2015 19:23:04 +0000 Subject: 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@ --- usr.bin/ftp/fetch.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'usr.bin') 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') -- cgit v1.2.3