From: tb Date: Wed, 29 Nov 2023 13:29:34 +0000 (+0000) Subject: Use a long for id in ssl3_get_cipher_by_id() X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=9f01a767b73c533d4891a96507ce3be6cadae3a8;p=openbsd Use a long for id in ssl3_get_cipher_by_id() While the cipher id is effectively a 32-bit value, someone decided that it should be represented by a long in various internal structs, whose mameber is passed as id. So use a long because of this and also to make an upcoming diff simpler. ok jsing --- diff --git a/lib/libssl/s3_lib.c b/lib/libssl/s3_lib.c index 7ab6880131d..9ac02f3e1b7 100644 --- a/lib/libssl/s3_lib.c +++ b/lib/libssl/s3_lib.c @@ -1,4 +1,4 @@ -/* $OpenBSD: s3_lib.c,v 1.246 2023/07/08 16:40:13 beck Exp $ */ +/* $OpenBSD: s3_lib.c,v 1.247 2023/11/29 13:29:34 tb Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -1414,7 +1414,7 @@ ssl3_get_cipher(unsigned int u) } const SSL_CIPHER * -ssl3_get_cipher_by_id(unsigned int id) +ssl3_get_cipher_by_id(unsigned long id) { const SSL_CIPHER *cp; SSL_CIPHER c; diff --git a/lib/libssl/ssl_local.h b/lib/libssl/ssl_local.h index a3007eae2c5..3c5fb204b00 100644 --- a/lib/libssl/ssl_local.h +++ b/lib/libssl/ssl_local.h @@ -1,4 +1,4 @@ -/* $OpenBSD: ssl_local.h,v 1.9 2023/11/25 12:05:08 tb Exp $ */ +/* $OpenBSD: ssl_local.h,v 1.10 2023/11/29 13:29:34 tb Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -1344,7 +1344,7 @@ int ssl3_get_req_cert_types(SSL *s, CBB *cbb); int ssl3_get_message(SSL *s, int st1, int stn, int mt, long max); int ssl3_num_ciphers(void); const SSL_CIPHER *ssl3_get_cipher(unsigned int u); -const SSL_CIPHER *ssl3_get_cipher_by_id(unsigned int id); +const SSL_CIPHER *ssl3_get_cipher_by_id(unsigned long id); const SSL_CIPHER *ssl3_get_cipher_by_value(uint16_t value); uint16_t ssl3_cipher_get_value(const SSL_CIPHER *c); int ssl3_renegotiate(SSL *ssl);