1SSL_CTX_set1_curves(3)              OpenSSL             SSL_CTX_set1_curves(3)
2
3
4

NAME

6       SSL_CTX_set1_curves, SSL_CTX_set1_curves_list, SSL_set1_curves,
7       SSL_set1_curves_list, SSL_get1_curves, SSL_get_shared_curve,
8       SSL_CTX_set_ecdh_auto, SSL_set_ecdh_auto - EC supported curve functions
9

SYNOPSIS

11        #include <openssl/ssl.h>
12
13        int SSL_CTX_set1_curves(SSL_CTX *ctx, int *clist, int clistlen);
14        int SSL_CTX_set1_curves_list(SSL_CTX *ctx, char *list);
15
16        int SSL_set1_curves(SSL *ssl, int *clist, int clistlen);
17        int SSL_set1_curves_list(SSL *ssl, char *list);
18
19        int SSL_get1_curves(SSL *ssl, int *curves);
20        int SSL_get_shared_curve(SSL *s, int n);
21
22        int SSL_CTX_set_ecdh_auto(SSL_CTX *ctx, int onoff);
23        int SSL_set_ecdh_auto(SSL *s, int onoff);
24

DESCRIPTION

26       SSL_CTX_set1_curves() sets the supported curves for ctx to clistlen
27       curves in the array clist. The array consist of all NIDs of curves in
28       preference order. For a TLS client the curves are used directly in the
29       supported curves extension. For a TLS server the curves are used to
30       determine the set of shared curves.
31
32       SSL_CTX_set1_curves_list() sets the supported curves for ctx to string
33       list. The string is a colon separated list of curve NIDs or names, for
34       example "P-521:P-384:P-256".
35
36       SSL_set1_curves() and SSL_set1_curves_list() are similar except they
37       set supported curves for the SSL structure ssl.
38
39       SSL_get1_curves() returns the set of supported curves sent by a client
40       in the supported curves extension. It returns the total number of
41       supported curves. The curves parameter can be NULL to simply return the
42       number of curves for memory allocation purposes. The curves array is in
43       the form of a set of curve NIDs in preference order. It can return zero
44       if the client did not send a supported curves extension.
45
46       SSL_get_shared_curve() returns shared curve n for a server-side SSL
47       ssl. If n is -1 then the total number of shared curves is returned,
48       which may be zero. Other than for diagnostic purposes, most
49       applications will only be interested in the first shared curve so n is
50       normally set to zero. If the value n is out of range, NID_undef is
51       returned.
52
53       SSL_CTX_set_ecdh_auto() and SSL_set_ecdh_auto() set automatic curve
54       selection for server ctx or ssl to onoff. If onoff is 1 then the
55       highest preference curve is automatically used for ECDH temporary keys
56       used during key exchange.
57
58       All these functions are implemented as macros.
59

NOTES

61       If an application wishes to make use of several of these functions for
62       configuration purposes either on a command line or in a file it should
63       consider using the SSL_CONF interface instead of manually parsing
64       options.
65
66       The functions SSL_CTX_set_ecdh_auto() and SSL_set_ecdh_auto() can be
67       used to make a server always choose the most appropriate curve for a
68       client. If set it will override any temporary ECDH parameters set by a
69       server. Previous versions of OpenSSL could effectively only use a
70       single ECDH curve set using a function such as SSL_CTX_set_ecdh_tmp().
71       Newer applications should just call:
72
73        SSL_CTX_set_ecdh_auto(ctx, 1);
74
75       and they will automatically support ECDH using the most appropriate
76       shared curve.
77

RETURN VALUES

79       SSL_CTX_set1_curves(), SSL_CTX_set1_curves_list(), SSL_set1_curves(),
80       SSL_set1_curves_list(), SSL_CTX_set_ecdh_auto() and SSL_set_ecdh_auto()
81       return 1 for success and 0 for failure.
82
83       SSL_get1_curves() returns the number of curves, which may be zero.
84
85       SSL_get_shared_curve() returns the NID of shared curve n or NID_undef
86       if there is no shared curve n; or the total number of shared curves if
87       n is -1.
88
89       When called on a client ssl, SSL_get_shared_curve() has no meaning and
90       returns -1.
91

SEE ALSO

93       SSL_CTX_add_extra_chain_cert(3)
94

HISTORY

96       These functions were first added to OpenSSL 1.0.2.
97
98
99
1001.0.2k                            2017-01-26            SSL_CTX_set1_curves(3)
Impressum