]> git.ipfire.org Git - thirdparty/openssl.git/blame - doc/ssl/SSL_CTX_set1_sigalgs.pod
GH601: Various spelling fixes.
[thirdparty/openssl.git] / doc / ssl / SSL_CTX_set1_sigalgs.pod
CommitLineData
14815a99
DSH
1=pod
2
3=head1 NAME
4
5SSL_CTX_set1_sigalgs, SSL_set1_sigalgs, SSL_CTX_set1_sigalgs_list,
6SSL_set1_sigalgs_list, SSL_CTX_set1_client_sigalgs,
7SSL_set1_client_sigalgs, SSL_CTX_set1_client_sigalgs_list,
8SSL_set1_client_sigalgs_list - set supported signature algorithms
9
10=head1 SYNOPSIS
11
12 #include <openssl/ssl.h>
13
14 long SSL_CTX_set1_sigalgs(SSL_CTX *ctx, const int *slist, long slistlen);
15 long SSL_set1_sigalgs(SSL *ssl, const int *slist, long slistlen);
16 long SSL_CTX_set1_sigalgs_list(SSL_CTX *ctx, const char *str);
17 long SSL_set1_sigalgs_list(SSL *ssl, const char *str);
18
19 long SSL_CTX_set1_client_sigalgs(SSL_CTX *ctx, const int *slist, long slistlen);
20 long SSL_set1_client_sigalgs(SSL *ssl, const int *slist, long slistlen);
21 long SSL_CTX_set1_client_sigalgs_list(SSL_CTX *ctx, const char *str);
22 long SSL_set1_client_sigalgs_list(SSL *ssl, const char *str);
23
24=head1 DESCRIPTION
25
26SSL_CTX_set1_sigalgs() and SSL_set1_sigalgs() set the supported signature
27algorithms for B<ctx> or B<ssl>. The array B<slist> of length B<slistlen>
28must consist of pairs of NIDs corresponding to digest and public key
29algorithms.
30
31SSL_CTX_set1_sigalgs_list() and SSL_set1_sigalgs_list() set the supported
32signature algorithms for B<ctx> or B<ssl>. The B<str> parameter
33must be a null terminated string consisting or a colon separated list of
34public key algorithms and digests separated by B<+>.
35
36SSL_CTX_set1_client_sigalgs(), SSL_set1_client_sigalgs(),
37SSL_CTX_set1_client_sigalgs_list() and SSL_set1_client_sigalgs_list() set
38signature algorithms related to client authentication, otherwise they are
39identical to SSL_CTX_set1_sigalgs(), SSL_set1_sigalgs(),
40SSL_CTX_set1_sigalgs_list() and SSL_set1_sigalgs_list().
41
42All these functions are implemented as macros. The signature algorithm
43parameter (integer array or string) is not freed: the application should
44free it, if necessary.
45
46=head1 NOTES
47
48If an application wishes to allow the setting of signature algorithms
49as one of many user configurable options it should consider using the more
50flexible SSL_CONF API instead.
51
52The signature algorithms set by a client are used directly in the supported
53signature algorithm in the client hello message.
54
55The supported signature algorithms set by a server are not sent to the
56client but are used to determine the set of shared signature algorithms
57and (if server preferences are set with SSL_OP_CIPHER_SERVER_PREFERENCE)
58their order.
59
60The client authentication signature algorithms set by a server are sent
61in a certificate request message if client authentication is enabled,
62otherwise they are unused.
63
64Similarly client authentication signature algorithms set by a client are
65used to determined the set of client authentication shared signature
66algorithms.
67
68Signature algorithms will neither be advertised nor used if the security level
69prohibits them (for example SHA1 if the security level is 4 or more).
70
71Currently the NID_md5, NID_sha1, NID_sha224, NID_sha256, NID_sha384 and
72NID_sha512 digest NIDs are supported and the public key algorithm NIDs
73EVP_PKEY_RSA, EVP_PKEY_DSA and EVP_PKEY_EC.
74
75The short or long name values for digests can be used in a string (for
76example "MD5", "SHA1", "SHA224", "SHA256", "SHA384", "SHA512") and
77the public key algorithm strings "RSA", "DSA" or "ECDSA".
78
79The use of MD5 as a digest is strongly discouraged due to security weaknesses.
80
81=head1 EXAMPLES
82
0d4fb843 83Set supported signature algorithms to SHA256 with ECDSA and SHA256 with RSA
14815a99
DSH
84using an array:
85
86 const int slist[] = {NID_sha256, EVP_PKEY_EC, NID_sha256, EVP_PKEY_RSA};
87
88 SSL_CTX_set1_sigalgs(ctx, slist, 4);
89
0d4fb843 90Set supported signature algorithms to SHA256 with ECDSA and SHA256 with RSA
14815a99
DSH
91using a string:
92
93 SSL_CTX_set1_sigalgs_list(ctx, "ECDSA+SHA256:RSA+SHA256");
94
95=head1 RETURN VALUES
96
97All these functions return 1 for success and 0 for failure.
98
99=head1 SEE ALSO
100
9b86974e
RS
101L<ssl(3)>, L<SSL_get_shared_sigalgs(3)>,
102L<SSL_CONF_CTX_new(3)>
14815a99
DSH
103
104=cut