Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/crypto/external/bsd/openssl/dist/apps openssl: Revert local ...



details:   https://anonhg.NetBSD.org/src/rev/f1314c3d6d79
branches:  trunk
changeset: 374054:f1314c3d6d79
user:      riastradh <riastradh%NetBSD.org@localhost>
date:      Wed Mar 29 10:18:50 2023 +0000

description:
openssl: Revert local patch around fileno(stdin/stdout).

According to the commit history, this was introduced when gcc4.5
complained about using the return value of fileno without checking it
against -1.  gcc 10.4 no longer appears to object, so let's just nix
the local patch.

diffstat:

 crypto/external/bsd/openssl/dist/apps/s_client.c |  18 ++++--------------
 crypto/external/bsd/openssl/dist/apps/s_server.c |  11 +++--------
 2 files changed, 7 insertions(+), 22 deletions(-)

diffs (88 lines):

diff -r eefe2f85ba06 -r f1314c3d6d79 crypto/external/bsd/openssl/dist/apps/s_client.c
--- a/crypto/external/bsd/openssl/dist/apps/s_client.c  Wed Mar 29 09:45:05 2023 +0000
+++ b/crypto/external/bsd/openssl/dist/apps/s_client.c  Wed Mar 29 10:18:50 2023 +0000
@@ -2770,16 +2770,6 @@ int s_client_main(int argc, char **argv)
     for (;;) {
         FD_ZERO(&readfds);
         FD_ZERO(&writefds);
-        int fdin = fileno_stdin();
-        if (fdin < 0) {
-            BIO_printf(bio_err,"bad fileno for stdin\n");
-            goto shut;
-        }
-        int fdout = fileno_stdout();
-        if (fdout < 0) {
-            BIO_printf(bio_err,"bad fileno for stdout\n");
-            goto shut;
-        }
 
         if (SSL_is_dtls(con) && DTLSv1_get_timeout(con, &timeout))
             timeoutp = &timeout;
@@ -2834,10 +2824,10 @@ int s_client_main(int argc, char **argv)
                  * set the flag so we exit.
                  */
                 if (read_tty && !at_eof)
-                    openssl_fdset(fdin, &readfds);
+                    openssl_fdset(fileno_stdin(), &readfds);
 #if !defined(OPENSSL_SYS_VMS)
                 if (write_tty)
-                    openssl_fdset(fdout, &writefds);
+                    openssl_fdset(fileno_stdout(), &writefds);
 #endif
             }
             if (read_ssl)
@@ -2965,7 +2955,7 @@ int s_client_main(int argc, char **argv)
         /* Assume Windows/DOS/BeOS can always write */
         else if (!ssl_pending && write_tty)
 #else
-        else if (!ssl_pending && FD_ISSET(fdout, &writefds))
+        else if (!ssl_pending && FD_ISSET(fileno_stdout(), &writefds))
 #endif
         {
 #ifdef CHARSET_EBCDIC
@@ -3052,7 +3042,7 @@ int s_client_main(int argc, char **argv)
 #if defined(OPENSSL_SYS_MSDOS)
         else if (has_stdin_waiting())
 #else
-        else if (FD_ISSET(fdin, &readfds))
+        else if (FD_ISSET(fileno_stdin(), &readfds))
 #endif
         {
             if (crlf) {
diff -r eefe2f85ba06 -r f1314c3d6d79 crypto/external/bsd/openssl/dist/apps/s_server.c
--- a/crypto/external/bsd/openssl/dist/apps/s_server.c  Wed Mar 29 09:45:05 2023 +0000
+++ b/crypto/external/bsd/openssl/dist/apps/s_server.c  Wed Mar 29 10:18:50 2023 +0000
@@ -2265,7 +2265,7 @@ static int sv_body(int s, int stype, int
     char *buf = NULL;
     fd_set readfds;
     int ret = 1, width;
-    int k, i, fdin;
+    int k, i;
     unsigned long l;
     SSL *con = NULL;
     BIO *sbio;
@@ -2449,14 +2449,9 @@ static int sv_body(int s, int stype, int
                            || (async && SSL_waiting_for_async(con));
 
         if (!read_from_sslcon) {
-            fdin = fileno_stdin();
-            if (fdin < 0) {
-                BIO_printf(bio_err,"Bad fileno for stdin\n");
-                goto err;
-            }
             FD_ZERO(&readfds);
 #if !defined(OPENSSL_SYS_WINDOWS) && !defined(OPENSSL_SYS_MSDOS)
-            openssl_fdset(fdin, &readfds);
+            openssl_fdset(fileno_stdin(), &readfds);
 #endif
             openssl_fdset(s, &readfds);
             /*
@@ -2493,7 +2488,7 @@ static int sv_body(int s, int stype, int
 
             if (i <= 0)
                 continue;
-            if (FD_ISSET(fdin, &readfds))
+            if (FD_ISSET(fileno_stdin(), &readfds))
                 read_from_terminal = 1;
 #endif
             if (FD_ISSET(s, &readfds))



Home | Main Index | Thread Index | Old Index