diff options
author | tb <> | 2022-07-02 16:00:12 +0000 |
---|---|---|
committer | tb <> | 2022-07-02 16:00:12 +0000 |
commit | f7fed9455632a5807e76bd3a28879f5a87857c53 (patch) | |
tree | 9d374c62eeff973ee0b7721a87b5f66c56832f1e /src/lib/libssl/tls_key_share.c | |
parent | c757fe9bb6c16f47a415034b69dda698116160ba (diff) | |
download | openbsd-f7fed9455632a5807e76bd3a28879f5a87857c53.tar.gz openbsd-f7fed9455632a5807e76bd3a28879f5a87857c53.tar.bz2 openbsd-f7fed9455632a5807e76bd3a28879f5a87857c53.zip |
Rename uses 'curve' to 'group' and rework tls1 group API.
This reworks various tls1_ curve APIs to indicate success via a boolean
return value and move the output to an out parameter. This makes the
caller code easier and more consistent.
Based on a suggestion by jsing
ok jsing
Diffstat (limited to '')
-rw-r--r-- | src/lib/libssl/tls_key_share.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/lib/libssl/tls_key_share.c b/src/lib/libssl/tls_key_share.c index c170f08649..048db25bd5 100644 --- a/src/lib/libssl/tls_key_share.c +++ b/src/lib/libssl/tls_key_share.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: tls_key_share.c,v 1.6 2022/07/02 09:33:20 tb Exp $ */ | 1 | /* $OpenBSD: tls_key_share.c,v 1.7 2022/07/02 16:00:12 tb Exp $ */ |
2 | /* | 2 | /* |
3 | * Copyright (c) 2020, 2021 Joel Sing <jsing@openbsd.org> | 3 | * Copyright (c) 2020, 2021 Joel Sing <jsing@openbsd.org> |
4 | * | 4 | * |
@@ -61,7 +61,7 @@ tls_key_share_new(uint16_t group_id) | |||
61 | { | 61 | { |
62 | int nid; | 62 | int nid; |
63 | 63 | ||
64 | if ((nid = tls1_ec_curve_id2nid(group_id)) == NID_undef) | 64 | if (!tls1_ec_group_id2nid(group_id, &nid)) |
65 | return NULL; | 65 | return NULL; |
66 | 66 | ||
67 | return tls_key_share_new_internal(nid, group_id); | 67 | return tls_key_share_new_internal(nid, group_id); |
@@ -73,7 +73,7 @@ tls_key_share_new_nid(int nid) | |||
73 | uint16_t group_id = 0; | 73 | uint16_t group_id = 0; |
74 | 74 | ||
75 | if (nid != NID_dhKeyAgreement) { | 75 | if (nid != NID_dhKeyAgreement) { |
76 | if ((group_id = tls1_ec_nid2curve_id(nid)) == 0) | 76 | if (!tls1_ec_nid2group_id(nid, &group_id)) |
77 | return NULL; | 77 | return NULL; |
78 | } | 78 | } |
79 | 79 | ||