diff options
| author | schwarze <> | 2023-09-07 14:22:11 +0000 |
|---|---|---|
| committer | schwarze <> | 2023-09-07 14:22:11 +0000 |
| commit | 707414d3d93bdd0cd2ac8445455cf1f4670bc0c5 (patch) | |
| tree | 95e47c798b76d1bffba9f0c2b5167978aedf8509 /src/lib/libc | |
| parent | 286ab5bd8460a0904d9b9cbc00d222fb2d87df31 (diff) | |
| download | openbsd-707414d3d93bdd0cd2ac8445455cf1f4670bc0c5.tar.gz openbsd-707414d3d93bdd0cd2ac8445455cf1f4670bc0c5.tar.bz2 openbsd-707414d3d93bdd0cd2ac8445455cf1f4670bc0c5.zip | |
Split two new manual pages EVP_MD_nid(3) and EVP_MD_CTX_ctrl(3)
out of the large EVP_DigestInit(3). No text change.
Diffstat (limited to '')
| -rw-r--r-- | src/lib/libcrypto/man/EVP_DigestInit.3 | 319 | ||||
| -rw-r--r-- | src/lib/libcrypto/man/EVP_MD_CTX_ctrl.3 | 274 | ||||
| -rw-r--r-- | src/lib/libcrypto/man/EVP_MD_nid.3 | 213 | ||||
| -rw-r--r-- | src/lib/libcrypto/man/Makefile | 4 | ||||
| -rw-r--r-- | src/lib/libcrypto/man/evp.3 | 6 |
5 files changed, 501 insertions, 315 deletions
diff --git a/src/lib/libcrypto/man/EVP_DigestInit.3 b/src/lib/libcrypto/man/EVP_DigestInit.3 index 54cc771b10..562592b3c8 100644 --- a/src/lib/libcrypto/man/EVP_DigestInit.3 +++ b/src/lib/libcrypto/man/EVP_DigestInit.3 | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | .\" $OpenBSD: EVP_DigestInit.3,v 1.29 2023/08/27 15:33:08 schwarze Exp $ | 1 | .\" $OpenBSD: EVP_DigestInit.3,v 1.30 2023/09/07 14:22:11 schwarze Exp $ |
| 2 | .\" full merge up to: OpenSSL 7f572e95 Dec 2 13:57:04 2015 +0000 | 2 | .\" full merge up to: OpenSSL 7f572e95 Dec 2 13:57:04 2015 +0000 |
| 3 | .\" selective merge up to: OpenSSL 24a535ea Sep 22 13:14:20 2020 +0100 | 3 | .\" selective merge up to: OpenSSL 24a535ea Sep 22 13:14:20 2020 +0100 |
| 4 | .\" | 4 | .\" |
| @@ -70,7 +70,7 @@ | |||
| 70 | .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED | 70 | .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED |
| 71 | .\" OF THE POSSIBILITY OF SUCH DAMAGE. | 71 | .\" OF THE POSSIBILITY OF SUCH DAMAGE. |
| 72 | .\" | 72 | .\" |
| 73 | .Dd $Mdocdate: August 27 2023 $ | 73 | .Dd $Mdocdate: September 7 2023 $ |
| 74 | .Dt EVP_DIGESTINIT 3 | 74 | .Dt EVP_DIGESTINIT 3 |
| 75 | .Os | 75 | .Os |
| 76 | .Sh NAME | 76 | .Sh NAME |
| @@ -81,10 +81,6 @@ | |||
| 81 | .Nm EVP_MD_CTX_create , | 81 | .Nm EVP_MD_CTX_create , |
| 82 | .Nm EVP_MD_CTX_cleanup , | 82 | .Nm EVP_MD_CTX_cleanup , |
| 83 | .Nm EVP_MD_CTX_destroy , | 83 | .Nm EVP_MD_CTX_destroy , |
| 84 | .Nm EVP_MD_CTX_ctrl , | ||
| 85 | .Nm EVP_MD_CTX_set_flags , | ||
| 86 | .Nm EVP_MD_CTX_clear_flags , | ||
| 87 | .Nm EVP_MD_CTX_test_flags , | ||
| 88 | .Nm EVP_DigestInit_ex , | 84 | .Nm EVP_DigestInit_ex , |
| 89 | .Nm EVP_DigestUpdate , | 85 | .Nm EVP_DigestUpdate , |
| 90 | .Nm EVP_DigestFinal_ex , | 86 | .Nm EVP_DigestFinal_ex , |
| @@ -94,18 +90,7 @@ | |||
| 94 | .Nm EVP_DigestFinal , | 90 | .Nm EVP_DigestFinal , |
| 95 | .Nm EVP_MD_CTX_copy , | 91 | .Nm EVP_MD_CTX_copy , |
| 96 | .Nm EVP_MAX_MD_SIZE , | 92 | .Nm EVP_MAX_MD_SIZE , |
| 97 | .Nm EVP_MD_type , | ||
| 98 | .Nm EVP_MD_pkey_type , | ||
| 99 | .Nm EVP_MD_size , | ||
| 100 | .Nm EVP_MD_block_size , | ||
| 101 | .Nm EVP_MD_flags , | ||
| 102 | .Nm EVP_MD_CTX_md , | 93 | .Nm EVP_MD_CTX_md , |
| 103 | .Nm EVP_MD_CTX_size , | ||
| 104 | .Nm EVP_MD_CTX_block_size , | ||
| 105 | .Nm EVP_MD_CTX_type , | ||
| 106 | .Nm EVP_MD_CTX_md_data , | ||
| 107 | .Nm EVP_MD_CTX_pkey_ctx , | ||
| 108 | .Nm EVP_MD_CTX_set_pkey_ctx , | ||
| 109 | .Nm EVP_md_null , | 94 | .Nm EVP_md_null , |
| 110 | .Nm EVP_sha224 , | 95 | .Nm EVP_sha224 , |
| 111 | .Nm EVP_sha256 , | 96 | .Nm EVP_sha256 , |
| @@ -145,28 +130,6 @@ | |||
| 145 | .Fa "EVP_MD_CTX *ctx" | 130 | .Fa "EVP_MD_CTX *ctx" |
| 146 | .Fc | 131 | .Fc |
| 147 | .Ft int | 132 | .Ft int |
| 148 | .Fo EVP_MD_CTX_ctrl | ||
| 149 | .Fa "EVP_MD_CTX *ctx" | ||
| 150 | .Fa "int command" | ||
| 151 | .Fa "int p1" | ||
| 152 | .Fa "void* p2" | ||
| 153 | .Fc | ||
| 154 | .Ft void | ||
| 155 | .Fo EVP_MD_CTX_set_flags | ||
| 156 | .Fa "EVP_MD_CTX *ctx" | ||
| 157 | .Fa "int flags" | ||
| 158 | .Fc | ||
| 159 | .Ft void | ||
| 160 | .Fo EVP_MD_CTX_clear_flags | ||
| 161 | .Fa "EVP_MD_CTX *ctx" | ||
| 162 | .Fa "int flags" | ||
| 163 | .Fc | ||
| 164 | .Ft int | ||
| 165 | .Fo EVP_MD_CTX_test_flags | ||
| 166 | .Fa "const EVP_MD_CTX *ctx" | ||
| 167 | .Fa "int flags" | ||
| 168 | .Fc | ||
| 169 | .Ft int | ||
| 170 | .Fo EVP_DigestInit_ex | 133 | .Fo EVP_DigestInit_ex |
| 171 | .Fa "EVP_MD_CTX *ctx" | 134 | .Fa "EVP_MD_CTX *ctx" |
| 172 | .Fa "const EVP_MD *type" | 135 | .Fa "const EVP_MD *type" |
| @@ -215,55 +178,10 @@ | |||
| 215 | .Fa "EVP_MD_CTX *in" | 178 | .Fa "EVP_MD_CTX *in" |
| 216 | .Fc | 179 | .Fc |
| 217 | .Fd #define EVP_MAX_MD_SIZE 64 /* SHA512 */ | 180 | .Fd #define EVP_MAX_MD_SIZE 64 /* SHA512 */ |
| 218 | .Ft int | ||
| 219 | .Fo EVP_MD_type | ||
| 220 | .Fa "const EVP_MD *md" | ||
| 221 | .Fc | ||
| 222 | .Ft int | ||
| 223 | .Fo EVP_MD_pkey_type | ||
| 224 | .Fa "const EVP_MD *md" | ||
| 225 | .Fc | ||
| 226 | .Ft int | ||
| 227 | .Fo EVP_MD_size | ||
| 228 | .Fa "const EVP_MD *md" | ||
| 229 | .Fc | ||
| 230 | .Ft int | ||
| 231 | .Fo EVP_MD_block_size | ||
| 232 | .Fa "const EVP_MD *md" | ||
| 233 | .Fc | ||
| 234 | .Ft unsigned long | ||
| 235 | .Fo EVP_MD_flags | ||
| 236 | .Fa "const EVP_MD *md" | ||
| 237 | .Fc | ||
| 238 | .Ft const EVP_MD * | 181 | .Ft const EVP_MD * |
| 239 | .Fo EVP_MD_CTX_md | 182 | .Fo EVP_MD_CTX_md |
| 240 | .Fa "const EVP_MD_CTX *ctx" | 183 | .Fa "const EVP_MD_CTX *ctx" |
| 241 | .Fc | 184 | .Fc |
| 242 | .Ft int | ||
| 243 | .Fo EVP_MD_CTX_size | ||
| 244 | .Fa "const EVP_MD_CTX *ctx" | ||
| 245 | .Fc | ||
| 246 | .Ft int | ||
| 247 | .Fo EVP_MD_CTX_block_size | ||
| 248 | .Fa "const EVP_MD_CTX *ctx" | ||
| 249 | .Fc | ||
| 250 | .Ft int | ||
| 251 | .Fo EVP_MD_CTX_type | ||
| 252 | .Fa "const EVP_MD_CTX *ctx" | ||
| 253 | .Fc | ||
| 254 | .Ft void * | ||
| 255 | .Fo EVP_MD_CTX_md_data | ||
| 256 | .Fa "const EVP_MD_CTX *ctx" | ||
| 257 | .Fc | ||
| 258 | .Ft EVP_PKEY_CTX * | ||
| 259 | .Fo EVP_MD_CTX_pkey_ctx | ||
| 260 | .Fa "const EVP_MD_CTX *ctx" | ||
| 261 | .Fc | ||
| 262 | .Ft void | ||
| 263 | .Fo EVP_MD_CTX_set_pkey_ctx | ||
| 264 | .Fa "EVP_MD_CTX *ctx" | ||
| 265 | .Fa "EVP_PKEY_CTX *pctx" | ||
| 266 | .Fc | ||
| 267 | .Ft const EVP_MD * | 185 | .Ft const EVP_MD * |
| 268 | .Fn EVP_md_null void | 186 | .Fn EVP_md_null void |
| 269 | .Ft const EVP_MD * | 187 | .Ft const EVP_MD * |
| @@ -329,70 +247,6 @@ and | |||
| 329 | .Fn EVP_MD_CTX_free , | 247 | .Fn EVP_MD_CTX_free , |
| 330 | respectively. | 248 | respectively. |
| 331 | .Pp | 249 | .Pp |
| 332 | .Fn EVP_MD_CTX_ctrl | ||
| 333 | performs the digest-specific control | ||
| 334 | .Fa command | ||
| 335 | with the command-specific arguments | ||
| 336 | .Fa p1 | ||
| 337 | and | ||
| 338 | .Fa p2 | ||
| 339 | on | ||
| 340 | .Fa ctx , | ||
| 341 | which needs to already be set up with | ||
| 342 | .Fn EVP_DigestInit_ex | ||
| 343 | before calling this function. | ||
| 344 | Other restrictions may apply depending on the control | ||
| 345 | .Fa command | ||
| 346 | and digest implementation. | ||
| 347 | .Pp | ||
| 348 | If the | ||
| 349 | .Fa command | ||
| 350 | is | ||
| 351 | .Dv EVP_MD_CTRL_MICALG , | ||
| 352 | .Fa p1 | ||
| 353 | is ignored and | ||
| 354 | .Fa p2 | ||
| 355 | is an output argument of the type | ||
| 356 | .Fa "char **p2" . | ||
| 357 | A string specifying the digest Message Integrity Check algorithm | ||
| 358 | is allocated and a pointer to this string is returned in | ||
| 359 | .Pf * Fa p2 . | ||
| 360 | It is the responsibility of the caller to | ||
| 361 | .Xr free 3 | ||
| 362 | .Pf * Fa p2 | ||
| 363 | when it is no longer needed. | ||
| 364 | This | ||
| 365 | .Fa command | ||
| 366 | is used by | ||
| 367 | .Xr SMIME_write_ASN1 3 | ||
| 368 | when creating S/MIME multipart/signed messages as specified in RFC 3851. | ||
| 369 | .Pp | ||
| 370 | .Fn EVP_MD_CTX_set_flags | ||
| 371 | sets and | ||
| 372 | .Fn EVP_MD_CTX_clear_flags | ||
| 373 | clears all the flag bits in | ||
| 374 | .Fa ctx | ||
| 375 | that are set in the | ||
| 376 | .Fa flags | ||
| 377 | argument. | ||
| 378 | .Fn EVP_MD_CTX_test_flags | ||
| 379 | tests which of the flag bits that are set in the | ||
| 380 | .Fa flags | ||
| 381 | argument are also set in | ||
| 382 | .Fa ctx . | ||
| 383 | Possible flag bits are: | ||
| 384 | .Bl -tag -width Ds -offset 2n | ||
| 385 | .It Dv EVP_MD_CTX_FLAG_NO_INIT | ||
| 386 | Instruct | ||
| 387 | .Fn EVP_DigestInit_ex | ||
| 388 | and functions calling it not to initialise the internal data | ||
| 389 | that is specific to the digest method and its implementation. | ||
| 390 | .It Dv EVP_MD_CTX_FLAG_ONESHOT | ||
| 391 | Instruct the digest to optimize for one update only, if possible. | ||
| 392 | For digest algorithms built into the library, this flag usually | ||
| 393 | has no effect. | ||
| 394 | .El | ||
| 395 | .Pp | ||
| 396 | .Fn EVP_DigestInit_ex | 250 | .Fn EVP_DigestInit_ex |
| 397 | sets up the digest context | 251 | sets up the digest context |
| 398 | .Fa ctx | 252 | .Fa ctx |
| @@ -505,111 +359,6 @@ except that it requires | |||
| 505 | before a context that was already used can be passed as | 359 | before a context that was already used can be passed as |
| 506 | .Fa out . | 360 | .Fa out . |
| 507 | .Pp | 361 | .Pp |
| 508 | .Fn EVP_MD_size | ||
| 509 | and | ||
| 510 | .Fn EVP_MD_CTX_size | ||
| 511 | return the size of the message digest when passed an | ||
| 512 | .Vt EVP_MD | ||
| 513 | or an | ||
| 514 | .Vt EVP_MD_CTX | ||
| 515 | structure, i.e. the size of the hash. | ||
| 516 | .Pp | ||
| 517 | .Fn EVP_MD_block_size | ||
| 518 | and | ||
| 519 | .Fn EVP_MD_CTX_block_size | ||
| 520 | return the block size of the message digest when passed an | ||
| 521 | .Vt EVP_MD | ||
| 522 | or an | ||
| 523 | .Vt EVP_MD_CTX | ||
| 524 | structure. | ||
| 525 | .Pp | ||
| 526 | .Fn EVP_MD_type | ||
| 527 | and | ||
| 528 | .Fn EVP_MD_CTX_type | ||
| 529 | return the NID of the OBJECT IDENTIFIER representing the message digest. | ||
| 530 | For example | ||
| 531 | .Fn EVP_MD_type EVP_sha512() | ||
| 532 | returns | ||
| 533 | .Dv NID_sha512 . | ||
| 534 | These functions are normally used when setting ASN.1 OIDs. | ||
| 535 | .Pp | ||
| 536 | .Fn EVP_MD_CTX_md_data | ||
| 537 | returns the digest method private data of | ||
| 538 | .Fa ctx . | ||
| 539 | The space was allocated and its size set with | ||
| 540 | .Xr EVP_MD_meth_set_app_datasize 3 . | ||
| 541 | .Pp | ||
| 542 | .Fn EVP_MD_flags | ||
| 543 | returns the | ||
| 544 | .Fa md | ||
| 545 | flags. | ||
| 546 | These are different from the | ||
| 547 | .Vt EVP_MD_CTX | ||
| 548 | ones. | ||
| 549 | See | ||
| 550 | .Xr EVP_MD_meth_set_flags 3 | ||
| 551 | for more information. | ||
| 552 | .Pp | ||
| 553 | .Fn EVP_MD_pkey_type | ||
| 554 | returns the NID of the public key signing algorithm associated with this | ||
| 555 | digest. | ||
| 556 | For example | ||
| 557 | .Fn EVP_sha512 | ||
| 558 | is associated with RSA so this will return | ||
| 559 | .Dv NID_sha512WithRSAEncryption . | ||
| 560 | Since digests and signature algorithms are no longer linked, this | ||
| 561 | function is only retained for compatibility reasons. | ||
| 562 | .Pp | ||
| 563 | .Fn EVP_MD_CTX_pkey_ctx | ||
| 564 | returns the | ||
| 565 | .Vt EVP_PKEY_CTX | ||
| 566 | assigned to | ||
| 567 | .Fa ctx . | ||
| 568 | The returned pointer should not be freed by the caller. | ||
| 569 | .Pp | ||
| 570 | .Fn EVP_MD_CTX_set_pkey_ctx | ||
| 571 | assigns | ||
| 572 | .Fa pctx | ||
| 573 | to | ||
| 574 | .Fa ctx . | ||
| 575 | This is normally used to provide a customized | ||
| 576 | .Vt EVP_PKEY_CTX | ||
| 577 | to | ||
| 578 | .Xr EVP_DigestSignInit 3 | ||
| 579 | or | ||
| 580 | .Xr EVP_DigestVerifyInit 3 . | ||
| 581 | The caller retains ownership of the | ||
| 582 | .Fa pctx | ||
| 583 | passed to this function and is responsible for freeing it | ||
| 584 | when it is no longer needed. | ||
| 585 | .Pp | ||
| 586 | If the | ||
| 587 | .Fa ctx | ||
| 588 | already contains a | ||
| 589 | .Vt EVP_PKEY_CTX | ||
| 590 | when this function is called, that old | ||
| 591 | .Vt EVP_PKEY_CTX | ||
| 592 | is freed if it was created internally, but if it was also installed with | ||
| 593 | .Fn EVP_MD_CTX_set_pkey_ctx , | ||
| 594 | the pointer to the old | ||
| 595 | .Vt EVP_PKEY_CTX | ||
| 596 | is merely replaced by the new pointer and ownership of the old | ||
| 597 | .Vt EVP_PKEY_CTX | ||
| 598 | remains with the previous caller. | ||
| 599 | .Pp | ||
| 600 | Passing a | ||
| 601 | .Dv NULL | ||
| 602 | pointer for the | ||
| 603 | .Fa pctx | ||
| 604 | argument is also allowed. | ||
| 605 | In that case, any | ||
| 606 | .Vt EVP_PKEY_CTX | ||
| 607 | already assigned to | ||
| 608 | .Fa ctx | ||
| 609 | is dissociated from it as described above, but no new | ||
| 610 | .Vt EVP_PKEY_CTX | ||
| 611 | is assigned. | ||
| 612 | .Pp | ||
| 613 | .Fn EVP_sha224 , | 362 | .Fn EVP_sha224 , |
| 614 | .Fn EVP_sha256 , | 363 | .Fn EVP_sha256 , |
| 615 | .Fn EVP_sha384 , | 364 | .Fn EVP_sha384 , |
| @@ -642,10 +391,7 @@ return an | |||
| 642 | structure when passed a digest name, a digest NID, or an ASN1_OBJECT | 391 | structure when passed a digest name, a digest NID, or an ASN1_OBJECT |
| 643 | structure respectively. | 392 | structure respectively. |
| 644 | .Pp | 393 | .Pp |
| 645 | .Fn EVP_MD_CTX_size , | 394 | .Fn EVP_get_digestbynid |
| 646 | .Fn EVP_MD_CTX_block_size , | ||
| 647 | .Fn EVP_MD_CTX_type , | ||
| 648 | .Fn EVP_get_digestbynid , | ||
| 649 | and | 395 | and |
| 650 | .Fn EVP_get_digestbyobj | 396 | .Fn EVP_get_digestbyobj |
| 651 | are implemented as macros. | 397 | are implemented as macros. |
| @@ -693,7 +439,6 @@ and | |||
| 693 | .Fn EVP_MD_CTX_cleanup | 439 | .Fn EVP_MD_CTX_cleanup |
| 694 | always return 1. | 440 | always return 1. |
| 695 | .Pp | 441 | .Pp |
| 696 | .Fn EVP_MD_CTX_ctrl , | ||
| 697 | .Fn EVP_DigestInit_ex , | 442 | .Fn EVP_DigestInit_ex , |
| 698 | .Fn EVP_DigestUpdate , | 443 | .Fn EVP_DigestUpdate , |
| 699 | .Fn EVP_DigestFinal_ex , | 444 | .Fn EVP_DigestFinal_ex , |
| @@ -705,27 +450,6 @@ and | |||
| 705 | .Fn EVP_MD_CTX_copy | 450 | .Fn EVP_MD_CTX_copy |
| 706 | return 1 for success or 0 for failure. | 451 | return 1 for success or 0 for failure. |
| 707 | .Pp | 452 | .Pp |
| 708 | .Fn EVP_MD_CTX_test_flags | ||
| 709 | returns the bitwise OR of the | ||
| 710 | .Fa flags | ||
| 711 | argument and the flags set in | ||
| 712 | .Fa ctx . | ||
| 713 | .Pp | ||
| 714 | .Fn EVP_MD_type , | ||
| 715 | .Fn EVP_MD_pkey_type , | ||
| 716 | and | ||
| 717 | .Fn EVP_MD_CTX_type | ||
| 718 | return the NID of the corresponding OBJECT IDENTIFIER or | ||
| 719 | .Dv NID_undef | ||
| 720 | if none exists. | ||
| 721 | .Pp | ||
| 722 | .Fn EVP_MD_size , | ||
| 723 | .Fn EVP_MD_block_size , | ||
| 724 | .Fn EVP_MD_CTX_size , | ||
| 725 | and | ||
| 726 | .Fn EVP_MD_CTX_block_size | ||
| 727 | return the digest or block size in bytes. | ||
| 728 | .Pp | ||
| 729 | .Fn EVP_MD_CTX_md | 453 | .Fn EVP_MD_CTX_md |
| 730 | returns the | 454 | returns the |
| 731 | .Vt EVP_MD | 455 | .Vt EVP_MD |
| @@ -805,7 +529,9 @@ main(int argc, char *argv[]) | |||
| 805 | .Xr EVP_BytesToKey 3 , | 529 | .Xr EVP_BytesToKey 3 , |
| 806 | .Xr EVP_DigestSignInit 3 , | 530 | .Xr EVP_DigestSignInit 3 , |
| 807 | .Xr EVP_DigestVerifyInit 3 , | 531 | .Xr EVP_DigestVerifyInit 3 , |
| 532 | .Xr EVP_MD_CTX_ctrl 3 , | ||
| 808 | .Xr EVP_MD_meth_new 3 , | 533 | .Xr EVP_MD_meth_new 3 , |
| 534 | .Xr EVP_MD_nid 3 , | ||
| 809 | .Xr EVP_PKEY_CTX_set_signature_md 3 , | 535 | .Xr EVP_PKEY_CTX_set_signature_md 3 , |
| 810 | .Xr EVP_PKEY_meth_set_signctx 3 , | 536 | .Xr EVP_PKEY_meth_set_signctx 3 , |
| 811 | .Xr EVP_sha1 3 , | 537 | .Xr EVP_sha1 3 , |
| @@ -829,24 +555,14 @@ main(int argc, char *argv[]) | |||
| 829 | and | 555 | and |
| 830 | .Dv EVP_MAX_MD_SIZE | 556 | .Dv EVP_MAX_MD_SIZE |
| 831 | first appeared in SSLeay 0.5.1. | 557 | first appeared in SSLeay 0.5.1. |
| 832 | .Fn EVP_MD_size | 558 | .Fn EVP_md_null |
| 833 | first appeared in SSLeay 0.6.6. | ||
| 834 | .Fn EVP_MD_CTX_size , | ||
| 835 | .Fn EVP_MD_CTX_type , | ||
| 836 | .Fn EVP_md_null , | ||
| 837 | and | 559 | and |
| 838 | .Fn EVP_get_digestbyname | 560 | .Fn EVP_get_digestbyname |
| 839 | first appeared in SSLeay 0.8.0. | 561 | first appeared in SSLeay 0.8.0. |
| 840 | .Fn EVP_MD_type , | 562 | .Fn EVP_get_digestbynid |
| 841 | .Fn EVP_MD_pkey_type , | ||
| 842 | .Fn EVP_get_digestbynid , | ||
| 843 | and | 563 | and |
| 844 | .Fn EVP_get_digestbyobj | 564 | .Fn EVP_get_digestbyobj |
| 845 | first appeared in SSLeay 0.8.1. | 565 | first appeared in SSLeay 0.8.1. |
| 846 | .Fn EVP_MD_block_size , | ||
| 847 | .Fn EVP_MD_CTX_size , | ||
| 848 | .Fn EVP_MD_CTX_block_size , | ||
| 849 | and | ||
| 850 | .Fn EVP_ripemd160 | 566 | .Fn EVP_ripemd160 |
| 851 | first appeared in SSLeay 0.9.0. | 567 | first appeared in SSLeay 0.9.0. |
| 852 | All these functions have been available since | 568 | All these functions have been available since |
| @@ -864,9 +580,6 @@ first appeared in OpenSSL 0.9.5 and has been available since | |||
| 864 | .Fn EVP_MD_CTX_create , | 580 | .Fn EVP_MD_CTX_create , |
| 865 | .Fn EVP_MD_CTX_cleanup , | 581 | .Fn EVP_MD_CTX_cleanup , |
| 866 | .Fn EVP_MD_CTX_destroy , | 582 | .Fn EVP_MD_CTX_destroy , |
| 867 | .Fn EVP_MD_CTX_set_flags , | ||
| 868 | .Fn EVP_MD_CTX_clear_flags , | ||
| 869 | .Fn EVP_MD_CTX_test_flags , | ||
| 870 | .Fn EVP_DigestInit_ex , | 583 | .Fn EVP_DigestInit_ex , |
| 871 | .Fn EVP_DigestFinal_ex , | 584 | .Fn EVP_DigestFinal_ex , |
| 872 | .Fn EVP_Digest , | 585 | .Fn EVP_Digest , |
| @@ -884,15 +597,6 @@ first appeared in OpenSSL 0.9.7h and 0.9.8a | |||
| 884 | and have been available since | 597 | and have been available since |
| 885 | .Ox 4.0 . | 598 | .Ox 4.0 . |
| 886 | .Pp | 599 | .Pp |
| 887 | .Fn EVP_MD_flags | ||
| 888 | first appeared in OpenSSL 1.0.0 | ||
| 889 | and has been available since | ||
| 890 | .Ox 4.9 . | ||
| 891 | .Pp | ||
| 892 | .Fn EVP_MD_CTX_ctrl | ||
| 893 | first appeared in OpenSSL 1.1.0 and has been available since | ||
| 894 | .Ox 5.7 . | ||
| 895 | .Pp | ||
| 896 | .Fn EVP_MD_CTX_new , | 600 | .Fn EVP_MD_CTX_new , |
| 897 | .Fn EVP_MD_CTX_reset , | 601 | .Fn EVP_MD_CTX_reset , |
| 898 | and | 602 | and |
| @@ -900,15 +604,6 @@ and | |||
| 900 | first appeared in OpenSSL 1.1.0 and have been available since | 604 | first appeared in OpenSSL 1.1.0 and have been available since |
| 901 | .Ox 6.3 . | 605 | .Ox 6.3 . |
| 902 | .Pp | 606 | .Pp |
| 903 | .Fn EVP_MD_CTX_md_data | ||
| 904 | and | ||
| 905 | .Fn EVP_MD_CTX_pkey_ctx | ||
| 906 | first appeared in OpenSSL 1.1.0 and | ||
| 907 | .Fn EVP_MD_CTX_set_pkey_ctx | ||
| 908 | in OpenSSL 1.1.1. | ||
| 909 | These functions have been available since | ||
| 910 | .Ox 7.1 . | ||
| 911 | .Pp | ||
| 912 | .Fn EVP_sha512_224 | 607 | .Fn EVP_sha512_224 |
| 913 | and | 608 | and |
| 914 | .Fn EVP_sha512_256 | 609 | .Fn EVP_sha512_256 |
diff --git a/src/lib/libcrypto/man/EVP_MD_CTX_ctrl.3 b/src/lib/libcrypto/man/EVP_MD_CTX_ctrl.3 new file mode 100644 index 0000000000..8b6f8724fc --- /dev/null +++ b/src/lib/libcrypto/man/EVP_MD_CTX_ctrl.3 | |||
| @@ -0,0 +1,274 @@ | |||
| 1 | .\" $OpenBSD: EVP_MD_CTX_ctrl.3,v 1.1 2023/09/07 14:22:11 schwarze 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 Richard Levitte <levitte@openssl.org>, | ||
| 23 | .\" Todd Short <tshort@akamai.com>, Paul Yang <yang.yang@baishancloud.com>, | ||
| 24 | .\" and Antoine Salon <asalon@vmware.com>. | ||
| 25 | .\" Copyright (c) 2015, 2016, 2018, 2019 The OpenSSL Project. | ||
| 26 | .\" All rights reserved. | ||
| 27 | .\" | ||
| 28 | .\" Redistribution and use in source and binary forms, with or without | ||
| 29 | .\" modification, are permitted provided that the following conditions | ||
| 30 | .\" are met: | ||
| 31 | .\" | ||
| 32 | .\" 1. Redistributions of source code must retain the above copyright | ||
| 33 | .\" notice, this list of conditions and the following disclaimer. | ||
| 34 | .\" | ||
| 35 | .\" 2. Redistributions in binary form must reproduce the above copyright | ||
| 36 | .\" notice, this list of conditions and the following disclaimer in | ||
| 37 | .\" the documentation and/or other materials provided with the | ||
| 38 | .\" distribution. | ||
| 39 | .\" | ||
| 40 | .\" 3. All advertising materials mentioning features or use of this | ||
| 41 | .\" software must display the following acknowledgment: | ||
| 42 | .\" "This product includes software developed by the OpenSSL Project | ||
| 43 | .\" for use in the OpenSSL Toolkit. (http://www.openssl.org/)" | ||
| 44 | .\" | ||
| 45 | .\" 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to | ||
| 46 | .\" endorse or promote products derived from this software without | ||
| 47 | .\" prior written permission. For written permission, please contact | ||
| 48 | .\" openssl-core@openssl.org. | ||
| 49 | .\" | ||
| 50 | .\" 5. Products derived from this software may not be called "OpenSSL" | ||
| 51 | .\" nor may "OpenSSL" appear in their names without prior written | ||
| 52 | .\" permission of the OpenSSL Project. | ||
| 53 | .\" | ||
| 54 | .\" 6. Redistributions of any form whatsoever must retain the following | ||
| 55 | .\" acknowledgment: | ||
| 56 | .\" "This product includes software developed by the OpenSSL Project | ||
| 57 | .\" for use in the OpenSSL Toolkit (http://www.openssl.org/)" | ||
| 58 | .\" | ||
| 59 | .\" THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY | ||
| 60 | .\" EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | ||
| 61 | .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR | ||
| 62 | .\" PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR | ||
| 63 | .\" ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | ||
| 64 | .\" SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT | ||
| 65 | .\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | ||
| 66 | .\" LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | ||
| 67 | .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, | ||
| 68 | .\" STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | ||
| 69 | .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED | ||
| 70 | .\" OF THE POSSIBILITY OF SUCH DAMAGE. | ||
| 71 | .\" | ||
| 72 | .Dd $Mdocdate: September 7 2023 $ | ||
| 73 | .Dt EVP_MD_CTX_CTRL 3 | ||
| 74 | .Os | ||
| 75 | .Sh NAME | ||
| 76 | .Nm EVP_MD_CTX_ctrl , | ||
| 77 | .Nm EVP_MD_CTX_set_flags , | ||
| 78 | .Nm EVP_MD_CTX_clear_flags , | ||
| 79 | .Nm EVP_MD_CTX_test_flags , | ||
| 80 | .Nm EVP_MD_CTX_pkey_ctx , | ||
| 81 | .Nm EVP_MD_CTX_set_pkey_ctx , | ||
| 82 | .Nm EVP_MD_CTX_md_data | ||
| 83 | .Nd configure EVP message digest contexts | ||
| 84 | .Sh SYNOPSIS | ||
| 85 | .In openssl/evp.h | ||
| 86 | .Ft int | ||
| 87 | .Fo EVP_MD_CTX_ctrl | ||
| 88 | .Fa "EVP_MD_CTX *ctx" | ||
| 89 | .Fa "int command" | ||
| 90 | .Fa "int p1" | ||
| 91 | .Fa "void* p2" | ||
| 92 | .Fc | ||
| 93 | .Ft void | ||
| 94 | .Fo EVP_MD_CTX_set_flags | ||
| 95 | .Fa "EVP_MD_CTX *ctx" | ||
| 96 | .Fa "int flags" | ||
| 97 | .Fc | ||
| 98 | .Ft void | ||
| 99 | .Fo EVP_MD_CTX_clear_flags | ||
| 100 | .Fa "EVP_MD_CTX *ctx" | ||
| 101 | .Fa "int flags" | ||
| 102 | .Fc | ||
| 103 | .Ft int | ||
| 104 | .Fo EVP_MD_CTX_test_flags | ||
| 105 | .Fa "const EVP_MD_CTX *ctx" | ||
| 106 | .Fa "int flags" | ||
| 107 | .Fc | ||
| 108 | .Ft EVP_PKEY_CTX * | ||
| 109 | .Fo EVP_MD_CTX_pkey_ctx | ||
| 110 | .Fa "const EVP_MD_CTX *ctx" | ||
| 111 | .Fc | ||
| 112 | .Ft void | ||
| 113 | .Fo EVP_MD_CTX_set_pkey_ctx | ||
| 114 | .Fa "EVP_MD_CTX *ctx" | ||
| 115 | .Fa "EVP_PKEY_CTX *pctx" | ||
| 116 | .Fc | ||
| 117 | .Ft void * | ||
| 118 | .Fo EVP_MD_CTX_md_data | ||
| 119 | .Fa "const EVP_MD_CTX *ctx" | ||
| 120 | .Fc | ||
| 121 | .Sh DESCRIPTION | ||
| 122 | .Fn EVP_MD_CTX_ctrl | ||
| 123 | performs the digest-specific control | ||
| 124 | .Fa command | ||
| 125 | with the command-specific arguments | ||
| 126 | .Fa p1 | ||
| 127 | and | ||
| 128 | .Fa p2 | ||
| 129 | on | ||
| 130 | .Fa ctx , | ||
| 131 | which needs to already be set up with | ||
| 132 | .Xr EVP_DigestInit_ex 3 | ||
| 133 | before calling this function. | ||
| 134 | Other restrictions may apply depending on the control | ||
| 135 | .Fa command | ||
| 136 | and digest implementation. | ||
| 137 | .Pp | ||
| 138 | If the | ||
| 139 | .Fa command | ||
| 140 | is | ||
| 141 | .Dv EVP_MD_CTRL_MICALG , | ||
| 142 | .Fa p1 | ||
| 143 | is ignored and | ||
| 144 | .Fa p2 | ||
| 145 | is an output argument of the type | ||
| 146 | .Fa "char **p2" . | ||
| 147 | A string specifying the digest Message Integrity Check algorithm | ||
| 148 | is allocated and a pointer to this string is returned in | ||
| 149 | .Pf * Fa p2 . | ||
| 150 | It is the responsibility of the caller to | ||
| 151 | .Xr free 3 | ||
| 152 | .Pf * Fa p2 | ||
| 153 | when it is no longer needed. | ||
| 154 | This | ||
| 155 | .Fa command | ||
| 156 | is used by | ||
| 157 | .Xr SMIME_write_ASN1 3 | ||
| 158 | when creating S/MIME multipart/signed messages as specified in RFC 3851. | ||
| 159 | .Pp | ||
| 160 | .Fn EVP_MD_CTX_set_flags | ||
| 161 | sets and | ||
| 162 | .Fn EVP_MD_CTX_clear_flags | ||
| 163 | clears all the flag bits in | ||
| 164 | .Fa ctx | ||
| 165 | that are set in the | ||
| 166 | .Fa flags | ||
| 167 | argument. | ||
| 168 | .Fn EVP_MD_CTX_test_flags | ||
| 169 | tests which of the flag bits that are set in the | ||
| 170 | .Fa flags | ||
| 171 | argument are also set in | ||
| 172 | .Fa ctx . | ||
| 173 | Possible flag bits are: | ||
| 174 | .Bl -tag -width Ds -offset 2n | ||
| 175 | .It Dv EVP_MD_CTX_FLAG_NO_INIT | ||
| 176 | Instruct | ||
| 177 | .Xr EVP_DigestInit_ex 3 | ||
| 178 | and functions calling it not to initialise the internal data | ||
| 179 | that is specific to the digest method and its implementation. | ||
| 180 | .It Dv EVP_MD_CTX_FLAG_ONESHOT | ||
| 181 | Instruct the digest to optimize for one update only, if possible. | ||
| 182 | For digest algorithms built into the library, this flag usually | ||
| 183 | has no effect. | ||
| 184 | .El | ||
| 185 | .Pp | ||
| 186 | .Fn EVP_MD_CTX_pkey_ctx | ||
| 187 | returns the | ||
| 188 | .Vt EVP_PKEY_CTX | ||
| 189 | assigned to | ||
| 190 | .Fa ctx . | ||
| 191 | The returned pointer should not be freed by the caller. | ||
| 192 | .Pp | ||
| 193 | .Fn EVP_MD_CTX_set_pkey_ctx | ||
| 194 | assigns | ||
| 195 | .Fa pctx | ||
| 196 | to | ||
| 197 | .Fa ctx . | ||
| 198 | This is normally used to provide a customized | ||
| 199 | .Vt EVP_PKEY_CTX | ||
| 200 | to | ||
| 201 | .Xr EVP_DigestSignInit 3 | ||
| 202 | or | ||
| 203 | .Xr EVP_DigestVerifyInit 3 . | ||
| 204 | The caller retains ownership of the | ||
| 205 | .Fa pctx | ||
| 206 | passed to this function and is responsible for freeing it | ||
| 207 | when it is no longer needed. | ||
| 208 | .Pp | ||
| 209 | If the | ||
| 210 | .Fa ctx | ||
| 211 | already contains a | ||
| 212 | .Vt EVP_PKEY_CTX | ||
| 213 | when this function is called, that old | ||
| 214 | .Vt EVP_PKEY_CTX | ||
| 215 | is freed if it was created internally, but if it was also installed with | ||
| 216 | .Fn EVP_MD_CTX_set_pkey_ctx , | ||
| 217 | the pointer to the old | ||
| 218 | .Vt EVP_PKEY_CTX | ||
| 219 | is merely replaced by the new pointer and ownership of the old | ||
| 220 | .Vt EVP_PKEY_CTX | ||
| 221 | remains with the previous caller. | ||
| 222 | .Pp | ||
| 223 | Passing a | ||
| 224 | .Dv NULL | ||
| 225 | pointer for the | ||
| 226 | .Fa pctx | ||
| 227 | argument is also allowed. | ||
| 228 | In that case, any | ||
| 229 | .Vt EVP_PKEY_CTX | ||
| 230 | already assigned to | ||
| 231 | .Fa ctx | ||
| 232 | is dissociated from it as described above, but no new | ||
| 233 | .Vt EVP_PKEY_CTX | ||
| 234 | is assigned. | ||
| 235 | .Pp | ||
| 236 | .Fn EVP_MD_CTX_md_data | ||
| 237 | returns the digest method private data of | ||
| 238 | .Fa ctx . | ||
| 239 | The space was allocated and its size set with | ||
| 240 | .Xr EVP_MD_meth_set_app_datasize 3 . | ||
| 241 | .Sh RETURN VALUES | ||
| 242 | .Fn EVP_MD_CTX_ctrl | ||
| 243 | returns 1 for success or 0 for failure. | ||
| 244 | .Pp | ||
| 245 | .Fn EVP_MD_CTX_test_flags | ||
| 246 | returns the bitwise OR of the | ||
| 247 | .Fa flags | ||
| 248 | argument and the flags set in | ||
| 249 | .Fa ctx . | ||
| 250 | .Sh SEE ALSO | ||
| 251 | .Xr evp 3 , | ||
| 252 | .Xr EVP_DigestInit 3 , | ||
| 253 | .Xr EVP_MD_meth_new 3 , | ||
| 254 | .Xr EVP_MD_nid 3 | ||
| 255 | .Sh HISTORY | ||
| 256 | .Fn EVP_MD_CTX_set_flags , | ||
| 257 | .Fn EVP_MD_CTX_clear_flags , | ||
| 258 | and | ||
| 259 | .Fn EVP_MD_CTX_test_flags , | ||
| 260 | first appeared in OpenSSL 0.9.7 and have been available since | ||
| 261 | .Ox 3.2 . | ||
| 262 | .Pp | ||
| 263 | .Fn EVP_MD_CTX_ctrl | ||
| 264 | first appeared in OpenSSL 1.1.0 and has been available since | ||
| 265 | .Ox 5.7 . | ||
| 266 | .Pp | ||
| 267 | .Fn EVP_MD_CTX_pkey_ctx | ||
| 268 | and | ||
| 269 | .Fn EVP_MD_CTX_md_data | ||
| 270 | first appeared in OpenSSL 1.1.0 and | ||
| 271 | .Fn EVP_MD_CTX_set_pkey_ctx | ||
| 272 | in OpenSSL 1.1.1. | ||
| 273 | These functions have been available since | ||
| 274 | .Ox 7.1 . | ||
diff --git a/src/lib/libcrypto/man/EVP_MD_nid.3 b/src/lib/libcrypto/man/EVP_MD_nid.3 new file mode 100644 index 0000000000..3083653590 --- /dev/null +++ b/src/lib/libcrypto/man/EVP_MD_nid.3 | |||
| @@ -0,0 +1,213 @@ | |||
| 1 | .\" $OpenBSD: EVP_MD_nid.3,v 1.1 2023/09/07 14:22:11 schwarze 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: September 7 2023 $ | ||
| 72 | .Dt EVP_MD_TYPE 3 | ||
| 73 | .Os | ||
| 74 | .Sh NAME | ||
| 75 | .Nm EVP_MD_type , | ||
| 76 | .Nm EVP_MD_CTX_type , | ||
| 77 | .Nm EVP_MD_size , | ||
| 78 | .Nm EVP_MD_CTX_size , | ||
| 79 | .Nm EVP_MD_block_size , | ||
| 80 | .Nm EVP_MD_CTX_block_size , | ||
| 81 | .Nm EVP_MD_flags , | ||
| 82 | .Nm EVP_MD_pkey_type | ||
| 83 | .Nd inspect EVP_MD objects | ||
| 84 | .Sh SYNOPSIS | ||
| 85 | .In openssl/evp.h | ||
| 86 | .Ft int | ||
| 87 | .Fo EVP_MD_type | ||
| 88 | .Fa "const EVP_MD *md" | ||
| 89 | .Fc | ||
| 90 | .Ft int | ||
| 91 | .Fo EVP_MD_CTX_type | ||
| 92 | .Fa "const EVP_MD_CTX *ctx" | ||
| 93 | .Fc | ||
| 94 | .Ft int | ||
| 95 | .Fo EVP_MD_size | ||
| 96 | .Fa "const EVP_MD *md" | ||
| 97 | .Fc | ||
| 98 | .Ft int | ||
| 99 | .Fo EVP_MD_CTX_size | ||
| 100 | .Fa "const EVP_MD_CTX *ctx" | ||
| 101 | .Fc | ||
| 102 | .Ft int | ||
| 103 | .Fo EVP_MD_block_size | ||
| 104 | .Fa "const EVP_MD *md" | ||
| 105 | .Fc | ||
| 106 | .Ft int | ||
| 107 | .Fo EVP_MD_CTX_block_size | ||
| 108 | .Fa "const EVP_MD_CTX *ctx" | ||
| 109 | .Fc | ||
| 110 | .Ft unsigned long | ||
| 111 | .Fo EVP_MD_flags | ||
| 112 | .Fa "const EVP_MD *md" | ||
| 113 | .Fc | ||
| 114 | .Ft int | ||
| 115 | .Fo EVP_MD_pkey_type | ||
| 116 | .Fa "const EVP_MD *md" | ||
| 117 | .Fc | ||
| 118 | .Sh DESCRIPTION | ||
| 119 | .Fn EVP_MD_type | ||
| 120 | and | ||
| 121 | .Fn EVP_MD_CTX_type | ||
| 122 | return the NID of the OBJECT IDENTIFIER representing the message digest. | ||
| 123 | For example | ||
| 124 | .Fn EVP_MD_type EVP_sha512() | ||
| 125 | returns | ||
| 126 | .Dv NID_sha512 . | ||
| 127 | These functions are normally used when setting ASN.1 OIDs. | ||
| 128 | .Pp | ||
| 129 | .Fn EVP_MD_size | ||
| 130 | and | ||
| 131 | .Fn EVP_MD_CTX_size | ||
| 132 | return the size of the message digest when passed an | ||
| 133 | .Vt EVP_MD | ||
| 134 | or an | ||
| 135 | .Vt EVP_MD_CTX | ||
| 136 | structure, i.e. the size of the hash. | ||
| 137 | .Pp | ||
| 138 | .Fn EVP_MD_block_size | ||
| 139 | and | ||
| 140 | .Fn EVP_MD_CTX_block_size | ||
| 141 | return the block size of the message digest when passed an | ||
| 142 | .Vt EVP_MD | ||
| 143 | or an | ||
| 144 | .Vt EVP_MD_CTX | ||
| 145 | structure. | ||
| 146 | .Pp | ||
| 147 | .Fn EVP_MD_flags | ||
| 148 | returns the | ||
| 149 | .Fa md | ||
| 150 | flags. | ||
| 151 | These are different from the | ||
| 152 | .Vt EVP_MD_CTX | ||
| 153 | ones. | ||
| 154 | See | ||
| 155 | .Xr EVP_MD_meth_set_flags 3 | ||
| 156 | for more information. | ||
| 157 | .Pp | ||
| 158 | .Fn EVP_MD_pkey_type | ||
| 159 | returns the NID of the public key signing algorithm associated with this | ||
| 160 | digest. | ||
| 161 | For example | ||
| 162 | .Fn EVP_sha512 | ||
| 163 | is associated with RSA so this will return | ||
| 164 | .Dv NID_sha512WithRSAEncryption . | ||
| 165 | Since digests and signature algorithms are no longer linked, this | ||
| 166 | function is only retained for compatibility reasons. | ||
| 167 | .Pp | ||
| 168 | .Fn EVP_MD_CTX_size , | ||
| 169 | .Fn EVP_MD_CTX_block_size , | ||
| 170 | and | ||
| 171 | .Fn EVP_MD_CTX_type | ||
| 172 | are implemented as macros. | ||
| 173 | .Sh RETURN VALUES | ||
| 174 | .Fn EVP_MD_type , | ||
| 175 | .Fn EVP_MD_CTX_type , | ||
| 176 | and | ||
| 177 | .Fn EVP_MD_pkey_type | ||
| 178 | return the NID of the corresponding OBJECT IDENTIFIER or | ||
| 179 | .Dv NID_undef | ||
| 180 | if none exists. | ||
| 181 | .Pp | ||
| 182 | .Fn EVP_MD_size , | ||
| 183 | .Fn EVP_MD_CTX_size , | ||
| 184 | .Fn EVP_MD_block_size , | ||
| 185 | and | ||
| 186 | .Fn EVP_MD_CTX_block_size | ||
| 187 | return the digest or block size in bytes. | ||
| 188 | .Sh SEE ALSO | ||
| 189 | .Xr evp 3 , | ||
| 190 | .Xr EVP_DigestInit 3 , | ||
| 191 | .Xr EVP_MD_CTX_ctrl 3 | ||
| 192 | .Sh HISTORY | ||
| 193 | .Fn EVP_MD_size | ||
| 194 | first appeared in SSLeay 0.6.6, | ||
| 195 | .Fn EVP_MD_CTX_size | ||
| 196 | and | ||
| 197 | .Fn EVP_MD_CTX_type | ||
| 198 | in SSLeay 0.8.0, | ||
| 199 | .Fn EVP_MD_type | ||
| 200 | and | ||
| 201 | .Fn EVP_MD_pkey_type | ||
| 202 | in SSLeay 0.8.1, and | ||
| 203 | .Fn EVP_MD_block_size | ||
| 204 | and | ||
| 205 | .Fn EVP_MD_CTX_block_size | ||
| 206 | in SSLeay 0.9.0. | ||
| 207 | All these functions have been available since | ||
| 208 | .Ox 2.4 . | ||
| 209 | .Pp | ||
| 210 | .Fn EVP_MD_flags | ||
| 211 | first appeared in OpenSSL 1.0.0 | ||
| 212 | and has been available since | ||
| 213 | .Ox 4.9 . | ||
diff --git a/src/lib/libcrypto/man/Makefile b/src/lib/libcrypto/man/Makefile index 654a4f02a2..c7a79fa7b6 100644 --- a/src/lib/libcrypto/man/Makefile +++ b/src/lib/libcrypto/man/Makefile | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | # $OpenBSD: Makefile,v 1.266 2023/08/31 17:27:41 schwarze Exp $ | 1 | # $OpenBSD: Makefile,v 1.267 2023/09/07 14:22:11 schwarze Exp $ |
| 2 | 2 | ||
| 3 | .include <bsd.own.mk> | 3 | .include <bsd.own.mk> |
| 4 | 4 | ||
| @@ -175,7 +175,9 @@ MAN= \ | |||
| 175 | EVP_DigestVerifyInit.3 \ | 175 | EVP_DigestVerifyInit.3 \ |
| 176 | EVP_EncodeInit.3 \ | 176 | EVP_EncodeInit.3 \ |
| 177 | EVP_EncryptInit.3 \ | 177 | EVP_EncryptInit.3 \ |
| 178 | EVP_MD_CTX_ctrl.3 \ | ||
| 178 | EVP_MD_meth_new.3 \ | 179 | EVP_MD_meth_new.3 \ |
| 180 | EVP_MD_nid.3 \ | ||
| 179 | EVP_OpenInit.3 \ | 181 | EVP_OpenInit.3 \ |
| 180 | EVP_PKCS82PKEY.3 \ | 182 | EVP_PKCS82PKEY.3 \ |
| 181 | EVP_PKEY_CTX_ctrl.3 \ | 183 | EVP_PKEY_CTX_ctrl.3 \ |
diff --git a/src/lib/libcrypto/man/evp.3 b/src/lib/libcrypto/man/evp.3 index d2b92ae6a5..2f2d07c7a7 100644 --- a/src/lib/libcrypto/man/evp.3 +++ b/src/lib/libcrypto/man/evp.3 | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | .\" $OpenBSD: evp.3,v 1.22 2023/08/31 17:27:41 schwarze Exp $ | 1 | .\" $OpenBSD: evp.3,v 1.23 2023/09/07 14:22:11 schwarze Exp $ |
| 2 | .\" full merge up to: OpenSSL man7/evp 24a535ea Sep 22 13:14:20 2020 +0100 | 2 | .\" full merge up to: OpenSSL man7/evp 24a535ea Sep 22 13:14:20 2020 +0100 |
| 3 | .\" | 3 | .\" |
| 4 | .\" This file was written by Ulf Moeller <ulf@openssl.org>, | 4 | .\" This file was written by Ulf Moeller <ulf@openssl.org>, |
| @@ -51,7 +51,7 @@ | |||
| 51 | .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED | 51 | .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED |
| 52 | .\" OF THE POSSIBILITY OF SUCH DAMAGE. | 52 | .\" OF THE POSSIBILITY OF SUCH DAMAGE. |
| 53 | .\" | 53 | .\" |
| 54 | .Dd $Mdocdate: August 31 2023 $ | 54 | .Dd $Mdocdate: September 7 2023 $ |
| 55 | .Dt EVP 3 | 55 | .Dt EVP 3 |
| 56 | .Os | 56 | .Os |
| 57 | .Sh NAME | 57 | .Sh NAME |
| @@ -211,7 +211,9 @@ operations are more efficient using the high-level interfaces. | |||
| 211 | .Xr EVP_DigestVerifyInit 3 , | 211 | .Xr EVP_DigestVerifyInit 3 , |
| 212 | .Xr EVP_EncodeInit 3 , | 212 | .Xr EVP_EncodeInit 3 , |
| 213 | .Xr EVP_EncryptInit 3 , | 213 | .Xr EVP_EncryptInit 3 , |
| 214 | .Xr EVP_MD_CTX_ctrl 3 , | ||
| 214 | .Xr EVP_MD_meth_new 3 , | 215 | .Xr EVP_MD_meth_new 3 , |
| 216 | .Xr EVP_MD_nid 3 , | ||
| 215 | .Xr EVP_OpenInit 3 , | 217 | .Xr EVP_OpenInit 3 , |
| 216 | .Xr EVP_PKCS82PKEY 3 , | 218 | .Xr EVP_PKCS82PKEY 3 , |
| 217 | .Xr EVP_PKEY_add1_attr 3 , | 219 | .Xr EVP_PKEY_add1_attr 3 , |
