summaryrefslogtreecommitdiffstats
path: root/lib/libssl/ssl_sess.c
diff options
context:
space:
mode:
authorjsing <jsing@openbsd.org>2014-08-11 01:06:22 +0000
committerjsing <jsing@openbsd.org>2014-08-11 01:06:22 +0000
commitba83acf62b74ac38323cdf014409e05439e107e0 (patch)
tree9d1a129b8545cc245157d4e66ca887803cb26ad1 /lib/libssl/ssl_sess.c
parentWrite the core file of a non-suid process into the current directory (diff)
downloadwireguard-openbsd-ba83acf62b74ac38323cdf014409e05439e107e0.tar.xz
wireguard-openbsd-ba83acf62b74ac38323cdf014409e05439e107e0.zip
Provide a ssl3_get_cipher_by_id() function that allows ciphers to be looked
up by their ID. For one, this avoids an ugly mess in ssl_sess.c, where the cipher value is manually written into a buffer, just so the cipher can be located using ssl3_get_cipher_by_char(). ok bcook@ miod@
Diffstat (limited to 'lib/libssl/ssl_sess.c')
-rw-r--r--lib/libssl/ssl_sess.c15
1 files changed, 2 insertions, 13 deletions
diff --git a/lib/libssl/ssl_sess.c b/lib/libssl/ssl_sess.c
index d4fa5a618f9..8e285ea9b18 100644
--- a/lib/libssl/ssl_sess.c
+++ b/lib/libssl/ssl_sess.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ssl_sess.c,v 1.39 2014/08/10 14:42:56 jsing Exp $ */
+/* $OpenBSD: ssl_sess.c,v 1.40 2014/08/11 01:06:22 jsing Exp $ */
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
* All rights reserved.
*
@@ -558,18 +558,7 @@ ssl_get_prev_session(SSL *s, unsigned char *session_id, int len,
}
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 = ssl3_get_cipher_by_char(&buf[2]);
- else
- ret->cipher = ssl3_get_cipher_by_char(&buf[1]);
-
+ ret->cipher = ssl3_get_cipher_by_id(ret->cipher_id);
if (ret->cipher == NULL)
goto err;
}