diff options
| author | tb <> | 2024-08-28 07:18:55 +0000 |
|---|---|---|
| committer | tb <> | 2024-08-28 07:18:55 +0000 |
| commit | a0eb283827e17931e83ffe4f14ff064a32be2efc (patch) | |
| tree | 1a86e9bed2317406ca708b58e8456b6439db59da /src | |
| parent | 075c048b99cefdce1245c13c4aa449b28ce8366c (diff) | |
| download | openbsd-a0eb283827e17931e83ffe4f14ff064a32be2efc.tar.gz openbsd-a0eb283827e17931e83ffe4f14ff064a32be2efc.tar.bz2 openbsd-a0eb283827e17931e83ffe4f14ff064a32be2efc.zip | |
Document X509_get0_signature_info()
Loosely based on the OpenSSL 1.1 documentation but extended quite a bit to
explain what the flags mean and what info they do (and do not) convey. With
the usual valuable feedback from jmc.
ok jmc
Diffstat (limited to 'src')
| -rw-r--r-- | src/lib/libcrypto/man/X509_get0_signature.3 | 73 |
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 |
| 171 | does. | 180 | does. |
| 172 | .Pp | 181 | .Pp |
| 182 | .Fn X509_get_signature_info | ||
| 183 | retrieves information about the signature of certificate | ||
| 184 | .Fa x . | ||
| 185 | The NID of the digest algorithm is written to | ||
| 186 | .Pf * Fa md_nid , | ||
| 187 | the public key algorithm to | ||
| 188 | .Pf * Fa pkey_nid , | ||
| 189 | the effective security bits to | ||
| 190 | .Pf * Fa security_bits , | ||
| 191 | and flag details to | ||
| 192 | .Pf * Fa flags . | ||
| 193 | Any of the output parameters can be set to | ||
| 194 | .Dv NULL | ||
| 195 | if the information is not required. | ||
| 196 | If | ||
| 197 | .Fa flags | ||
| 198 | is not a | ||
| 199 | .Dv NULL | ||
| 200 | pointer, | ||
| 201 | .Pf * Fa flags | ||
| 202 | is set to the bitwise OR of: | ||
| 203 | .Bl -tag -width 1n -offset 3n | ||
| 204 | .It Dv X509_SIG_INFO_VALID | ||
| 205 | No error occurred. | ||
| 206 | This flag is set if | ||
| 207 | .Fn X509_get_signature_info | ||
| 208 | returns 1. | ||
| 209 | .It Dv X509_SIG_INFO_TLS | ||
| 210 | The signature algorithm is appropriate for use in TLS. | ||
| 211 | For a supported EdDSA algorithm (in LibreSSL this is Ed25519) | ||
| 212 | this flag is always set. | ||
| 213 | For an RSASSA-PSS PSS algorithm this flag is set if | ||
| 214 | the parameters are DER encoded, | ||
| 215 | the digest algorithm is one of SHA256, SHA384, or SHA512, | ||
| 216 | the same digest algorithm is used in the mask generation function, | ||
| 217 | and the salt length is equal to the digest algorithm's output length. | ||
| 218 | For all other signature algorithms this flag is set if the digest | ||
| 219 | algorithm is one of SHA1, SHA256, SHA384, or SHA512. | ||
| 220 | .El | ||
| 221 | .Pp | ||
| 222 | .Fn X509_get_signature_info | ||
| 223 | returns 1 on success and 0 on failure. | ||
| 224 | Failure conditions include unsupported signature algorithms, | ||
| 225 | certificate parsing errors and memory allocation failure. | ||
| 226 | .Pp | ||
| 173 | These functions provide lower level access to the signature | 227 | These functions provide lower level access to the signature |
| 174 | for cases where an application wishes to analyse or generate a | 228 | for cases where an application wishes to analyse or generate a |
| 175 | signature in a form where | 229 | signature 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 |
| 212 | first appeared in LibreSSL 3.7.1 and has been available since | 266 | first 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 | ||
| 270 | first appeared in OpenSSL 1.1.1 and has been available since | ||
| 271 | .Ox 7.6 . | ||
| 272 | .Sh CAVEATS | ||
| 273 | The security bits returned by | ||
| 274 | .Fn X509_get_signature_info | ||
| 275 | refer to the information available from the certificate signature | ||
| 276 | (such as the signing digest). | ||
| 277 | In some cases the actual security of the signature is smaller | ||
| 278 | because the signing key is less secure. | ||
| 279 | For example in a certificate signed using SHA512 | ||
| 280 | and a 1024-bit RSA key. | ||
