Remove get_cipher_by_char and put_cipher_by_char.

Without SSLv2, all cipher suite values are 2 bytes. Represent them as a
uint16_t and make all functions pass those around rather than pointers.

This removes SSL_CIPHER_find as it's unused.

Change-Id: Iea0b75abee4352a8333a4b8e39a161430ae55ea6
Reviewed-on: https://boringssl-review.googlesource.com/1259
Reviewed-by: Adam Langley <agl@google.com>
diff --git a/ssl/ssl_sess.c b/ssl/ssl_sess.c
index 579627c..97ef3f8 100644
--- a/ssl/ssl_sess.c
+++ b/ssl/ssl_sess.c
@@ -560,16 +560,9 @@
 
 	if (ret->cipher == NULL)
 		{
-		unsigned char buf[5],*p;
-		unsigned long l;
-
-		p=buf;
-		l=ret->cipher_id;
-		l2n(l,p);
-		if ((ret->ssl_version>>8) >= SSL3_VERSION_MAJOR)
-			ret->cipher=ssl_get_cipher_by_char(s,&(buf[2]));
-		else 
-			ret->cipher=ssl_get_cipher_by_char(s,&(buf[1]));
+		/* The cipher id has a leading 0x03 to be removed (and then put
+		 * back for the binary search) as a remnant of SSLv2 support. */
+		ret->cipher = ssl3_get_cipher_by_value(ret->cipher_id & 0xffff);
 		if (ret->cipher == NULL)
 			goto err;
 		}