diff options
author | 2015-02-07 05:46:01 +0000 | |
---|---|---|
committer | 2015-02-07 05:46:01 +0000 | |
commit | c8ee8471a1d2bb9c6bdfa6fd0c6d254b9aaa933d (patch) | |
tree | 4ec20e07426ae97fa7cc1b5ff524e5e3f257d2ac /lib/libssl/s3_clnt.c | |
parent | keep this in sync a bit with userland by putting static on functions (diff) | |
download | wireguard-openbsd-c8ee8471a1d2bb9c6bdfa6fd0c6d254b9aaa933d.tar.xz wireguard-openbsd-c8ee8471a1d2bb9c6bdfa6fd0c6d254b9aaa933d.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 'lib/libssl/s3_clnt.c')
-rw-r--r-- | lib/libssl/s3_clnt.c | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/lib/libssl/s3_clnt.c b/lib/libssl/s3_clnt.c index b2c75175980..9b52691015e 100644 --- a/lib/libssl/s3_clnt.c +++ b/lib/libssl/s3_clnt.c @@ -1,4 +1,4 @@ -/* $OpenBSD: s3_clnt.c,v 1.106 2015/02/06 09:58:52 jsing Exp $ */ +/* $OpenBSD: s3_clnt.c,v 1.107 2015/02/07 05:46:01 jsing Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -773,7 +773,7 @@ ssl3_get_server_hello(SSL *s) const SSL_CIPHER *c; unsigned char *p, *q, *d; int i, al, ok; - unsigned int j, cipher_id; + unsigned int j; uint16_t cipher_value; long n; unsigned long alg_k; @@ -844,7 +844,6 @@ ssl3_get_server_hello(SSL *s) /* Get the cipher value. */ q = p + j; n2s(q, cipher_value); - cipher_id = SSL3_CK_ID | cipher_value; /* * Check if we want to resume the session based on external @@ -856,8 +855,8 @@ ssl3_get_server_hello(SSL *s) if (s->tls_session_secret_cb(s, s->session->master_key, &s->session->master_key_length, NULL, &pref_cipher, s->tls_session_secret_cb_arg)) { - s->session->cipher = pref_cipher ? - pref_cipher : ssl3_get_cipher_by_id(cipher_id); + s->session->cipher = pref_cipher ? pref_cipher : + ssl3_get_cipher_by_value(cipher_value); s->s3->flags |= SSL3_FLAGS_CCS_OK; } } @@ -892,8 +891,7 @@ ssl3_get_server_hello(SSL *s) } p += j; - c = ssl3_get_cipher_by_id(cipher_id); - if (c == NULL) { + if ((c = ssl3_get_cipher_by_value(cipher_value)) == NULL) { /* unknown cipher */ al = SSL_AD_ILLEGAL_PARAMETER; SSLerr(SSL_F_SSL3_GET_SERVER_HELLO, |