diff options
| author | doug <> | 2015-07-14 05:20:46 +0000 |
|---|---|---|
| committer | doug <> | 2015-07-14 05:20:46 +0000 |
| commit | c3deb465485f7d28ec0999613a36a05dadcf0381 (patch) | |
| tree | cb700f43a3369aed0188765b213764d26071d923 /src/lib/libssl/s3_lib.c | |
| parent | ac6ac77151fb4d663b15a0a474658b87dae09d02 (diff) | |
| download | openbsd-c3deb465485f7d28ec0999613a36a05dadcf0381.tar.gz openbsd-c3deb465485f7d28ec0999613a36a05dadcf0381.tar.bz2 openbsd-c3deb465485f7d28ec0999613a36a05dadcf0381.zip | |
Convert ssl3_get_cipher_by_char to CBS.
ok miod@ jsing@
Diffstat (limited to '')
| -rw-r--r-- | src/lib/libssl/s3_lib.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/lib/libssl/s3_lib.c b/src/lib/libssl/s3_lib.c index 79f680f527..c838409bf7 100644 --- a/src/lib/libssl/s3_lib.c +++ b/src/lib/libssl/s3_lib.c | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | /* $OpenBSD: s3_lib.c,v 1.96 2015/05/25 21:35:35 guenther Exp $ */ | 1 | /* $OpenBSD: s3_lib.c,v 1.97 2015/07/14 05:20:46 doug 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 | * |
| @@ -155,6 +155,7 @@ | |||
| 155 | #include <openssl/objects.h> | 155 | #include <openssl/objects.h> |
| 156 | 156 | ||
| 157 | #include "ssl_locl.h" | 157 | #include "ssl_locl.h" |
| 158 | #include "bytestring.h" | ||
| 158 | 159 | ||
| 159 | #define SSL3_NUM_CIPHERS (sizeof(ssl3_ciphers) / sizeof(SSL_CIPHER)) | 160 | #define SSL3_NUM_CIPHERS (sizeof(ssl3_ciphers) / sizeof(SSL_CIPHER)) |
| 160 | 161 | ||
| @@ -2532,9 +2533,14 @@ ssl3_ctx_callback_ctrl(SSL_CTX *ctx, int cmd, void (*fp)(void)) | |||
| 2532 | const SSL_CIPHER * | 2533 | const SSL_CIPHER * |
| 2533 | ssl3_get_cipher_by_char(const unsigned char *p) | 2534 | ssl3_get_cipher_by_char(const unsigned char *p) |
| 2534 | { | 2535 | { |
| 2536 | CBS cipher; | ||
| 2535 | uint16_t cipher_value; | 2537 | uint16_t cipher_value; |
| 2536 | 2538 | ||
| 2537 | n2s(p, cipher_value); | 2539 | /* We have to assume it is at least 2 bytes due to existing API. */ |
| 2540 | CBS_init(&cipher, p, 2); | ||
| 2541 | if (!CBS_get_u16(&cipher, &cipher_value)) | ||
| 2542 | return NULL; | ||
| 2543 | |||
| 2538 | return ssl3_get_cipher_by_value(cipher_value); | 2544 | return ssl3_get_cipher_by_value(cipher_value); |
| 2539 | } | 2545 | } |
| 2540 | 2546 | ||
