diff options
author | 2014-08-24 14:36:45 +0000 | |
---|---|---|
committer | 2014-08-24 14:36:45 +0000 | |
commit | ef88cf8e57c0c5ec5dabf3ef064c26ac8ec79f96 (patch) | |
tree | a798ea060f7e234e3fd9d0ae03642d95bfcf840d /lib/libssl/s3_lib.c | |
parent | reduce indentation of main program by one tab, no functional change (diff) | |
download | wireguard-openbsd-ef88cf8e57c0c5ec5dabf3ef064c26ac8ec79f96.tar.xz wireguard-openbsd-ef88cf8e57c0c5ec5dabf3ef064c26ac8ec79f96.zip |
Replace the remaining uses of ssl3_put_cipher_by_char() with s2n and a
ssl3_cipher_get_value() helper function, which returns the cipher suite
value for the given cipher.
ok miod@
Diffstat (limited to 'lib/libssl/s3_lib.c')
-rw-r--r-- | lib/libssl/s3_lib.c | 23 |
1 files changed, 7 insertions, 16 deletions
diff --git a/lib/libssl/s3_lib.c b/lib/libssl/s3_lib.c index 9a256430709..8d03512a264 100644 --- a/lib/libssl/s3_lib.c +++ b/lib/libssl/s3_lib.c @@ -1,4 +1,4 @@ -/* $OpenBSD: s3_lib.c,v 1.78 2014/08/23 15:37:38 jsing Exp $ */ +/* $OpenBSD: s3_lib.c,v 1.79 2014/08/24 14:36:45 jsing Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -1819,6 +1819,12 @@ ssl3_get_cipher_by_id(unsigned int id) return (NULL); } +uint16_t +ssl3_cipher_get_value(const SSL_CIPHER *c) +{ + return (c->id & SSL3_CK_VALUE_MASK); +} + int ssl3_pending(const SSL *s) { @@ -2385,21 +2391,6 @@ ssl3_ctx_callback_ctrl(SSL_CTX *ctx, int cmd, void (*fp)(void)) return (1); } -int -ssl3_put_cipher_by_char(const SSL_CIPHER *c, unsigned char *p) -{ - long l; - - if (p != NULL) { - l = c->id; - if ((l & 0xff000000) != 0x03000000) - return (0); - p[0] = ((unsigned char)(l >> 8L)) & 0xFF; - p[1] = ((unsigned char)(l)) & 0xFF; - } - return (2); -} - SSL_CIPHER *ssl3_choose_cipher(SSL *s, STACK_OF(SSL_CIPHER) *clnt, STACK_OF(SSL_CIPHER) *srvr) { |