From c39b79d2d45df9ada86387a886c6d32487328f86 Mon Sep 17 00:00:00 2001 From: tb <> Date: Sat, 18 Jan 2025 13:11:58 +0000 Subject: Remove two pointless NULL checks The only caller ensures that the EC_KEY is not NULL and passes the address of comp_id on its stack, so neither will be NULL. --- src/lib/libssl/t1_lib.c | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) (limited to 'src') diff --git a/src/lib/libssl/t1_lib.c b/src/lib/libssl/t1_lib.c index c889e04180..1fe3c1cde4 100644 --- a/src/lib/libssl/t1_lib.c +++ b/src/lib/libssl/t1_lib.c @@ -1,4 +1,4 @@ -/* $OpenBSD: t1_lib.c,v 1.200 2025/01/18 13:07:47 tb Exp $ */ +/* $OpenBSD: t1_lib.c,v 1.201 2025/01/18 13:11:58 tb Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -631,10 +631,6 @@ tls1_set_ec_id(uint16_t *group_id, uint8_t *comp_id, EC_KEY *ec) const EC_GROUP *grp; int nid; - if (ec == NULL) - return (0); - - /* Determine whether the group is defined over a prime field. */ if ((grp = EC_KEY_get0_group(ec)) == NULL) return (0); @@ -643,9 +639,6 @@ tls1_set_ec_id(uint16_t *group_id, uint8_t *comp_id, EC_KEY *ec) if (!tls1_ec_nid2group_id(nid, group_id)) return (0); - if (comp_id == NULL) - return (1); - /* Specify the compression identifier. */ if (EC_KEY_get0_public_key(ec) == NULL) return (0); -- cgit v1.2.3-55-g6feb