summaryrefslogtreecommitdiff
path: root/src/lib
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/libcrypto/man/X509_get0_signature.373
1 files changed, 70 insertions, 3 deletions
diff --git a/src/lib/libcrypto/man/X509_get0_signature.3 b/src/lib/libcrypto/man/X509_get0_signature.3
index f3ad3982a2..dc3be2c70a 100644
--- a/src/lib/libcrypto/man/X509_get0_signature.3
+++ b/src/lib/libcrypto/man/X509_get0_signature.3
@@ -1,4 +1,4 @@
1.\" $OpenBSD: X509_get0_signature.3,v 1.8 2023/03/16 12:01:47 job Exp $ 1.\" $OpenBSD: X509_get0_signature.3,v 1.9 2024/08/28 07:18:55 tb Exp $
2.\" selective merge up to: 2.\" selective merge up to:
3.\" OpenSSL man3/X509_get0_signature 2f7a2520 Apr 25 17:28:08 2017 +0100 3.\" OpenSSL man3/X509_get0_signature 2f7a2520 Apr 25 17:28:08 2017 +0100
4.\" 4.\"
@@ -66,7 +66,7 @@
66.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED 66.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
67.\" OF THE POSSIBILITY OF SUCH DAMAGE. 67.\" OF THE POSSIBILITY OF SUCH DAMAGE.
68.\" 68.\"
69.Dd $Mdocdate: March 16 2023 $ 69.Dd $Mdocdate: August 28 2024 $
70.Dt X509_GET0_SIGNATURE 3 70.Dt X509_GET0_SIGNATURE 3
71.Os 71.Os
72.Sh NAME 72.Sh NAME
@@ -78,7 +78,8 @@
78.Nm X509_get_signature_type , 78.Nm X509_get_signature_type ,
79.Nm X509_get_signature_nid , 79.Nm X509_get_signature_nid ,
80.Nm X509_REQ_get_signature_nid , 80.Nm X509_REQ_get_signature_nid ,
81.Nm X509_CRL_get_signature_nid 81.Nm X509_CRL_get_signature_nid ,
82.Nm X509_get_signature_info
82.Nd signature information 83.Nd signature information
83.Sh SYNOPSIS 84.Sh SYNOPSIS
84.In openssl/x509.h 85.In openssl/x509.h
@@ -124,6 +125,14 @@
124.Fo X509_CRL_get_signature_nid 125.Fo X509_CRL_get_signature_nid
125.Fa "const X509_CRL *crl" 126.Fa "const X509_CRL *crl"
126.Fc 127.Fc
128.Ft int
129.Fo X509_get_signature_info
130.Fa "X509 *x"
131.Fa "int *md_nid"
132.Fa "int *pkey_nid"
133.Fa "int *security_bits"
134.Fa "uint32_t *flags"
135.Fc
127.Sh DESCRIPTION 136.Sh DESCRIPTION
128.Fn X509_get0_signature , 137.Fn X509_get0_signature ,
129.Fn X509_REQ_get0_signature , 138.Fn X509_REQ_get0_signature ,
@@ -170,6 +179,51 @@ respectively, just like
170.Xr EVP_PKEY_id 3 179.Xr EVP_PKEY_id 3
171does. 180does.
172.Pp 181.Pp
182.Fn X509_get_signature_info
183retrieves information about the signature of certificate
184.Fa x .
185The NID of the digest algorithm is written to
186.Pf * Fa md_nid ,
187the public key algorithm to
188.Pf * Fa pkey_nid ,
189the effective security bits to
190.Pf * Fa security_bits ,
191and flag details to
192.Pf * Fa flags .
193Any of the output parameters can be set to
194.Dv NULL
195if the information is not required.
196If
197.Fa flags
198is not a
199.Dv NULL
200pointer,
201.Pf * Fa flags
202is set to the bitwise OR of:
203.Bl -tag -width 1n -offset 3n
204.It Dv X509_SIG_INFO_VALID
205No error occurred.
206This flag is set if
207.Fn X509_get_signature_info
208returns 1.
209.It Dv X509_SIG_INFO_TLS
210The signature algorithm is appropriate for use in TLS.
211For a supported EdDSA algorithm (in LibreSSL this is Ed25519)
212this flag is always set.
213For an RSASSA-PSS PSS algorithm this flag is set if
214the parameters are DER encoded,
215the digest algorithm is one of SHA256, SHA384, or SHA512,
216the same digest algorithm is used in the mask generation function,
217and the salt length is equal to the digest algorithm's output length.
218For all other signature algorithms this flag is set if the digest
219algorithm is one of SHA1, SHA256, SHA384, or SHA512.
220.El
221.Pp
222.Fn X509_get_signature_info
223returns 1 on success and 0 on failure.
224Failure conditions include unsupported signature algorithms,
225certificate parsing errors and memory allocation failure.
226.Pp
173These functions provide lower level access to the signature 227These functions provide lower level access to the signature
174for cases where an application wishes to analyse or generate a 228for cases where an application wishes to analyse or generate a
175signature in a form where 229signature in a form where
@@ -211,3 +265,16 @@ All these functions have been available since
211.Fn X509_CRL_get0_tbs_sigalg 265.Fn X509_CRL_get0_tbs_sigalg
212first appeared in LibreSSL 3.7.1 and has been available since 266first appeared in LibreSSL 3.7.1 and has been available since
213.Ox 7.3 . 267.Ox 7.3 .
268.Pp
269.Fn X509_get_signature_info
270first appeared in OpenSSL 1.1.1 and has been available since
271.Ox 7.6 .
272.Sh CAVEATS
273The security bits returned by
274.Fn X509_get_signature_info
275refer to the information available from the certificate signature
276(such as the signing digest).
277In some cases the actual security of the signature is smaller
278because the signing key is less secure.
279For example in a certificate signed using SHA512
280and a 1024-bit RSA key.