| 1 |
.\" -*- mode: troff; coding: utf-8 -*- |
| 2 |
.\" Automatically generated by Pod::Man 5.0102 (Pod::Simple 3.45) |
| 3 |
.\" |
| 4 |
.\" Standard preamble: |
| 5 |
.\" ======================================================================== |
| 6 |
.de Sp \" Vertical space (when we can't use .PP) |
| 7 |
.if t .sp .5v |
| 8 |
.if n .sp |
| 9 |
.. |
| 10 |
.de Vb \" Begin verbatim text |
| 11 |
.ft CW |
| 12 |
.nf |
| 13 |
.ne \\$1 |
| 14 |
.. |
| 15 |
.de Ve \" End verbatim text |
| 16 |
.ft R |
| 17 |
.fi |
| 18 |
.. |
| 19 |
.\" \*(C` and \*(C' are quotes in nroff, nothing in troff, for use with C<>. |
| 20 |
.ie n \{\ |
| 21 |
. ds C` "" |
| 22 |
. ds C' "" |
| 23 |
'br\} |
| 24 |
.el\{\ |
| 25 |
. ds C` |
| 26 |
. ds C' |
| 27 |
'br\} |
| 28 |
.\" |
| 29 |
.\" Escape single quotes in literal strings from groff's Unicode transform. |
| 30 |
.ie \n(.g .ds Aq \(aq |
| 31 |
.el .ds Aq ' |
| 32 |
.\" |
| 33 |
.\" If the F register is >0, we'll generate index entries on stderr for |
| 34 |
.\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index |
| 35 |
.\" entries marked with X<> in POD. Of course, you'll have to process the |
| 36 |
.\" output yourself in some meaningful fashion. |
| 37 |
.\" |
| 38 |
.\" Avoid warning from groff about undefined register 'F'. |
| 39 |
.de IX |
| 40 |
.. |
| 41 |
.nr rF 0 |
| 42 |
.if \n(.g .if rF .nr rF 1 |
| 43 |
.if (\n(rF:(\n(.g==0)) \{\ |
| 44 |
. if \nF \{\ |
| 45 |
. de IX |
| 46 |
. tm Index:\\$1\t\\n%\t"\\$2" |
| 47 |
.. |
| 48 |
. if !\nF==2 \{\ |
| 49 |
. nr % 0 |
| 50 |
. nr F 2 |
| 51 |
. \} |
| 52 |
. \} |
| 53 |
.\} |
| 54 |
.rr rF |
| 55 |
.\" ======================================================================== |
| 56 |
.\" |
| 57 |
.IX Title "SSL_CTX_SET1_SIGALGS 3SSL" |
| 58 |
.TH SSL_CTX_SET1_SIGALGS 3SSL 2026-04-07 3.6.2 OpenSSL |
| 59 |
.\" For nroff, turn off justification. Always turn off hyphenation; it makes |
| 60 |
.\" way too many mistakes in technical documents. |
| 61 |
.if n .ad l |
| 62 |
.nh |
| 63 |
.SH NAME |
| 64 |
SSL_CTX_set1_sigalgs, SSL_set1_sigalgs, SSL_CTX_set1_sigalgs_list, |
| 65 |
SSL_set1_sigalgs_list, SSL_CTX_set1_client_sigalgs, |
| 66 |
SSL_set1_client_sigalgs, SSL_CTX_set1_client_sigalgs_list, |
| 67 |
SSL_set1_client_sigalgs_list \- set supported signature algorithms |
| 68 |
.SH SYNOPSIS |
| 69 |
.IX Header "SYNOPSIS" |
| 70 |
.Vb 1 |
| 71 |
\& #include <openssl/ssl.h> |
| 72 |
\& |
| 73 |
\& long SSL_CTX_set1_sigalgs(SSL_CTX *ctx, const int *slist, long slistlen); |
| 74 |
\& long SSL_set1_sigalgs(SSL *ssl, const int *slist, long slistlen); |
| 75 |
\& long SSL_CTX_set1_sigalgs_list(SSL_CTX *ctx, const char *str); |
| 76 |
\& long SSL_set1_sigalgs_list(SSL *ssl, const char *str); |
| 77 |
\& |
| 78 |
\& long SSL_CTX_set1_client_sigalgs(SSL_CTX *ctx, const int *slist, long slistlen); |
| 79 |
\& long SSL_set1_client_sigalgs(SSL *ssl, const int *slist, long slistlen); |
| 80 |
\& long SSL_CTX_set1_client_sigalgs_list(SSL_CTX *ctx, const char *str); |
| 81 |
\& long SSL_set1_client_sigalgs_list(SSL *ssl, const char *str); |
| 82 |
.Ve |
| 83 |
.SH DESCRIPTION |
| 84 |
.IX Header "DESCRIPTION" |
| 85 |
\&\fBSSL_CTX_set1_sigalgs()\fR and \fBSSL_set1_sigalgs()\fR set the supported signature |
| 86 |
algorithms for \fBctx\fR or \fBssl\fR. The array \fBslist\fR of length \fBslistlen\fR |
| 87 |
must consist of pairs of NIDs corresponding to digest and public key |
| 88 |
algorithms. |
| 89 |
.PP |
| 90 |
\&\fBSSL_CTX_set1_sigalgs_list()\fR and \fBSSL_set1_sigalgs_list()\fR set the supported |
| 91 |
signature algorithms for \fBctx\fR or \fBssl\fR. The \fBstr\fR parameter |
| 92 |
must be a null terminated string consisting of a colon separated list of |
| 93 |
elements, where each element is either a combination of a public key |
| 94 |
algorithm and a digest separated by \fB+\fR, or a TLS 1.3\-style named |
| 95 |
SignatureScheme such as rsa_pss_pss_sha256. |
| 96 |
Signature scheme names and public key algorithm names (but not the digest |
| 97 |
names) in the \fBalgorithm+hash\fR form are case-insensitive. |
| 98 |
If a list entry is preceded with the \f(CW\*(C`?\*(C'\fR character, it will be ignored if an |
| 99 |
implementation is missing. |
| 100 |
.PP |
| 101 |
\&\fBSSL_CTX_set1_client_sigalgs()\fR, \fBSSL_set1_client_sigalgs()\fR, |
| 102 |
\&\fBSSL_CTX_set1_client_sigalgs_list()\fR and \fBSSL_set1_client_sigalgs_list()\fR set |
| 103 |
signature algorithms related to client authentication, otherwise they are |
| 104 |
identical to \fBSSL_CTX_set1_sigalgs()\fR, \fBSSL_set1_sigalgs()\fR, |
| 105 |
\&\fBSSL_CTX_set1_sigalgs_list()\fR and \fBSSL_set1_sigalgs_list()\fR. |
| 106 |
.PP |
| 107 |
All these functions are implemented as macros. The signature algorithm |
| 108 |
parameter (integer array or string) is not freed: the application should |
| 109 |
free it, if necessary. |
| 110 |
.SH NOTES |
| 111 |
.IX Header "NOTES" |
| 112 |
If an application wishes to allow the setting of signature algorithms |
| 113 |
as one of many user configurable options it should consider using the more |
| 114 |
flexible SSL_CONF API instead. |
| 115 |
.PP |
| 116 |
The signature algorithms set by a client are used directly in the supported |
| 117 |
signature algorithm in the client hello message. |
| 118 |
.PP |
| 119 |
The supported signature algorithms set by a server are not sent to the |
| 120 |
client but are used to determine the set of shared signature algorithms |
| 121 |
and (if server preferences are set with SSL_OP_SERVER_PREFERENCE) their |
| 122 |
order. |
| 123 |
.PP |
| 124 |
The client authentication signature algorithms set by a server are sent |
| 125 |
in a certificate request message if client authentication is enabled, |
| 126 |
otherwise they are unused. |
| 127 |
.PP |
| 128 |
Similarly client authentication signature algorithms set by a client are |
| 129 |
used to determined the set of client authentication shared signature |
| 130 |
algorithms. |
| 131 |
.PP |
| 132 |
Signature algorithms will neither be advertised nor used if the security level |
| 133 |
prohibits them (for example SHA1 if the security level is 4 or more). |
| 134 |
.PP |
| 135 |
Currently the NID_md5, NID_sha1, NID_sha224, NID_sha256, NID_sha384 and |
| 136 |
NID_sha512 digest NIDs are supported and the public key algorithm NIDs |
| 137 |
EVP_PKEY_RSA, EVP_PKEY_RSA_PSS, EVP_PKEY_DSA and EVP_PKEY_EC. |
| 138 |
.PP |
| 139 |
The short or long name values for digests can be used in a string (for |
| 140 |
example "MD5", "SHA1", "SHA224", "SHA256", "SHA384", "SHA512") and |
| 141 |
the public key algorithm strings "RSA", "RSA-PSS", "DSA" or "ECDSA". |
| 142 |
.PP |
| 143 |
The TLS 1.3 signature scheme names (such as "rsa_pss_pss_sha256") can also |
| 144 |
be used with the \fB_list\fR forms of the API. |
| 145 |
.PP |
| 146 |
The use of MD5 as a digest is strongly discouraged due to security weaknesses. |
| 147 |
.SH "RETURN VALUES" |
| 148 |
.IX Header "RETURN VALUES" |
| 149 |
All these functions return 1 for success and 0 for failure. |
| 150 |
.SH EXAMPLES |
| 151 |
.IX Header "EXAMPLES" |
| 152 |
Set supported signature algorithms to SHA256 with ECDSA and SHA256 with RSA |
| 153 |
using an array: |
| 154 |
.PP |
| 155 |
.Vb 1 |
| 156 |
\& const int slist[] = {NID_sha256, EVP_PKEY_EC, NID_sha256, EVP_PKEY_RSA}; |
| 157 |
\& |
| 158 |
\& SSL_CTX_set1_sigalgs(ctx, slist, 4); |
| 159 |
.Ve |
| 160 |
.PP |
| 161 |
Set supported signature algorithms to SHA256 with ECDSA and SHA256 with RSA |
| 162 |
using a string: |
| 163 |
.PP |
| 164 |
.Vb 1 |
| 165 |
\& SSL_CTX_set1_sigalgs_list(ctx, "ECDSA+SHA256:RSA+SHA256"); |
| 166 |
.Ve |
| 167 |
.SH "SEE ALSO" |
| 168 |
.IX Header "SEE ALSO" |
| 169 |
\&\fBssl\fR\|(7), \fBSSL_get_shared_sigalgs\fR\|(3), |
| 170 |
\&\fBSSL_CONF_CTX_new\fR\|(3) |
| 171 |
.SH HISTORY |
| 172 |
.IX Header "HISTORY" |
| 173 |
Support for ignoring unknown signature algorithms in |
| 174 |
\&\fBSSL_CTX_set1_sigalgs_list()\fR, \fBSSL_set1_sigalgs_list()\fR, |
| 175 |
\&\fBSSL_CTX_set1_client_sigalgs_list()\fR and \fBSSL_set1_client_sigalgs_list()\fR |
| 176 |
was added in OpenSSL 3.3. |
| 177 |
.SH COPYRIGHT |
| 178 |
.IX Header "COPYRIGHT" |
| 179 |
Copyright 2015\-2025 The OpenSSL Project Authors. All Rights Reserved. |
| 180 |
.PP |
| 181 |
Licensed under the Apache License 2.0 (the "License"). You may not use |
| 182 |
this file except in compliance with the License. You can obtain a copy |
| 183 |
in the file LICENSE in the source distribution or at |
| 184 |
<https://www.openssl.org/source/license.html>. |