Rename hs->public_key.

This is an unhelpfully generic name. Rename it to match SSL_ECDH_CTX.
Unqualified "public key" is typically assumed to be the certificate.

Change-Id: I8ba8c3f2bb1343d1c006845a1110e833451c5a56
Reviewed-on: https://boringssl-review.googlesource.com/14564
Reviewed-by: Adam Langley <agl@google.com>
diff --git a/ssl/internal.h b/ssl/internal.h
index 2504ca0..a6375a6 100644
--- a/ssl/internal.h
+++ b/ssl/internal.h
@@ -1014,10 +1014,10 @@
   uint8_t *key_share_bytes;
   size_t key_share_bytes_len;
 
-  /* public_key, for servers, is the key share to be sent to the client in TLS
-   * 1.3. */
-  uint8_t *public_key;
-  size_t public_key_len;
+  /* ecdh_public_key, for servers, is the key share to be sent to the client in
+   * TLS 1.3. */
+  uint8_t *ecdh_public_key;
+  size_t ecdh_public_key_len;
 
   /* peer_sigalgs are the signature algorithms that the peer supports. These are
    * taken from the contents of the signature algorithms extension for a server
diff --git a/ssl/s3_both.c b/ssl/s3_both.c
index 7ef400a..aff2154 100644
--- a/ssl/s3_both.c
+++ b/ssl/s3_both.c
@@ -166,7 +166,7 @@
   SSL_TRANSCRIPT_cleanup(&hs->transcript);
   OPENSSL_free(hs->cookie);
   OPENSSL_free(hs->key_share_bytes);
-  OPENSSL_free(hs->public_key);
+  OPENSSL_free(hs->ecdh_public_key);
   SSL_SESSION_free(hs->new_session);
   OPENSSL_free(hs->peer_sigalgs);
   OPENSSL_free(hs->peer_supported_group_list);
diff --git a/ssl/t1_lib.c b/ssl/t1_lib.c
index 793e2d7..2acd422 100644
--- a/ssl/t1_lib.c
+++ b/ssl/t1_lib.c
@@ -2336,7 +2336,8 @@
       !SSL_ECDH_CTX_init(&group, group_id) ||
       !SSL_ECDH_CTX_accept(&group, &public_key, &secret, &secret_len, out_alert,
                            CBS_data(&peer_key), CBS_len(&peer_key)) ||
-      !CBB_finish(&public_key, &hs->public_key, &hs->public_key_len)) {
+      !CBB_finish(&public_key, &hs->ecdh_public_key,
+                  &hs->ecdh_public_key_len)) {
     OPENSSL_free(secret);
     SSL_ECDH_CTX_cleanup(&group);
     CBB_cleanup(&public_key);
@@ -2360,14 +2361,15 @@
       !CBB_add_u16_length_prefixed(out, &kse_bytes) ||
       !CBB_add_u16(&kse_bytes, group_id) ||
       !CBB_add_u16_length_prefixed(&kse_bytes, &public_key) ||
-      !CBB_add_bytes(&public_key, hs->public_key, hs->public_key_len) ||
+      !CBB_add_bytes(&public_key, hs->ecdh_public_key,
+                     hs->ecdh_public_key_len) ||
       !CBB_flush(out)) {
     return 0;
   }
 
-  OPENSSL_free(hs->public_key);
-  hs->public_key = NULL;
-  hs->public_key_len = 0;
+  OPENSSL_free(hs->ecdh_public_key);
+  hs->ecdh_public_key = NULL;
+  hs->ecdh_public_key_len = 0;
 
   hs->new_session->group_id = group_id;
   return 1;