diff options
Diffstat (limited to 'src/lib/libcrypto/man/EVP_MD_nid.3')
| -rw-r--r-- | src/lib/libcrypto/man/EVP_MD_nid.3 | 315 |
1 files changed, 0 insertions, 315 deletions
diff --git a/src/lib/libcrypto/man/EVP_MD_nid.3 b/src/lib/libcrypto/man/EVP_MD_nid.3 deleted file mode 100644 index 15806091de..0000000000 --- a/src/lib/libcrypto/man/EVP_MD_nid.3 +++ /dev/null | |||
| @@ -1,315 +0,0 @@ | |||
| 1 | .\" $OpenBSD: EVP_MD_nid.3,v 1.4 2024/03/05 17:21:40 tb Exp $ | ||
| 2 | .\" full merge up to: OpenSSL man3/EVP_DigestInit.pod | ||
| 3 | .\" 24a535ea Sep 22 13:14:20 2020 +0100 | ||
| 4 | .\" | ||
| 5 | .\" This file is a derived work. | ||
| 6 | .\" The changes are covered by the following Copyright and license: | ||
| 7 | .\" | ||
| 8 | .\" Copyright (c) 2023 Ingo Schwarze <schwarze@openbsd.org> | ||
| 9 | .\" | ||
| 10 | .\" Permission to use, copy, modify, and distribute this software for any | ||
| 11 | .\" purpose with or without fee is hereby granted, provided that the above | ||
| 12 | .\" copyright notice and this permission notice appear in all copies. | ||
| 13 | .\" | ||
| 14 | .\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES | ||
| 15 | .\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF | ||
| 16 | .\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR | ||
| 17 | .\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES | ||
| 18 | .\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN | ||
| 19 | .\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF | ||
| 20 | .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. | ||
| 21 | .\" | ||
| 22 | .\" The original file was written by Dr. Stephen Henson <steve@openssl.org> | ||
| 23 | .\" and Antoine Salon <asalon@vmware.com>. | ||
| 24 | .\" Copyright (c) 2000, 2012, 2019 The OpenSSL Project. | ||
| 25 | .\" All rights reserved. | ||
| 26 | .\" | ||
| 27 | .\" Redistribution and use in source and binary forms, with or without | ||
| 28 | .\" modification, are permitted provided that the following conditions | ||
| 29 | .\" are met: | ||
| 30 | .\" | ||
| 31 | .\" 1. Redistributions of source code must retain the above copyright | ||
| 32 | .\" notice, this list of conditions and the following disclaimer. | ||
| 33 | .\" | ||
| 34 | .\" 2. Redistributions in binary form must reproduce the above copyright | ||
| 35 | .\" notice, this list of conditions and the following disclaimer in | ||
| 36 | .\" the documentation and/or other materials provided with the | ||
| 37 | .\" distribution. | ||
| 38 | .\" | ||
| 39 | .\" 3. All advertising materials mentioning features or use of this | ||
| 40 | .\" software must display the following acknowledgment: | ||
| 41 | .\" "This product includes software developed by the OpenSSL Project | ||
| 42 | .\" for use in the OpenSSL Toolkit. (http://www.openssl.org/)" | ||
| 43 | .\" | ||
| 44 | .\" 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to | ||
| 45 | .\" endorse or promote products derived from this software without | ||
| 46 | .\" prior written permission. For written permission, please contact | ||
| 47 | .\" openssl-core@openssl.org. | ||
| 48 | .\" | ||
| 49 | .\" 5. Products derived from this software may not be called "OpenSSL" | ||
| 50 | .\" nor may "OpenSSL" appear in their names without prior written | ||
| 51 | .\" permission of the OpenSSL Project. | ||
| 52 | .\" | ||
| 53 | .\" 6. Redistributions of any form whatsoever must retain the following | ||
| 54 | .\" acknowledgment: | ||
| 55 | .\" "This product includes software developed by the OpenSSL Project | ||
| 56 | .\" for use in the OpenSSL Toolkit (http://www.openssl.org/)" | ||
| 57 | .\" | ||
| 58 | .\" THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY | ||
| 59 | .\" EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | ||
| 60 | .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR | ||
| 61 | .\" PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR | ||
| 62 | .\" ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | ||
| 63 | .\" SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT | ||
| 64 | .\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | ||
| 65 | .\" LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | ||
| 66 | .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, | ||
| 67 | .\" STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | ||
| 68 | .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED | ||
| 69 | .\" OF THE POSSIBILITY OF SUCH DAMAGE. | ||
| 70 | .\" | ||
| 71 | .Dd $Mdocdate: March 5 2024 $ | ||
| 72 | .Dt EVP_MD_NID 3 | ||
| 73 | .Os | ||
| 74 | .Sh NAME | ||
| 75 | .Nm EVP_MD_nid , | ||
| 76 | .Nm EVP_MD_type , | ||
| 77 | .Nm EVP_MD_CTX_type , | ||
| 78 | .Nm EVP_MD_name , | ||
| 79 | .Nm EVP_MD_size , | ||
| 80 | .Nm EVP_MD_CTX_size , | ||
| 81 | .Nm EVP_MD_block_size , | ||
| 82 | .Nm EVP_MD_CTX_block_size , | ||
| 83 | .Nm EVP_MD_flags , | ||
| 84 | .Nm EVP_MD_pkey_type | ||
| 85 | .Nd inspect EVP_MD objects | ||
| 86 | .Sh SYNOPSIS | ||
| 87 | .In openssl/evp.h | ||
| 88 | .Ft int | ||
| 89 | .Fo EVP_MD_nid | ||
| 90 | .Fa "const EVP_MD *md" | ||
| 91 | .Fc | ||
| 92 | .Ft int | ||
| 93 | .Fo EVP_MD_type | ||
| 94 | .Fa "const EVP_MD *md" | ||
| 95 | .Fc | ||
| 96 | .Ft int | ||
| 97 | .Fo EVP_MD_CTX_type | ||
| 98 | .Fa "const EVP_MD_CTX *ctx" | ||
| 99 | .Fc | ||
| 100 | .Ft const char * | ||
| 101 | .Fo EVP_MD_name | ||
| 102 | .Fa "const EVP_MD *md" | ||
| 103 | .Fc | ||
| 104 | .Ft int | ||
| 105 | .Fo EVP_MD_size | ||
| 106 | .Fa "const EVP_MD *md" | ||
| 107 | .Fc | ||
| 108 | .Ft int | ||
| 109 | .Fo EVP_MD_CTX_size | ||
| 110 | .Fa "const EVP_MD_CTX *ctx" | ||
| 111 | .Fc | ||
| 112 | .Ft int | ||
| 113 | .Fo EVP_MD_block_size | ||
| 114 | .Fa "const EVP_MD *md" | ||
| 115 | .Fc | ||
| 116 | .Ft int | ||
| 117 | .Fo EVP_MD_CTX_block_size | ||
| 118 | .Fa "const EVP_MD_CTX *ctx" | ||
| 119 | .Fc | ||
| 120 | .Ft unsigned long | ||
| 121 | .Fo EVP_MD_flags | ||
| 122 | .Fa "const EVP_MD *md" | ||
| 123 | .Fc | ||
| 124 | .Ft int | ||
| 125 | .Fo EVP_MD_pkey_type | ||
| 126 | .Fa "const EVP_MD *md" | ||
| 127 | .Fc | ||
| 128 | .Sh DESCRIPTION | ||
| 129 | .Fn EVP_MD_nid | ||
| 130 | and | ||
| 131 | .Fn EVP_MD_type | ||
| 132 | are identical and return the numerical identifier (NID) of | ||
| 133 | .Fa md . | ||
| 134 | The NID is an internal value which may or may not have | ||
| 135 | a corresponding ASN.1 OBJECT IDENTIFIER; see | ||
| 136 | .Xr OBJ_nid2obj 3 | ||
| 137 | for details. | ||
| 138 | For example , | ||
| 139 | .Fn EVP_MD_type EVP_sha512() | ||
| 140 | returns | ||
| 141 | .Dv NID_sha512 . | ||
| 142 | .Fn EVP_MD_CTX_type | ||
| 143 | returns the NID of the message digest algorithm that | ||
| 144 | .Fa ctx | ||
| 145 | is configured to use. | ||
| 146 | These functions are normally used when setting ASN.1 OIDs. | ||
| 147 | .Pp | ||
| 148 | .Fn EVP_MD_name | ||
| 149 | converts the NID of | ||
| 150 | .Fa md | ||
| 151 | to its short name with | ||
| 152 | .Xr OBJ_nid2sn 3 . | ||
| 153 | .Pp | ||
| 154 | .Fn EVP_MD_size | ||
| 155 | returns the size in bytes of the message digests (hashes) produced by | ||
| 156 | .Fa md . | ||
| 157 | .Fn EVP_MD_CTX_size | ||
| 158 | return the size of the hashes produced by the message digest algorithm that | ||
| 159 | .Fa ctx | ||
| 160 | is configured to use. | ||
| 161 | .Pp | ||
| 162 | .Fn EVP_MD_block_size | ||
| 163 | returns the block size in bytes of | ||
| 164 | .Fa md . | ||
| 165 | .Fn EVP_MD_CTX_block_size | ||
| 166 | returns the block size of the message digest algorithm that | ||
| 167 | .Fa ctx | ||
| 168 | is configured to use. | ||
| 169 | .Pp | ||
| 170 | .Fn EVP_MD_flags | ||
| 171 | returns the message digest flags used by | ||
| 172 | .Fa md . | ||
| 173 | Be careful to not confuse these flags with the unrelated | ||
| 174 | message digest context flags that can be inspected with | ||
| 175 | .Xr EVP_MD_CTX_test_flags 3 . | ||
| 176 | The available flags are: | ||
| 177 | .Bl -tag -width Ds | ||
| 178 | .It Dv EVP_MD_FLAG_DIGALGID_NULL | ||
| 179 | The parameters in a | ||
| 180 | .Vt DigestAlgorithmIdentifier | ||
| 181 | are encoded using an explicit ASN.1 | ||
| 182 | .Dv NULL | ||
| 183 | rather than omitting them. | ||
| 184 | This is the default, which means that it takes effect for | ||
| 185 | .Vt EVP_MD | ||
| 186 | objects that do not have | ||
| 187 | .Dv EVP_MD_FLAG_DIGALGID_ABSENT | ||
| 188 | set. | ||
| 189 | .It Dv EVP_MD_FLAG_DIGALGID_ABSENT | ||
| 190 | The parameters in a | ||
| 191 | .Vt DigestAlgorithmIdentifier | ||
| 192 | are omitted from the ASN.1 encoding. | ||
| 193 | This is used by the | ||
| 194 | .Vt EVP_MD | ||
| 195 | objects documented in the manual page | ||
| 196 | .Xr EVP_sha3_224 3 | ||
| 197 | and by the objects returned from | ||
| 198 | .Xr EVP_sha512 3 , | ||
| 199 | .Xr EVP_sha512_256 3 , | ||
| 200 | .Xr EVP_sha512_224 3 , | ||
| 201 | .Xr EVP_sha384 3 , | ||
| 202 | .Xr EVP_sha256 3 , | ||
| 203 | .Xr EVP_sha224 3 , | ||
| 204 | .Xr EVP_sha1 3 , | ||
| 205 | and | ||
| 206 | .Xr EVP_sm3 3 . | ||
| 207 | .It Dv EVP_MD_FLAG_DIGALGID_CUSTOM | ||
| 208 | This flag is reserved for user-defined | ||
| 209 | .Vt EVP_MD | ||
| 210 | objects supporting custom | ||
| 211 | .Vt DigestAlgorithmIdentifier | ||
| 212 | handling via | ||
| 213 | .Xr EVP_MD_CTX_ctrl 3 , | ||
| 214 | but actually, it is ignored by both LibreSSL and OpenSSL | ||
| 215 | and such user-defined behaviour is not supported by the libraries. | ||
| 216 | .It Dv EVP_MD_FLAG_FIPS | ||
| 217 | Mark the digest method as suitable for FIPS mode. | ||
| 218 | This flag is ignored by both LibreSSL and OpenSSL. | ||
| 219 | .It Dv EVP_MD_FLAG_ONESHOT | ||
| 220 | Intended to indicate that the digest method can only handle one block | ||
| 221 | of input, but actually, this flag is ignored by both LibreSSL and OpenSSL. | ||
| 222 | .El | ||
| 223 | .Pp | ||
| 224 | .Fn EVP_MD_pkey_type | ||
| 225 | returns the NID of the public key signing algorithm associated with this | ||
| 226 | digest. | ||
| 227 | For example, | ||
| 228 | .Xr EVP_sha512 3 | ||
| 229 | is associated with RSA, so this returns | ||
| 230 | .Dv NID_sha512WithRSAEncryption . | ||
| 231 | Since digests and signature algorithms are no longer linked, this | ||
| 232 | function is only retained for compatibility reasons. | ||
| 233 | .Pp | ||
| 234 | .Fn EVP_MD_nid , | ||
| 235 | .Fn EVP_MD_CTX_type , | ||
| 236 | .Fn EVP_MD_name , | ||
| 237 | .Fn EVP_MD_CTX_size , | ||
| 238 | and | ||
| 239 | .Fn EVP_MD_CTX_block_size | ||
| 240 | are implemented as macros. | ||
| 241 | .Sh RETURN VALUES | ||
| 242 | .Fn EVP_MD_nid , | ||
| 243 | .Fn EVP_MD_type , | ||
| 244 | .Fn EVP_MD_CTX_type , | ||
| 245 | and | ||
| 246 | .Fn EVP_MD_pkey_type | ||
| 247 | return the NID of the corresponding OBJECT IDENTIFIER or | ||
| 248 | .Dv NID_undef | ||
| 249 | if none exists. | ||
| 250 | .Pp | ||
| 251 | .Fn EVP_MD_name | ||
| 252 | returns a pointer to a string | ||
| 253 | that is owned by an internal library object or | ||
| 254 | .Dv NULL | ||
| 255 | if the NID is neither built into the library nor added to the global | ||
| 256 | object table by one of the functions documented in the manual page | ||
| 257 | .Xr OBJ_create 3 , | ||
| 258 | or if the object does not contain a short name. | ||
| 259 | .Pp | ||
| 260 | .Fn EVP_MD_size , | ||
| 261 | .Fn EVP_MD_CTX_size , | ||
| 262 | .Fn EVP_MD_block_size , | ||
| 263 | and | ||
| 264 | .Fn EVP_MD_CTX_block_size | ||
| 265 | return the digest or block size in bytes. | ||
| 266 | .Sh SEE ALSO | ||
| 267 | .Xr evp 3 , | ||
| 268 | .Xr EVP_DigestInit 3 , | ||
| 269 | .Xr EVP_MD_CTX_ctrl 3 , | ||
| 270 | .Xr OBJ_nid2obj 3 | ||
| 271 | .Sh STANDARDS | ||
| 272 | RFC 5754: Using SHA2 Algorithms with Cryptographic Message Syntax | ||
| 273 | .Bl -dash -compact -offset indent | ||
| 274 | .It | ||
| 275 | section 2: Message Digest Algorithms | ||
| 276 | .El | ||
| 277 | .Sh HISTORY | ||
| 278 | .Fn EVP_MD_size | ||
| 279 | first appeared in SSLeay 0.6.6, | ||
| 280 | .Fn EVP_MD_CTX_size | ||
| 281 | and | ||
| 282 | .Fn EVP_MD_CTX_type | ||
| 283 | in SSLeay 0.8.0, | ||
| 284 | .Fn EVP_MD_type | ||
| 285 | and | ||
| 286 | .Fn EVP_MD_pkey_type | ||
| 287 | in SSLeay 0.8.1, and | ||
| 288 | .Fn EVP_MD_block_size | ||
| 289 | and | ||
| 290 | .Fn EVP_MD_CTX_block_size | ||
| 291 | in SSLeay 0.9.0. | ||
| 292 | All these functions have been available since | ||
| 293 | .Ox 2.4 . | ||
| 294 | .Pp | ||
| 295 | .Fn EVP_MD_nid | ||
| 296 | and | ||
| 297 | .Fn EVP_MD_name | ||
| 298 | first appeared in OpenSSL 0.9.7 and have been available since | ||
| 299 | .Ox 3.2 . | ||
| 300 | .Pp | ||
| 301 | .Fn EVP_MD_flags | ||
| 302 | first appeared in OpenSSL 1.0.0 | ||
| 303 | and has been available since | ||
| 304 | .Ox 4.9 . | ||
| 305 | .Sh CAVEATS | ||
| 306 | The behaviour of the functions taking an | ||
| 307 | .Vt EVP_MD_CTX | ||
| 308 | argument is undefined if they are called on a | ||
| 309 | .Fa ctx | ||
| 310 | that has no message digest configured yet, | ||
| 311 | for example one freshly returned from | ||
| 312 | .Xr EVP_MD_CTX_new 3 . | ||
| 313 | In that case, the program may for example be terminated by a | ||
| 314 | .Dv NULL | ||
| 315 | pointer access. | ||
