From: Matt Caswell <matt@openssl.org>
Date: Wed, 7 Dec 2016 23:19:45 +0000 (+0000)
Subject: Fix more style issues following extensions refactor feedback
X-Git-Tag: OpenSSL_1_1_1-pre1~2881
X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=ecc2f938cf1cf7425be37156ecb216cdc6db257f;p=openssl

Fix more style issues following extensions refactor feedback

Perl changes reviewed by Richard Levitte. Non-perl changes reviewed by Rich
Salz

Reviewed-by: Rich Salz <rsalz@openssl.org>
Reviewed-by: Richard Levitte <levitte@openssl.org>
---

diff --git a/ssl/ssl_locl.h b/ssl/ssl_locl.h
index 6b603dd5fb..5671a6fff9 100644
--- a/ssl/ssl_locl.h
+++ b/ssl/ssl_locl.h
@@ -1642,7 +1642,7 @@ typedef struct raw_extension_st {
     int present;
     /* Set to 1 if we have already parsed the extension or 0 otherwise */
     int parsed;
-    /* The type of this extension */
+    /* The type of this extension, i.e. a TLSEXT_TYPE_* value */
     unsigned int type;
 } RAW_EXTENSION;
 
diff --git a/ssl/statem/extensions.c b/ssl/statem/extensions.c
index 15a47e0b84..61576cc551 100644
--- a/ssl/statem/extensions.c
+++ b/ssl/statem/extensions.c
@@ -349,6 +349,8 @@ int tls_collect_extensions(SSL *s, PACKET *packet, unsigned int context,
     RAW_EXTENSION *raw_extensions = NULL;
     const EXTENSION_DEFINITION *thisexd;
 
+    *res = NULL;
+
     /*
      * Initialise server side custom extensions. Client side is done during
      * construction of extensions for the ClientHello.
diff --git a/test/recipes/70-test_key_share.t b/test/recipes/70-test_key_share.t
index 339dc3c494..b0f8c09957 100755
--- a/test/recipes/70-test_key_share.t
+++ b/test/recipes/70-test_key_share.t
@@ -194,9 +194,9 @@ $proxy->clear();
 $proxy->filter(undef);
 $proxy->clientflags("-no_tls1_3");
 $proxy->start();
-my $clienthello = ${$proxy->message_list}[0];
+my $clienthello = $proxy->message_list->[0];
 ok(TLSProxy::Message->success()
-   && !defined ${$clienthello->extension_data}{TLSProxy::Message::EXT_KEY_SHARE},
+   && !defined $clienthello->extension_data->{TLSProxy::Message::EXT_KEY_SHARE},
    "No key_share for TLS<=1.2 client");
 $proxy->filter(\&modify_key_shares_filter);
 
@@ -304,7 +304,7 @@ sub modify_key_shares_filter
                      && $direction == SERVER_TO_CLIENT) {
             my $ext;
             my $key_share =
-                ${$message->extension_data}{TLSProxy::Message::EXT_KEY_SHARE};
+                $message->extension_data->{TLSProxy::Message::EXT_KEY_SHARE};
             $selectedgroupid = unpack("n", $key_share);
 
             if ($testtype == LOOK_ONLY) {
@@ -336,7 +336,7 @@ sub modify_key_shares_filter
                     "EDF83495E80380089F831B94D14B1421", #key_exchange data
                     0x00; #Trailing garbage
             }
-            $message->set_extension( TLSProxy::Message::EXT_KEY_SHARE, $ext);
+            $message->set_extension(TLSProxy::Message::EXT_KEY_SHARE, $ext);
 
             $message->repack();
         }