[openssl-commits] [openssl] master update

Matt Caswell matt at openssl.org
Fri Jul 14 10:25:07 UTC 2017


The branch master has been updated
       via  a87a39d05f070dda823953a0c90a447bb755b73f (commit)
       via  f32bf051cf1c376216bf4fec905fafebeb6ec2dc (commit)
      from  4a60bb1898ca8271a6ae46e2e2e805879eb38931 (commit)


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

    Update PR#3925
    
    Reviewed-by: Tim Hudson <tjh at openssl.org>
    Reviewed-by: Bernd Edlinger <bernd.edlinger at hotmail.de>
    Reviewed-by: Matt Caswell <matt at openssl.org>
    (Merged from https://github.com/openssl/openssl/pull/3925)

commit f32bf051cf1c376216bf4fec905fafebeb6ec2dc
Author: Roelof duToit <r at 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 <tjh at openssl.org>
    Reviewed-by: Bernd Edlinger <bernd.edlinger at hotmail.de>
    Reviewed-by: Matt Caswell <matt at 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 b10c7e1..cf9ed45 100644
--- a/apps/s_time.c
+++ b/apps/s_time.c
@@ -240,8 +240,10 @@ int s_time_main(int argc, char **argv)
                                    www_path);
             if (buf_len <= 0 || 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);
@@ -297,7 +299,9 @@ int s_time_main(int argc, char **argv)
         buf_len = BIO_snprintf(buf, sizeof(buf), fmt_http_get_cmd, www_path);
         if (buf_len <= 0 || 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
@@ -328,8 +332,10 @@ int s_time_main(int argc, char **argv)
                                    www_path);
             if (buf_len <= 0 || 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);


More information about the openssl-commits mailing list