1SSL_CTX_SET1_CURVES(3) OpenSSL SSL_CTX_SET1_CURVES(3)
2
3
4
6 SSL_CTX_set1_groups, SSL_CTX_set1_groups_list, SSL_set1_groups,
7 SSL_set1_groups_list, SSL_get1_groups, SSL_get_shared_group,
8 SSL_CTX_set1_curves, SSL_CTX_set1_curves_list, SSL_set1_curves,
9 SSL_set1_curves_list, SSL_get1_curves, SSL_get_shared_curve - EC
10 supported curve functions
11
13 #include <openssl/ssl.h>
14
15 int SSL_CTX_set1_groups(SSL_CTX *ctx, int *glist, int glistlen);
16 int SSL_CTX_set1_groups_list(SSL_CTX *ctx, char *list);
17
18 int SSL_set1_groups(SSL *ssl, int *glist, int glistlen);
19 int SSL_set1_groups_list(SSL *ssl, char *list);
20
21 int SSL_get1_groups(SSL *ssl, int *groups);
22 int SSL_get_shared_group(SSL *s, int n);
23
24 int SSL_CTX_set1_curves(SSL_CTX *ctx, int *clist, int clistlen);
25 int SSL_CTX_set1_curves_list(SSL_CTX *ctx, char *list);
26
27 int SSL_set1_curves(SSL *ssl, int *clist, int clistlen);
28 int SSL_set1_curves_list(SSL *ssl, char *list);
29
30 int SSL_get1_curves(SSL *ssl, int *curves);
31 int SSL_get_shared_curve(SSL *s, int n);
32
34 SSL_CTX_set1_groups() sets the supported groups for ctx to glistlen
35 groups in the array glist. The array consist of all NIDs of groups in
36 preference order. For a TLS client the groups are used directly in the
37 supported groups extension. For a TLS server the groups are used to
38 determine the set of shared groups.
39
40 SSL_CTX_set1_groups_list() sets the supported groups for ctx to string
41 list. The string is a colon separated list of group NIDs or names, for
42 example "P-521:P-384:P-256".
43
44 SSL_set1_groups() and SSL_set1_groups_list() are similar except they
45 set supported groups for the SSL structure ssl.
46
47 SSL_get1_groups() returns the set of supported groups sent by a client
48 in the supported groups extension. It returns the total number of
49 supported groups. The groups parameter can be NULL to simply return the
50 number of groups for memory allocation purposes. The groups array is in
51 the form of a set of group NIDs in preference order. It can return zero
52 if the client did not send a supported groups extension.
53
54 SSL_get_shared_group() returns shared group n for a server-side SSL
55 ssl. If n is -1 then the total number of shared groups is returned,
56 which may be zero. Other than for diagnostic purposes, most
57 applications will only be interested in the first shared group so n is
58 normally set to zero. If the value n is out of range, NID_undef is
59 returned.
60
61 All these functions are implemented as macros.
62
63 The curve functions are synonyms for the equivalently named group
64 functions and are identical in every respect. They exist because, prior
65 to TLS1.3, there was only the concept of supported curves. In TLS1.3
66 this was renamed to supported groups, and extended to include Diffie
67 Hellman groups. The group functions should be used in preference.
68
70 If an application wishes to make use of several of these functions for
71 configuration purposes either on a command line or in a file it should
72 consider using the SSL_CONF interface instead of manually parsing
73 options.
74
76 SSL_CTX_set1_groups(), SSL_CTX_set1_groups_list(), SSL_set1_groups()
77 and SSL_set1_groups_list(), return 1 for success and 0 for failure.
78
79 SSL_get1_groups() returns the number of groups, which may be zero.
80
81 SSL_get_shared_group() returns the NID of shared group n or NID_undef
82 if there is no shared group n; or the total number of shared groups if
83 n is -1.
84
85 When called on a client ssl, SSL_get_shared_group() has no meaning and
86 returns -1.
87
89 SSL_CTX_add_extra_chain_cert(3)
90
92 The curve functions were first added to OpenSSL 1.0.2. The equivalent
93 group functions were first added to OpenSSL 1.1.1.
94
96 Copyright 2013-2016 The OpenSSL Project Authors. All Rights Reserved.
97
98 Licensed under the OpenSSL license (the "License"). You may not use
99 this file except in compliance with the License. You can obtain a copy
100 in the file LICENSE in the source distribution or at
101 <https://www.openssl.org/source/license.html>.
102
103
104
1051.1.1 2018-09-11 SSL_CTX_SET1_CURVES(3)