Expand SSL_CTX_set_default_verify_paths() documentation
[openssl.git] / doc / ssl / SSL_CTX_set1_curves.pod
1 =pod
2
3 =head1 NAME
4
5 SSL_CTX_set1_curves, SSL_CTX_set1_curves_list, SSL_set1_curves,
6 SSL_set1_curves_list, SSL_get1_curves, SSL_get_shared_curve - EC supported curve functions
7
8 =head1 SYNOPSIS
9
10  #include <openssl/ssl.h>
11
12  int SSL_CTX_set1_curves(SSL_CTX *ctx, int *clist, int clistlen);
13  int SSL_CTX_set1_curves_list(SSL_CTX *ctx, char *list);
14
15  int SSL_set1_curves(SSL *ssl, int *clist, int clistlen);
16  int SSL_set1_curves_list(SSL *ssl, char *list);
17
18  int SSL_get1_curves(SSL *ssl, int *curves);
19  int SSL_get_shared_curve(SSL *s, int n);
20
21 =head1 DESCRIPTION
22
23 SSL_CTX_set1_curves() sets the supported curves for B<ctx> to B<clistlen>
24 curves in the array B<clist>. The array consist of all NIDs of curves in
25 preference order. For a TLS client the curves are used directly in the
26 supported curves extension. For a TLS server the curves are used to
27 determine the set of shared curves.
28
29 SSL_CTX_set1_curves_list() sets the supported curves for B<ctx> to
30 string B<list>. The string is a colon separated list of curve NIDs or
31 names, for example "P-521:P-384:P-256".
32
33 SSL_set1_curves() and SSL_set1_curves_list() are similar except they set
34 supported curves for the SSL structure B<ssl>.
35
36 SSL_get1_curves() returns the set of supported curves sent by a client
37 in the supported curves extension. It returns the total number of
38 supported curves. The B<curves> parameter can be B<NULL> to simply
39 return the number of curves for memory allocation purposes. The
40 B<curves> array is in the form of a set of curve NIDs in preference
41 order. It can return zero if the client did not send a supported curves
42 extension.
43
44 SSL_get_shared_curve() returns shared curve B<n> for a server-side
45 SSL B<ssl>. If B<n> is -1 then the total number of shared curves is
46 returned, which may be zero. Other than for diagnostic purposes,
47 most applications will only be interested in the first shared curve
48 so B<n> is normally set to zero. If the value B<n> is out of range,
49 NID_undef is returned.
50
51 All these functions are implemented as macros.
52
53 =head1 NOTES
54
55 If an application wishes to make use of several of these functions for
56 configuration purposes either on a command line or in a file it should
57 consider using the SSL_CONF interface instead of manually parsing options.
58
59 =head1 RETURN VALUES
60
61 SSL_CTX_set1_curves(), SSL_CTX_set1_curves_list(), SSL_set1_curves() and
62 SSL_set1_curves_list(), return 1 for success and 0 for failure.
63
64 SSL_get1_curves() returns the number of curves, which may be zero.
65
66 SSL_get_shared_curve() returns the NID of shared curve B<n> or NID_undef if there
67 is no shared curve B<n>; or the total number of shared curves if B<n>
68 is -1.
69
70 When called on a client B<ssl>, SSL_get_shared_curve() has no meaning and
71 returns -1.
72
73 =head1 SEE ALSO
74
75 L<SSL_CTX_add_extra_chain_cert(3)>
76
77 =head1 HISTORY
78
79 These functions were first added to OpenSSL 1.0.2.
80
81 =head1 COPYRIGHT
82
83 Copyright 2013-2016 The OpenSSL Project Authors. All Rights Reserved.
84
85 Licensed under the OpenSSL license (the "License").  You may not use
86 this file except in compliance with the License.  You can obtain a copy
87 in the file LICENSE in the source distribution or at
88 L<https://www.openssl.org/source/license.html>.
89
90 =cut