summaryrefslogtreecommitdiff
path: root/src/lib/libssl/s3_clnt.c
diff options
context:
space:
mode:
authorjsing <>2015-02-07 05:46:01 +0000
committerjsing <>2015-02-07 05:46:01 +0000
commit6462420bc08d290040b65cd657178ea158e83571 (patch)
tree4ee0fc11a8214e89b48aa090fc5491c12b1793be /src/lib/libssl/s3_clnt.c
parent6b246d35bb311ef0726da2113541c9a56921791f (diff)
downloadopenbsd-6462420bc08d290040b65cd657178ea158e83571.tar.gz
openbsd-6462420bc08d290040b65cd657178ea158e83571.tar.bz2
openbsd-6462420bc08d290040b65cd657178ea158e83571.zip
Clean up the {get,put}_cipher_by_char() implementations. Also use
ssl3_get_cipher_by_value() in other parts of the code where it simplifies things. ok doug@
Diffstat (limited to '')
-rw-r--r--src/lib/libssl/s3_clnt.c12
1 files changed, 5 insertions, 7 deletions
diff --git a/src/lib/libssl/s3_clnt.c b/src/lib/libssl/s3_clnt.c
index b2c7517598..9b52691015 100644
--- a/src/lib/libssl/s3_clnt.c
+++ b/src/lib/libssl/s3_clnt.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: s3_clnt.c,v 1.106 2015/02/06 09:58:52 jsing Exp $ */ 1/* $OpenBSD: s3_clnt.c,v 1.107 2015/02/07 05:46:01 jsing Exp $ */
2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) 2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
3 * All rights reserved. 3 * All rights reserved.
4 * 4 *
@@ -773,7 +773,7 @@ ssl3_get_server_hello(SSL *s)
773 const SSL_CIPHER *c; 773 const SSL_CIPHER *c;
774 unsigned char *p, *q, *d; 774 unsigned char *p, *q, *d;
775 int i, al, ok; 775 int i, al, ok;
776 unsigned int j, cipher_id; 776 unsigned int j;
777 uint16_t cipher_value; 777 uint16_t cipher_value;
778 long n; 778 long n;
779 unsigned long alg_k; 779 unsigned long alg_k;
@@ -844,7 +844,6 @@ ssl3_get_server_hello(SSL *s)
844 /* Get the cipher value. */ 844 /* Get the cipher value. */
845 q = p + j; 845 q = p + j;
846 n2s(q, cipher_value); 846 n2s(q, cipher_value);
847 cipher_id = SSL3_CK_ID | cipher_value;
848 847
849 /* 848 /*
850 * Check if we want to resume the session based on external 849 * Check if we want to resume the session based on external
@@ -856,8 +855,8 @@ ssl3_get_server_hello(SSL *s)
856 if (s->tls_session_secret_cb(s, s->session->master_key, 855 if (s->tls_session_secret_cb(s, s->session->master_key,
857 &s->session->master_key_length, NULL, &pref_cipher, 856 &s->session->master_key_length, NULL, &pref_cipher,
858 s->tls_session_secret_cb_arg)) { 857 s->tls_session_secret_cb_arg)) {
859 s->session->cipher = pref_cipher ? 858 s->session->cipher = pref_cipher ? pref_cipher :
860 pref_cipher : ssl3_get_cipher_by_id(cipher_id); 859 ssl3_get_cipher_by_value(cipher_value);
861 s->s3->flags |= SSL3_FLAGS_CCS_OK; 860 s->s3->flags |= SSL3_FLAGS_CCS_OK;
862 } 861 }
863 } 862 }
@@ -892,8 +891,7 @@ ssl3_get_server_hello(SSL *s)
892 } 891 }
893 p += j; 892 p += j;
894 893
895 c = ssl3_get_cipher_by_id(cipher_id); 894 if ((c = ssl3_get_cipher_by_value(cipher_value)) == NULL) {
896 if (c == NULL) {
897 /* unknown cipher */ 895 /* unknown cipher */
898 al = SSL_AD_ILLEGAL_PARAMETER; 896 al = SSL_AD_ILLEGAL_PARAMETER;
899 SSLerr(SSL_F_SSL3_GET_SERVER_HELLO, 897 SSLerr(SSL_F_SSL3_GET_SERVER_HELLO,