More cleanup.
authorBen Laurie <ben@links.org>
Thu, 1 Aug 2013 11:33:15 +0000 (12:33 +0100)
committerScott Deboy <sdeboy@secondstryke.com>
Sun, 9 Feb 2014 16:07:04 +0000 (08:07 -0800)
(cherry picked from commit 5eda213ebe382009c2f37a8eade5cbcdae6017ed)
Conflicts:
apps/s_client.c
apps/s_server.c

apps/s_cb.c
apps/s_client.c
apps/s_server.c
ssl/s3_clnt.c
ssl/s3_srvr.c
ssl/ssl.h
ssl/ssl_lib.c
ssl/ssltest.c

index 040ffaf186153d8a8a604d6c8e68d1904da04303..3af9b7ad9c8e1a988739f4a645da0e7c1ea7fcab 100644 (file)
@@ -876,12 +876,12 @@ void MS_CALLBACK msg_cb(int write_p, int version, int content_type, const void *
                                case 16:
                                        str_details1 = ", ClientKeyExchange";
                                        break;
-                               case 23:
-                                       str_details1 = ", SupplementalData";
-                                       break;
                                case 20:
                                        str_details1 = ", Finished";
                                        break;
+                               case 23:
+                                       str_details1 = ", SupplementalData";
+                                       break;
                                        }
                                }
                        }
index eece94f859a6ed7fb8a449e1713fca5ec1d18475..5c10ae51a765304c851de521e34f9887bbb08447 100644 (file)
@@ -2440,18 +2440,12 @@ static int authz_tlsext_cb(SSL *s, unsigned short ext_type,
                           void *arg)
        {
        if (TLSEXT_TYPE_server_authz == ext_type)
-               {
-               server_provided_server_authz = (memchr(in,
-               TLSEXT_AUTHZDATAFORMAT_dtcp,
-               inlen) != NULL);
-               }
+               server_provided_server_authz
+                 = (memchr(in, TLSEXT_AUTHZDATAFORMAT_dtcp, inlen) != NULL);
 
        if (TLSEXT_TYPE_client_authz == ext_type)
-               {
-               server_provided_client_authz = (memchr(in,
-               TLSEXT_AUTHZDATAFORMAT_dtcp,
-               inlen) != NULL);
-               }
+               server_provided_client_authz
+                 = (memchr(in, TLSEXT_AUTHZDATAFORMAT_dtcp, inlen) != NULL);
 
        return 1;
        }
index 7ac7df81e17239c8d8464e59ffc8b8f09aa618ff..dbd4df994444caf1ec5eaca2d92ecde7b5258ec2 100644 (file)
@@ -1053,7 +1053,7 @@ int MAIN(int argc, char *argv[])
        EVP_PKEY *s_key = NULL, *s_dkey = NULL;
        int no_cache = 0, ext_cache = 0;
        int rev = 0, naccept = -1;
-    int c_no_resumption_on_reneg = 0;
+       int c_no_resumption_on_reneg = 0;
 #ifndef OPENSSL_NO_TLSEXT
        EVP_PKEY *s_key2 = NULL;
        X509 *s_cert2 = NULL;
@@ -1961,10 +1961,8 @@ bad:
                }
 #endif
 
-    if (c_no_resumption_on_reneg)
-        {
-        SSL_CTX_set_options(ctx, SSL_OP_NO_SESSION_RESUMPTION_ON_RENEGOTIATION);
-        }
+       if (c_no_resumption_on_reneg)
+               SSL_CTX_set_options(ctx, SSL_OP_NO_SESSION_RESUMPTION_ON_RENEGOTIATION);
        if (!set_cert_key_stuff(ctx, s_cert, s_key, s_chain, build_chain))
                goto end;
 #ifndef OPENSSL_NO_TLSEXT
@@ -3558,18 +3556,12 @@ static int authz_tlsext_cb(SSL *s, unsigned short ext_type,
                           void *arg)
        {
        if (TLSEXT_TYPE_server_authz == ext_type)
-               {
-               client_provided_server_authz = (memchr(in,
-               TLSEXT_AUTHZDATAFORMAT_dtcp,
-               inlen) != NULL);
-               }
+               client_provided_server_authz
+                 = memchr(in,  TLSEXT_AUTHZDATAFORMAT_dtcp, inlen) != NULL;
 
        if (TLSEXT_TYPE_client_authz == ext_type)
-               {
-               client_provided_client_authz = (memchr(in,
-               TLSEXT_AUTHZDATAFORMAT_dtcp,
-               inlen) != NULL);
-               }
+               client_provided_client_authz
+                 = memchr(in, TLSEXT_AUTHZDATAFORMAT_dtcp, inlen) != NULL;
 
        return 1;
        }
index 98ea3ec6c25e9b9f65a89280779c11a1f3334488..f5ed658d10374c1dca049256906d95344aeec383 100644 (file)
@@ -3571,9 +3571,11 @@ int ssl3_check_finished(SSL *s)
        {
        int ok;
        long n;
-/*     Read the message to see if it is supplemental data, regardless if there is a session ticket
-       this function is called when we really expect a Certificate
-       message, so permit appropriate message length */
+
+       /* Read the message to see if it is supplemental data,
+        * regardless if there is a session ticket this function is
+        * called when we really expect a Certificate message, so
+        * permit appropriate message length */
        n=s->method->ssl_get_message(s,
                SSL3_ST_CR_CERT_A,
                SSL3_ST_CR_CERT_B,
@@ -3584,9 +3586,7 @@ int ssl3_check_finished(SSL *s)
        s->s3->tmp.reuse_message = 1;
 
        if (s->s3->tmp.message_type == SSL3_MT_SUPPLEMENTAL_DATA)
-               {
                return 3;
-               }
        /* If we have no ticket it cannot be a resumed session. */
        if (!s->session->tlsext_tick)
                return 1;
@@ -3739,7 +3739,7 @@ int tls1_get_server_supplemental_data(SSL *s)
                goto f_err;
                }
        n2l3(p, supp_data_len);
-       while (p<d+supp_data_len)
+       while (p < d+supp_data_len)
                {
                n2s(p, supp_data_entry_type);
                n2s(p, supp_data_entry_len);
@@ -3759,7 +3759,7 @@ int tls1_get_server_supplemental_data(SSL *s)
                                        }
                                }
                        }
-               p+=supp_data_entry_len;
+               p += supp_data_entry_len;
                }
        return 1;
 f_err:
index 3d6c2d61046fcb054e7a6dbea78420d78bf109e2..aefc559011c09c4127472f30cd5816cc0b160ed3 100644 (file)
@@ -903,9 +903,7 @@ int ssl3_check_client_hello(SSL *s)
        s->s3->tmp.reuse_message = 1;
 #ifndef OPENSSL_NO_TLSEXT
        if (s->s3->tmp.message_type == SSL3_MT_SUPPLEMENTAL_DATA)
-               {
                return 3;
-               }
 #endif
        if (s->s3->tmp.message_type == SSL3_MT_CLIENT_HELLO)
                {
index 157870c3bd74c53bc6d128a315688a78d8346f67..f91141bdc0fa3fcf988e811425683f934cccd410 100644 (file)
--- a/ssl/ssl.h
+++ b/ssl/ssl.h
@@ -1202,11 +1202,11 @@ struct ssl_ctx_st
        custom_srv_ext_record *custom_srv_ext_records;
        size_t custom_srv_ext_records_count;
 
-    /* Arrays containing the callbacks for Supplemental Data. */
-    cli_supp_data_record *cli_supp_data_records;
-    size_t cli_supp_data_records_count;
-    srv_supp_data_record *srv_supp_data_records;
-    size_t srv_supp_data_records_count;
+       /* Arrays containing the callbacks for Supplemental Data. */
+       cli_supp_data_record *cli_supp_data_records;
+       size_t cli_supp_data_records_count;
+       srv_supp_data_record *srv_supp_data_records;
+       size_t srv_supp_data_records_count;
        };
 
 #endif
index 6cbc0839455a51850c341a680c4f37c38166b3a2..1670a87271a08e270cc91d82b7d76ad985d32975 100644 (file)
@@ -1877,7 +1877,7 @@ int SSL_CTX_set_cli_supp_data(SSL_CTX *ctx,
                        return 0;
 
        ctx->cli_supp_data_records = OPENSSL_realloc(ctx->cli_supp_data_records,
-       (ctx->cli_supp_data_records_count+1) * sizeof(cli_supp_data_record));
+         (ctx->cli_supp_data_records_count+1) * sizeof(cli_supp_data_record));
        if (!ctx->cli_supp_data_records)
                {
                ctx->cli_supp_data_records_count = 0;
@@ -1906,7 +1906,7 @@ int SSL_CTX_set_srv_supp_data(SSL_CTX *ctx,
                        return 0;
 
        ctx->srv_supp_data_records = OPENSSL_realloc(ctx->srv_supp_data_records,
-       (ctx->srv_supp_data_records_count+1) * sizeof(srv_supp_data_record));
+         (ctx->srv_supp_data_records_count+1) * sizeof(srv_supp_data_record));
        if (!ctx->srv_supp_data_records)
                {
                ctx->srv_supp_data_records_count = 0;
index 8bffe14aae4e5b99893a39ba7c4fc9d2a61ac720..fc7c65590748f4abdb0ed735ba36e2ad79e36db5 100644 (file)
@@ -446,7 +446,7 @@ int custom_ext = 0;
 /* This set based on extension callbacks */
 int custom_ext_error = 0;
 
-/*Not IETF assigned supplemental data types*/
+/* Not IETF assigned supplemental data types */
 #define CUSTOM_SUPP_DATA_TYPE_0 100
 #define CUSTOM_SUPP_DATA_TYPE_1 101
 #define CUSTOM_SUPP_DATA_TYPE_2 102