The branch OpenSSL_1_1_0-stable has been updated
       via  190909aaabf1d8abf48b0c92a9d425c8f0bd2481 (commit)
       via  fb9f42e04d1f20ac7d0179d07f4ab7f559948fa6 (commit)
      from  833104e6bdfc41db06bf22e129d0ab43278628c5 (commit)


- Log -----------------------------------------------------------------
commit 190909aaabf1d8abf48b0c92a9d425c8f0bd2481
Author: Roelof duToit <r...@dutoit.za.net>
Date:   Thu Jul 13 14:09:19 2017 -0400

    Update PR#3925
    
    Reviewed-by: Tim Hudson <t...@openssl.org>
    Reviewed-by: Bernd Edlinger <bernd.edlin...@hotmail.de>
    Reviewed-by: Matt Caswell <m...@openssl.org>
    (Merged from https://github.com/openssl/openssl/pull/3925)

commit fb9f42e04d1f20ac7d0179d07f4ab7f559948fa6
Author: Roelof duToit <r...@dutoit.za.net>
Date:   Thu Jul 13 13:07:26 2017 -0400

    Retry SSL_read on ERROR_WANT_READ.
    This resolves the retry issue in general, but also the specific case where 
a TLS 1.3 server sends a post-handshake NewSessionTicket message prior to 
appdata.
    
    Reviewed-by: Tim Hudson <t...@openssl.org>
    Reviewed-by: Bernd Edlinger <bernd.edlin...@hotmail.de>
    Reviewed-by: Matt Caswell <m...@openssl.org>
    (Merged from https://github.com/openssl/openssl/pull/3925)

-----------------------------------------------------------------------

Summary of changes:
 apps/s_time.c | 16 +++++++++++-----
 1 file changed, 11 insertions(+), 5 deletions(-)

diff --git a/apps/s_time.c b/apps/s_time.c
index 263502c..3459573 100644
--- a/apps/s_time.c
+++ b/apps/s_time.c
@@ -229,8 +229,10 @@ int s_time_main(int argc, char **argv)
                                    fmt_http_get_cmd, www_path);
             if (SSL_write(scon, buf, buf_len) <= 0)
                 goto end;
-            while ((i = SSL_read(scon, buf, sizeof(buf))) > 0)
-                bytes_read += i;
+            while ((i = SSL_read(scon, buf, sizeof(buf))) > 0 ||
+                        SSL_get_error(scon, i) == SSL_ERROR_WANT_READ ||
+                        SSL_get_error(scon, i) == SSL_ERROR_WANT_WRITE)
+                if (i > 0) bytes_read += i;
         }
 #ifdef NO_SHUTDOWN
         SSL_set_shutdown(scon, SSL_SENT_SHUTDOWN | SSL_RECEIVED_SHUTDOWN);
@@ -287,7 +289,9 @@ int s_time_main(int argc, char **argv)
                                fmt_http_get_cmd, www_path);
         if (SSL_write(scon, buf, buf_len) <= 0)
             goto end;
-        while (SSL_read(scon, buf, sizeof(buf)) > 0)
+        while ((i = SSL_read(scon, buf, sizeof(buf))) > 0 ||
+                    SSL_get_error(scon, i) == SSL_ERROR_WANT_READ ||
+                    SSL_get_error(scon, i) == SSL_ERROR_WANT_WRITE)
             continue;
     }
 #ifdef NO_SHUTDOWN
@@ -318,8 +322,10 @@ int s_time_main(int argc, char **argv)
                          www_path);
             if (SSL_write(scon, buf, strlen(buf)) <= 0)
                 goto end;
-            while ((i = SSL_read(scon, buf, sizeof(buf))) > 0)
-                bytes_read += i;
+            while ((i = SSL_read(scon, buf, sizeof(buf))) > 0 ||
+                        SSL_get_error(scon, i) == SSL_ERROR_WANT_READ ||
+                        SSL_get_error(scon, i) == SSL_ERROR_WANT_WRITE)
+                if (i > 0) bytes_read += i;
         }
 #ifdef NO_SHUTDOWN
         SSL_set_shutdown(scon, SSL_SENT_SHUTDOWN | SSL_RECEIVED_SHUTDOWN);
_____
openssl-commits mailing list
To unsubscribe: https://mta.openssl.org/mailman/listinfo/openssl-commits

Reply via email to