[openssl-commits] [openssl] OpenSSL_1_1_0-stable update

Richard Levitte levitte at openssl.org
Thu Mar 16 10:44:27 UTC 2017


The branch OpenSSL_1_1_0-stable has been updated
       via  14d4d7eda1d2d83c48db7cbf1928ae6e12339265 (commit)
      from  ef727bc5669182cdf8519734ae9924fc54cc4164 (commit)


- Log -----------------------------------------------------------------
commit 14d4d7eda1d2d83c48db7cbf1928ae6e12339265
Author: FdaSilvaYY <fdasilvayy at gmail.com>
Date:   Tue Dec 6 00:42:01 2016 +0100

    Simplify code around next_proto.len by changing 'len' data type.
    
    clean an useless static qualifier and a dead comment.
    
    Reviewed-by: Rich Salz <rsalz at openssl.org>
    Reviewed-by: Richard Levitte <levitte at openssl.org>
    (Merged from https://github.com/openssl/openssl/pull/2278)
    
    (cherry picked from commit f2ff1432fc50e5033471859dc9899eb219278a7a)

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

Summary of changes:
 apps/s_server.c | 22 ++++++----------------
 1 file changed, 6 insertions(+), 16 deletions(-)

diff --git a/apps/s_server.c b/apps/s_server.c
index 66405e6..a3ee4d6 100644
--- a/apps/s_server.c
+++ b/apps/s_server.c
@@ -105,8 +105,6 @@ static void free_sessions(void);
 static DH *load_dh_param(const char *dhfile);
 #endif
 
-/* static int load_CA(SSL_CTX *ctx, char *file);*/
-
 static const int bufsize = 16 * 1024;
 static int accept_socket = -1;
 
@@ -139,12 +137,11 @@ static const char *session_id_prefix = NULL;
 #ifndef OPENSSL_NO_DTLS
 static int enable_timeouts = 0;
 static long socket_mtu;
-
-#endif
 static int dtlslisten = 0;
+#endif
 
 #ifndef OPENSSL_NO_PSK
-static char *psk_identity = "Client_identity";
+static const char psk_identity[] = "Client_identity";
 char *psk_key = NULL;           /* by default PSK is not used */
 
 static unsigned int psk_server_cb(SSL *ssl, const char *identity,
@@ -449,7 +446,6 @@ static int ssl_servername_cb(SSL *s, int *ad, void *arg)
 }
 
 /* Structure passed to cert status callback */
-
 typedef struct tlsextstatusctx_st {
     /* Default responder to use */
     char *host, *path, *port;
@@ -584,7 +580,7 @@ static int cert_status_cb(SSL *s, void *arg)
 /* This is the context that we pass to next_proto_cb */
 typedef struct tlsextnextprotoctx_st {
     unsigned char *data;
-    unsigned int len;
+    size_t len;
 } tlsextnextprotoctx;
 
 static int next_proto_cb(SSL *s, const unsigned char **data,
@@ -919,7 +915,7 @@ int s_server_main(int argc, char *argv[])
     tlsextalpnctx alpn_ctx = { NULL, 0 };
 #ifndef OPENSSL_NO_PSK
     /* by default do not send a PSK identity hint */
-    static char *psk_identity_hint = NULL;
+    char *psk_identity_hint = NULL;
     char *p;
 #endif
 #ifndef OPENSSL_NO_SRP
@@ -1519,22 +1515,16 @@ int s_server_main(int argc, char *argv[])
     }
 #if !defined(OPENSSL_NO_NEXTPROTONEG)
     if (next_proto_neg_in) {
-        size_t len;
-        next_proto.data = next_protos_parse(&len, next_proto_neg_in);
+        next_proto.data = next_protos_parse(&next_proto.len, next_proto_neg_in);
         if (next_proto.data == NULL)
             goto end;
-        next_proto.len = len;
-    } else {
-        next_proto.data = NULL;
     }
 #endif
     alpn_ctx.data = NULL;
     if (alpn_in) {
-        size_t len;
-        alpn_ctx.data = next_protos_parse(&len, alpn_in);
+        alpn_ctx.data = next_protos_parse(&alpn_ctx.len, alpn_in);
         if (alpn_ctx.data == NULL)
             goto end;
-        alpn_ctx.len = len;
     }
 
     if (crl_file) {


More information about the openssl-commits mailing list