From 76421b77581e4da35fd6bf29936087f28082b51e Mon Sep 17 00:00:00 2001 From: tb <> Date: Sat, 2 Jul 2022 09:33:20 +0000 Subject: Make tls1_ec_curve_id2nid() return explicit NID_undef instead of 0 on error and adjust the only caller that didn't check for NID_undef already. ok beck jsing --- src/lib/libssl/t1_lib.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/lib/libssl/t1_lib.c') diff --git a/src/lib/libssl/t1_lib.c b/src/lib/libssl/t1_lib.c index 105acf1cbf..1dca30529d 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.188 2022/06/30 16:18:03 tb Exp $ */ +/* $OpenBSD: t1_lib.c,v 1.189 2022/07/02 09:33:20 tb Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -341,10 +341,10 @@ tls1_ec_curve_id2nid(const uint16_t curve_id) /* ECC curves from draft-ietf-tls-ecc-12.txt (Oct. 17, 2005) */ if ((curve_id < 1) || ((unsigned int)curve_id > sizeof(nid_list) / sizeof(nid_list[0]))) - return 0; + return NID_undef; if ((curve = &nid_list[curve_id]) == NULL) - return 0; + return NID_undef; return curve->nid; } -- cgit v1.2.3-55-g6feb