Add an implicit CBS to Span<const uint8_t> conversion.

They are exactly the same structure. Doing it in CBS allows us to switch
bssl::Span to absl::Span or a standard std::span in the future.

Bug: 132
Change-Id: Ibc96673c23233d557a1dd4d8768d2659d7a4ca0c
Reviewed-on: https://boringssl-review.googlesource.com/20669
Reviewed-by: David Benjamin <davidben@google.com>
Commit-Queue: David Benjamin <davidben@google.com>
CQ-Verified: CQ bot account: commit-bot@chromium.org <commit-bot@chromium.org>
diff --git a/ssl/t1_lib.cc b/ssl/t1_lib.cc
index 32311ff..6301505 100644
--- a/ssl/t1_lib.cc
+++ b/ssl/t1_lib.cc
@@ -2174,9 +2174,7 @@
     return 0;
   }
 
-  if (!hs->key_share->Finish(
-          out_secret, out_alert,
-          MakeConstSpan(CBS_data(&peer_key), CBS_len(&peer_key)))) {
+  if (!hs->key_share->Finish(out_secret, out_alert, peer_key)) {
     *out_alert = SSL_AD_INTERNAL_ERROR;
     return 0;
   }
@@ -2238,10 +2236,9 @@
   Array<uint8_t> secret;
   ScopedCBB public_key;
   UniquePtr<SSLKeyShare> key_share = SSLKeyShare::Create(group_id);
-  if (!key_share || !CBB_init(public_key.get(), 32) ||
-      !key_share->Accept(
-          public_key.get(), &secret, out_alert,
-          MakeConstSpan(CBS_data(&peer_key), CBS_len(&peer_key))) ||
+  if (!key_share ||
+      !CBB_init(public_key.get(), 32) ||
+      !key_share->Accept(public_key.get(), &secret, out_alert, peer_key) ||
       !CBB_finish(public_key.get(), &hs->ecdh_public_key,
                   &hs->ecdh_public_key_len)) {
     *out_alert = SSL_AD_ILLEGAL_PARAMETER;