]> git.ipfire.org Git - thirdparty/openssl.git/blame - doc/man3/SSL_CTX_set1_sigalgs.pod
Copyright year updates
[thirdparty/openssl.git] / doc / man3 / 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
a6419d1e
BK
33must be a null terminated string consisting of a colon separated list of
34elements, where each element is either a combination of a public key
35algorithm and a digest separated by B<+>, or a TLS 1.3-style named
cd2cdb61
TM
36SignatureScheme such as rsa_pss_pss_sha256. If a list entry is preceded
37with the C<?> character, it will be ignored if an implementation is missing.
38
14815a99
DSH
39
40SSL_CTX_set1_client_sigalgs(), SSL_set1_client_sigalgs(),
41SSL_CTX_set1_client_sigalgs_list() and SSL_set1_client_sigalgs_list() set
42signature algorithms related to client authentication, otherwise they are
43identical to SSL_CTX_set1_sigalgs(), SSL_set1_sigalgs(),
44SSL_CTX_set1_sigalgs_list() and SSL_set1_sigalgs_list().
45
46All these functions are implemented as macros. The signature algorithm
47parameter (integer array or string) is not freed: the application should
48free it, if necessary.
49
50=head1 NOTES
51
52If an application wishes to allow the setting of signature algorithms
53as one of many user configurable options it should consider using the more
54flexible SSL_CONF API instead.
55
56The signature algorithms set by a client are used directly in the supported
57signature algorithm in the client hello message.
58
59The supported signature algorithms set by a server are not sent to the
60client but are used to determine the set of shared signature algorithms
61and (if server preferences are set with SSL_OP_CIPHER_SERVER_PREFERENCE)
62their order.
63
64The client authentication signature algorithms set by a server are sent
65in a certificate request message if client authentication is enabled,
66otherwise they are unused.
67
68Similarly client authentication signature algorithms set by a client are
69used to determined the set of client authentication shared signature
70algorithms.
71
72Signature algorithms will neither be advertised nor used if the security level
73prohibits them (for example SHA1 if the security level is 4 or more).
74
75Currently the NID_md5, NID_sha1, NID_sha224, NID_sha256, NID_sha384 and
76NID_sha512 digest NIDs are supported and the public key algorithm NIDs
a593cffe 77EVP_PKEY_RSA, EVP_PKEY_RSA_PSS, EVP_PKEY_DSA and EVP_PKEY_EC.
14815a99
DSH
78
79The short or long name values for digests can be used in a string (for
80example "MD5", "SHA1", "SHA224", "SHA256", "SHA384", "SHA512") and
a593cffe
DSH
81the public key algorithm strings "RSA", "RSA-PSS", "DSA" or "ECDSA".
82
cf8e9233 83The TLS 1.3 signature scheme names (such as "rsa_pss_pss_sha256") can also
a6419d1e 84be used with the B<_list> forms of the API.
14815a99
DSH
85
86The use of MD5 as a digest is strongly discouraged due to security weaknesses.
87
4564e77a
PY
88=head1 RETURN VALUES
89
90All these functions return 1 for success and 0 for failure.
91
14815a99
DSH
92=head1 EXAMPLES
93
0d4fb843 94Set supported signature algorithms to SHA256 with ECDSA and SHA256 with RSA
14815a99
DSH
95using an array:
96
2947af32 97 const int slist[] = {NID_sha256, EVP_PKEY_EC, NID_sha256, EVP_PKEY_RSA};
14815a99 98
2947af32 99 SSL_CTX_set1_sigalgs(ctx, slist, 4);
14815a99 100
0d4fb843 101Set supported signature algorithms to SHA256 with ECDSA and SHA256 with RSA
14815a99
DSH
102using a string:
103
2947af32 104 SSL_CTX_set1_sigalgs_list(ctx, "ECDSA+SHA256:RSA+SHA256");
14815a99 105
14815a99
DSH
106=head1 SEE ALSO
107
b97fdb57 108L<ssl(7)>, L<SSL_get_shared_sigalgs(3)>,
9b86974e 109L<SSL_CONF_CTX_new(3)>
14815a99 110
cd2cdb61
TM
111=head1 HISTORY
112
113Support for ignoring unknown signature algorithms in
114SSL_CTX_set1_sigalgs_list(), SSL_set1_sigalgs_list(),
115SSL_CTX_set1_client_sigalgs_list() and SSL_set1_client_sigalgs_list()
116was added in OpenSSL 3.3.
117
e2f92610
RS
118=head1 COPYRIGHT
119
b6461792 120Copyright 2015-2024 The OpenSSL Project Authors. All Rights Reserved.
e2f92610 121
4746f25a 122Licensed under the Apache License 2.0 (the "License"). You may not use
e2f92610
RS
123this file except in compliance with the License. You can obtain a copy
124in the file LICENSE in the source distribution or at
125L<https://www.openssl.org/source/license.html>.
126
127=cut