and adjust the only caller that didn't check for NID_undef already.
ok beck jsing
-/* $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.
*
/* 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;
}
-/* $OpenBSD: tls_key_share.c,v 1.5 2022/06/29 08:27:52 tb Exp $ */
+/* $OpenBSD: tls_key_share.c,v 1.6 2022/07/02 09:33:20 tb Exp $ */
/*
* Copyright (c) 2020, 2021 Joel Sing <jsing@openbsd.org>
*
{
int nid;
- if ((nid = tls1_ec_curve_id2nid(group_id)) == 0)
+ if ((nid = tls1_ec_curve_id2nid(group_id)) == NID_undef)
return NULL;
return tls_key_share_new_internal(nid, group_id);