From 15b6cd2e31b46d6dc4ad006b9dea11a3ea306237 Mon Sep 17 00:00:00 2001 From: jsing <> Date: Sun, 24 Aug 2014 14:36:46 +0000 Subject: 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@ --- src/lib/libssl/s3_lib.c | 23 +++++++---------------- 1 file changed, 7 insertions(+), 16 deletions(-) (limited to 'src/lib/libssl/s3_lib.c') diff --git a/src/lib/libssl/s3_lib.c b/src/lib/libssl/s3_lib.c index 9a25643070..8d03512a26 100644 --- a/src/lib/libssl/s3_lib.c +++ b/src/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) { -- cgit v1.2.3-55-g6feb