summaryrefslogtreecommitdiff
path: root/src/lib/libssl/t1_lib.c
diff options
context:
space:
mode:
authortb <>2022-07-02 09:33:20 +0000
committertb <>2022-07-02 09:33:20 +0000
commit29270d384af1cc9921774254341a0c98808e979f (patch)
treec30392451df26d059989760fbf6967867a200997 /src/lib/libssl/t1_lib.c
parent77f0574b7c2b37a3c137d20f6ad687362c8da9a0 (diff)
downloadopenbsd-29270d384af1cc9921774254341a0c98808e979f.tar.gz
openbsd-29270d384af1cc9921774254341a0c98808e979f.tar.bz2
openbsd-29270d384af1cc9921774254341a0c98808e979f.zip
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
Diffstat (limited to 'src/lib/libssl/t1_lib.c')
-rw-r--r--src/lib/libssl/t1_lib.c6
1 files changed, 3 insertions, 3 deletions
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 @@
1/* $OpenBSD: t1_lib.c,v 1.188 2022/06/30 16:18:03 tb Exp $ */ 1/* $OpenBSD: t1_lib.c,v 1.189 2022/07/02 09:33:20 tb Exp $ */
2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) 2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
3 * All rights reserved. 3 * All rights reserved.
4 * 4 *
@@ -341,10 +341,10 @@ tls1_ec_curve_id2nid(const uint16_t curve_id)
341 /* ECC curves from draft-ietf-tls-ecc-12.txt (Oct. 17, 2005) */ 341 /* ECC curves from draft-ietf-tls-ecc-12.txt (Oct. 17, 2005) */
342 if ((curve_id < 1) || 342 if ((curve_id < 1) ||
343 ((unsigned int)curve_id > sizeof(nid_list) / sizeof(nid_list[0]))) 343 ((unsigned int)curve_id > sizeof(nid_list) / sizeof(nid_list[0])))
344 return 0; 344 return NID_undef;
345 345
346 if ((curve = &nid_list[curve_id]) == NULL) 346 if ((curve = &nid_list[curve_id]) == NULL)
347 return 0; 347 return NID_undef;
348 348
349 return curve->nid; 349 return curve->nid;
350} 350}