diff options
| author | jsing <> | 2014-08-11 01:06:22 +0000 |
|---|---|---|
| committer | jsing <> | 2014-08-11 01:06:22 +0000 |
| commit | a4ce4dfd66a0d1623edb622cd4153d529d5bcbba (patch) | |
| tree | c4b22f9d4535ad9c0a7097891de25f1e7d9dde3b /src/lib/libssl/ssl_sess.c | |
| parent | 504c45b16cb96d7d25fc2f710a7cf44d75e780d7 (diff) | |
| download | openbsd-a4ce4dfd66a0d1623edb622cd4153d529d5bcbba.tar.gz openbsd-a4ce4dfd66a0d1623edb622cd4153d529d5bcbba.tar.bz2 openbsd-a4ce4dfd66a0d1623edb622cd4153d529d5bcbba.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 '')
| -rw-r--r-- | src/lib/libssl/ssl_sess.c | 15 |
1 files changed, 2 insertions, 13 deletions
diff --git a/src/lib/libssl/ssl_sess.c b/src/lib/libssl/ssl_sess.c index d4fa5a618f..8e285ea9b1 100644 --- a/src/lib/libssl/ssl_sess.c +++ b/src/lib/libssl/ssl_sess.c | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | /* $OpenBSD: ssl_sess.c,v 1.39 2014/08/10 14:42:56 jsing Exp $ */ | 1 | /* $OpenBSD: ssl_sess.c,v 1.40 2014/08/11 01:06:22 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 | * |
| @@ -558,18 +558,7 @@ ssl_get_prev_session(SSL *s, unsigned char *session_id, int len, | |||
| 558 | } | 558 | } |
| 559 | 559 | ||
| 560 | if (ret->cipher == NULL) { | 560 | if (ret->cipher == NULL) { |
| 561 | unsigned char buf[5], *p; | 561 | ret->cipher = ssl3_get_cipher_by_id(ret->cipher_id); |
| 562 | unsigned long l; | ||
| 563 | |||
| 564 | p = buf; | ||
| 565 | l = ret->cipher_id; | ||
| 566 | l2n(l, p); | ||
| 567 | |||
| 568 | if ((ret->ssl_version >> 8) >= SSL3_VERSION_MAJOR) | ||
| 569 | ret->cipher = ssl3_get_cipher_by_char(&buf[2]); | ||
| 570 | else | ||
| 571 | ret->cipher = ssl3_get_cipher_by_char(&buf[1]); | ||
| 572 | |||
| 573 | if (ret->cipher == NULL) | 562 | if (ret->cipher == NULL) |
| 574 | goto err; | 563 | goto err; |
| 575 | } | 564 | } |
