SSL_CTX_set1_sigalgs.3ossl 6.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181
  1. .\" -*- mode: troff; coding: utf-8 -*-
  2. .\" Automatically generated by Pod::Man 5.01 (Pod::Simple 3.43)
  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 3ossl"
  58. .TH SSL_CTX_SET1_SIGALGS 3ossl 2025-01-17 3.4.0 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. If a list entry is preceded
  96. with the \f(CW\*(C`?\*(C'\fR character, it will be ignored if an implementation is missing.
  97. .PP
  98. \&\fBSSL_CTX_set1_client_sigalgs()\fR, \fBSSL_set1_client_sigalgs()\fR,
  99. \&\fBSSL_CTX_set1_client_sigalgs_list()\fR and \fBSSL_set1_client_sigalgs_list()\fR set
  100. signature algorithms related to client authentication, otherwise they are
  101. identical to \fBSSL_CTX_set1_sigalgs()\fR, \fBSSL_set1_sigalgs()\fR,
  102. \&\fBSSL_CTX_set1_sigalgs_list()\fR and \fBSSL_set1_sigalgs_list()\fR.
  103. .PP
  104. All these functions are implemented as macros. The signature algorithm
  105. parameter (integer array or string) is not freed: the application should
  106. free it, if necessary.
  107. .SH NOTES
  108. .IX Header "NOTES"
  109. If an application wishes to allow the setting of signature algorithms
  110. as one of many user configurable options it should consider using the more
  111. flexible SSL_CONF API instead.
  112. .PP
  113. The signature algorithms set by a client are used directly in the supported
  114. signature algorithm in the client hello message.
  115. .PP
  116. The supported signature algorithms set by a server are not sent to the
  117. client but are used to determine the set of shared signature algorithms
  118. and (if server preferences are set with SSL_OP_CIPHER_SERVER_PREFERENCE)
  119. their order.
  120. .PP
  121. The client authentication signature algorithms set by a server are sent
  122. in a certificate request message if client authentication is enabled,
  123. otherwise they are unused.
  124. .PP
  125. Similarly client authentication signature algorithms set by a client are
  126. used to determined the set of client authentication shared signature
  127. algorithms.
  128. .PP
  129. Signature algorithms will neither be advertised nor used if the security level
  130. prohibits them (for example SHA1 if the security level is 4 or more).
  131. .PP
  132. Currently the NID_md5, NID_sha1, NID_sha224, NID_sha256, NID_sha384 and
  133. NID_sha512 digest NIDs are supported and the public key algorithm NIDs
  134. EVP_PKEY_RSA, EVP_PKEY_RSA_PSS, EVP_PKEY_DSA and EVP_PKEY_EC.
  135. .PP
  136. The short or long name values for digests can be used in a string (for
  137. example "MD5", "SHA1", "SHA224", "SHA256", "SHA384", "SHA512") and
  138. the public key algorithm strings "RSA", "RSA-PSS", "DSA" or "ECDSA".
  139. .PP
  140. The TLS 1.3 signature scheme names (such as "rsa_pss_pss_sha256") can also
  141. be used with the \fB_list\fR forms of the API.
  142. .PP
  143. The use of MD5 as a digest is strongly discouraged due to security weaknesses.
  144. .SH "RETURN VALUES"
  145. .IX Header "RETURN VALUES"
  146. All these functions return 1 for success and 0 for failure.
  147. .SH EXAMPLES
  148. .IX Header "EXAMPLES"
  149. Set supported signature algorithms to SHA256 with ECDSA and SHA256 with RSA
  150. using an array:
  151. .PP
  152. .Vb 1
  153. \& const int slist[] = {NID_sha256, EVP_PKEY_EC, NID_sha256, EVP_PKEY_RSA};
  154. \&
  155. \& SSL_CTX_set1_sigalgs(ctx, slist, 4);
  156. .Ve
  157. .PP
  158. Set supported signature algorithms to SHA256 with ECDSA and SHA256 with RSA
  159. using a string:
  160. .PP
  161. .Vb 1
  162. \& SSL_CTX_set1_sigalgs_list(ctx, "ECDSA+SHA256:RSA+SHA256");
  163. .Ve
  164. .SH "SEE ALSO"
  165. .IX Header "SEE ALSO"
  166. \&\fBssl\fR\|(7), \fBSSL_get_shared_sigalgs\fR\|(3),
  167. \&\fBSSL_CONF_CTX_new\fR\|(3)
  168. .SH HISTORY
  169. .IX Header "HISTORY"
  170. Support for ignoring unknown signature algorithms in
  171. \&\fBSSL_CTX_set1_sigalgs_list()\fR, \fBSSL_set1_sigalgs_list()\fR,
  172. \&\fBSSL_CTX_set1_client_sigalgs_list()\fR and \fBSSL_set1_client_sigalgs_list()\fR
  173. was added in OpenSSL 3.3.
  174. .SH COPYRIGHT
  175. .IX Header "COPYRIGHT"
  176. Copyright 2015\-2024 The OpenSSL Project Authors. All Rights Reserved.
  177. .PP
  178. Licensed under the Apache License 2.0 (the "License"). You may not use
  179. this file except in compliance with the License. You can obtain a copy
  180. in the file LICENSE in the source distribution or at
  181. <https://www.openssl.org/source/license.html>.