Further tidy up cipher logic.

With SSL2 gone, there's no need for this split between the abstract
cipher framework and ciphers. Put the cipher suite table in ssl_cipher.c
and move other SSL_CIPHER logic there. With that gone, prune the
cipher-related hooks in SSL_PROTOCOL_METHOD.

BUG=468889

Change-Id: I48579de8bc4c0ea52781ba1b7b57bc5b4919d21c
Reviewed-on: https://boringssl-review.googlesource.com/4961
Reviewed-by: Adam Langley <agl@google.com>
diff --git a/ssl/ssl_lib.c b/ssl/ssl_lib.c
index 7149861..f20813b 100644
--- a/ssl/ssl_lib.c
+++ b/ssl/ssl_lib.c
@@ -1122,34 +1122,6 @@
   return ctx->method->ssl_ctx_ctrl(ctx, cmd, larg, parg);
 }
 
-int ssl_cipher_id_cmp(const void *in_a, const void *in_b) {
-  long l;
-  const SSL_CIPHER *a = in_a;
-  const SSL_CIPHER *b = in_b;
-  const long a_id = a->id;
-  const long b_id = b->id;
-
-  l = a_id - b_id;
-  if (l == 0L) {
-    return 0;
-  } else {
-    return (l > 0) ? 1 : -1;
-  }
-}
-
-int ssl_cipher_ptr_id_cmp(const SSL_CIPHER **ap, const SSL_CIPHER **bp) {
-  long l;
-  const long a_id = (*ap)->id;
-  const long b_id = (*bp)->id;
-
-  l = a_id - b_id;
-  if (l == 0) {
-    return 0;
-  } else {
-    return (l > 0) ? 1 : -1;
-  }
-}
-
 /* return a STACK of the ciphers available for the SSL and in order of
  * preference */
 STACK_OF(SSL_CIPHER) *SSL_get_ciphers(const SSL *s) {
@@ -1288,7 +1260,7 @@
         c->algorithm_auth & ct->mask_a) {
       continue;
     }
-    s2n(ssl3_get_cipher_value(c), p);
+    s2n(ssl_cipher_get_value(c), p);
   }
 
   /* If all ciphers were disabled, return the error to the caller. */
@@ -1363,7 +1335,7 @@
       continue;
     }
 
-    c = ssl3_get_cipher_by_value(cipher_suite);
+    c = SSL_get_cipher_by_value(cipher_suite);
     if (c != NULL && !sk_SSL_CIPHER_push(sk, c)) {
       OPENSSL_PUT_ERROR(SSL, ssl_bytes_to_cipher_list, ERR_R_MALLOC_FAILURE);
       goto err;
@@ -2943,10 +2915,6 @@
   s->accept_peer_renegotiations = !reject;
 }
 
-const SSL_CIPHER *SSL_get_cipher_by_value(uint16_t value) {
-  return ssl3_get_cipher_by_value(value);
-}
-
 int SSL_get_rc4_state(const SSL *ssl, const RC4_KEY **read_key,
                       const RC4_KEY **write_key) {
   if (ssl->aead_read_ctx == NULL || ssl->aead_write_ctx == NULL) {