From 3b5a06eefa2fcfd186e11c10be3804fa0eab61e6 Mon Sep 17 00:00:00 2001 From: tb Date: Sat, 2 Jul 2022 16:01:56 +0000 Subject: [PATCH] Adjust to new tls1_ec_nid2group_id API. --- regress/lib/libssl/tlsext/tlsexttest.c | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/regress/lib/libssl/tlsext/tlsexttest.c b/regress/lib/libssl/tlsext/tlsexttest.c index 8166b883b87..53620617832 100644 --- a/regress/lib/libssl/tlsext/tlsexttest.c +++ b/regress/lib/libssl/tlsext/tlsexttest.c @@ -1,4 +1,4 @@ -/* $OpenBSD: tlsexttest.c,v 1.64 2022/06/29 17:39:21 beck Exp $ */ +/* $OpenBSD: tlsexttest.c,v 1.65 2022/07/02 16:01:56 tb Exp $ */ /* * Copyright (c) 2017 Joel Sing * Copyright (c) 2017 Doug Hogan @@ -479,7 +479,7 @@ static uint8_t tlsext_supportedgroups_client_default[] = { }; static uint16_t tlsext_supportedgroups_client_secp384r1_val[] = { - 0x0018 /* tls1_ec_nid2curve_id(NID_secp384r1) */ + 0x0018 /* tls1_ec_nid2group_id(NID_secp384r1) */ }; static uint8_t tlsext_supportedgroups_client_secp384r1[] = { 0x00, 0x02, @@ -488,8 +488,8 @@ static uint8_t tlsext_supportedgroups_client_secp384r1[] = { /* Example from RFC 4492 section 5.1.1 */ static uint16_t tlsext_supportedgroups_client_nistp192and224_val[] = { - 0x0013, /* tls1_ec_nid2curve_id(NID_X9_62_prime192v1) */ - 0x0015 /* tls1_ec_nid2curve_id(NID_secp224r1) */ + 0x0013, /* tls1_ec_nid2group_id(NID_X9_62_prime192v1) */ + 0x0015 /* tls1_ec_nid2group_id(NID_secp224r1) */ }; static uint8_t tlsext_supportedgroups_client_nistp192and224[] = { 0x00, 0x04, @@ -562,7 +562,9 @@ test_tlsext_supportedgroups_client(void) FAIL("client could not malloc\n"); goto err; } - ssl->session->tlsext_supportedgroups[0] = tls1_ec_nid2curve_id(NID_secp384r1); + if (!tls1_ec_nid2group_id(NID_secp384r1, + &ssl->session->tlsext_supportedgroups[0])) + goto err; ssl->session->tlsext_supportedgroups_length = 1; if (!tlsext_supportedgroups_client_needs(ssl, SSL_TLSEXT_MSG_CH)) { @@ -650,8 +652,12 @@ test_tlsext_supportedgroups_client(void) FAIL("client could not malloc\n"); goto err; } - ssl->internal->tlsext_supportedgroups[0] = tls1_ec_nid2curve_id(NID_X9_62_prime192v1); - ssl->internal->tlsext_supportedgroups[1] = tls1_ec_nid2curve_id(NID_secp224r1); + if (!tls1_ec_nid2group_id(NID_X9_62_prime192v1, + &ssl->internal->tlsext_supportedgroups[0])) + goto err; + if (!tls1_ec_nid2group_id(NID_secp224r1, + &ssl->internal->tlsext_supportedgroups[1])) + goto err; ssl->internal->tlsext_supportedgroups_length = 2; if (!tlsext_supportedgroups_client_needs(ssl, SSL_TLSEXT_MSG_CH)) { -- 2.20.1