diff options
Diffstat (limited to 'src/lib/libcrypto/man/EVP_SignInit.3')
| -rw-r--r-- | src/lib/libcrypto/man/EVP_SignInit.3 | 211 |
1 files changed, 0 insertions, 211 deletions
diff --git a/src/lib/libcrypto/man/EVP_SignInit.3 b/src/lib/libcrypto/man/EVP_SignInit.3 deleted file mode 100644 index 8158b21dbf..0000000000 --- a/src/lib/libcrypto/man/EVP_SignInit.3 +++ /dev/null | |||
| @@ -1,211 +0,0 @@ | |||
| 1 | .\" $OpenBSD: EVP_SignInit.3,v 1.21 2024/12/06 12:51:13 schwarze Exp $ | ||
| 2 | .\" full merge up to: OpenSSL 6328d367 Jul 4 21:58:30 2020 +0200 | ||
| 3 | .\" | ||
| 4 | .\" This file was written by Dr. Stephen Henson <steve@openssl.org>. | ||
| 5 | .\" Copyright (c) 2000-2002, 2005, 2006, 2014-2016 The OpenSSL Project. | ||
| 6 | .\" All rights reserved. | ||
| 7 | .\" | ||
| 8 | .\" Redistribution and use in source and binary forms, with or without | ||
| 9 | .\" modification, are permitted provided that the following conditions | ||
| 10 | .\" are met: | ||
| 11 | .\" | ||
| 12 | .\" 1. Redistributions of source code must retain the above copyright | ||
| 13 | .\" notice, this list of conditions and the following disclaimer. | ||
| 14 | .\" | ||
| 15 | .\" 2. Redistributions in binary form must reproduce the above copyright | ||
| 16 | .\" notice, this list of conditions and the following disclaimer in | ||
| 17 | .\" the documentation and/or other materials provided with the | ||
| 18 | .\" distribution. | ||
| 19 | .\" | ||
| 20 | .\" 3. All advertising materials mentioning features or use of this | ||
| 21 | .\" software must display the following acknowledgment: | ||
| 22 | .\" "This product includes software developed by the OpenSSL Project | ||
| 23 | .\" for use in the OpenSSL Toolkit. (http://www.openssl.org/)" | ||
| 24 | .\" | ||
| 25 | .\" 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to | ||
| 26 | .\" endorse or promote products derived from this software without | ||
| 27 | .\" prior written permission. For written permission, please contact | ||
| 28 | .\" openssl-core@openssl.org. | ||
| 29 | .\" | ||
| 30 | .\" 5. Products derived from this software may not be called "OpenSSL" | ||
| 31 | .\" nor may "OpenSSL" appear in their names without prior written | ||
| 32 | .\" permission of the OpenSSL Project. | ||
| 33 | .\" | ||
| 34 | .\" 6. Redistributions of any form whatsoever must retain the following | ||
| 35 | .\" acknowledgment: | ||
| 36 | .\" "This product includes software developed by the OpenSSL Project | ||
| 37 | .\" for use in the OpenSSL Toolkit (http://www.openssl.org/)" | ||
| 38 | .\" | ||
| 39 | .\" THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY | ||
| 40 | .\" EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | ||
| 41 | .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR | ||
| 42 | .\" PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR | ||
| 43 | .\" ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | ||
| 44 | .\" SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT | ||
| 45 | .\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | ||
| 46 | .\" LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | ||
| 47 | .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, | ||
| 48 | .\" STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | ||
| 49 | .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED | ||
| 50 | .\" OF THE POSSIBILITY OF SUCH DAMAGE. | ||
| 51 | .\" | ||
| 52 | .Dd $Mdocdate: December 6 2024 $ | ||
| 53 | .Dt EVP_SIGNINIT 3 | ||
| 54 | .Os | ||
| 55 | .Sh NAME | ||
| 56 | .Nm EVP_SignInit_ex , | ||
| 57 | .Nm EVP_SignUpdate , | ||
| 58 | .Nm EVP_SignFinal , | ||
| 59 | .Nm EVP_SignInit | ||
| 60 | .Nd EVP signing functions | ||
| 61 | .Sh SYNOPSIS | ||
| 62 | .In openssl/evp.h | ||
| 63 | .Ft int | ||
| 64 | .Fo EVP_SignInit_ex | ||
| 65 | .Fa "EVP_MD_CTX *ctx" | ||
| 66 | .Fa "const EVP_MD *type" | ||
| 67 | .Fa "ENGINE *engine" | ||
| 68 | .Fc | ||
| 69 | .Ft int | ||
| 70 | .Fo EVP_SignUpdate | ||
| 71 | .Fa "EVP_MD_CTX *ctx" | ||
| 72 | .Fa "const void *d" | ||
| 73 | .Fa "unsigned int cnt" | ||
| 74 | .Fc | ||
| 75 | .Ft int | ||
| 76 | .Fo EVP_SignFinal | ||
| 77 | .Fa "EVP_MD_CTX *ctx" | ||
| 78 | .Fa "unsigned char *sig" | ||
| 79 | .Fa "unsigned int *s" | ||
| 80 | .Fa "EVP_PKEY *pkey" | ||
| 81 | .Fc | ||
| 82 | .Ft void | ||
| 83 | .Fo EVP_SignInit | ||
| 84 | .Fa "EVP_MD_CTX *ctx" | ||
| 85 | .Fa "const EVP_MD *type" | ||
| 86 | .Fc | ||
| 87 | .Sh DESCRIPTION | ||
| 88 | The EVP signature routines are a high-level interface to digital | ||
| 89 | signatures. | ||
| 90 | .Pp | ||
| 91 | .Fn EVP_SignInit_ex | ||
| 92 | sets up the signing context | ||
| 93 | .Fa ctx | ||
| 94 | to use the digest | ||
| 95 | .Fa type . | ||
| 96 | Before calling this function, obtain | ||
| 97 | .Fa ctx | ||
| 98 | from | ||
| 99 | .Xr EVP_MD_CTX_new 3 | ||
| 100 | or call | ||
| 101 | .Xr EVP_MD_CTX_reset 3 | ||
| 102 | on it. | ||
| 103 | The | ||
| 104 | .Fa engine | ||
| 105 | argument is always ignored and passing | ||
| 106 | .Dv NULL | ||
| 107 | is recommended. | ||
| 108 | .Pp | ||
| 109 | .Fn EVP_SignUpdate | ||
| 110 | hashes | ||
| 111 | .Fa cnt | ||
| 112 | bytes of data at | ||
| 113 | .Fa d | ||
| 114 | into the signature context | ||
| 115 | .Fa ctx . | ||
| 116 | This function can be called several times on the same | ||
| 117 | .Fa ctx | ||
| 118 | to include additional data. | ||
| 119 | .Pp | ||
| 120 | .Fn EVP_SignFinal | ||
| 121 | signs the data in | ||
| 122 | .Fa ctx | ||
| 123 | using the private key | ||
| 124 | .Fa pkey | ||
| 125 | and places the signature in | ||
| 126 | .Fa sig . | ||
| 127 | .Fa sig | ||
| 128 | must be at least | ||
| 129 | .Xr EVP_PKEY_size 3 | ||
| 130 | bytes in size. | ||
| 131 | .Fa s | ||
| 132 | is an OUT parameter, and not used as an IN parameter. | ||
| 133 | The number of bytes of data written (i.e.\& | ||
| 134 | the length of the signature) will be written to the integer at | ||
| 135 | .Fa s . | ||
| 136 | At most | ||
| 137 | .Xr EVP_PKEY_size 3 | ||
| 138 | bytes will be written. | ||
| 139 | .Pp | ||
| 140 | .Fn EVP_SignInit | ||
| 141 | initializes a signing context | ||
| 142 | .Fa ctx | ||
| 143 | to use the default implementation of digest | ||
| 144 | .Fa type . | ||
| 145 | .Pp | ||
| 146 | The EVP interface to digital signatures should almost always be | ||
| 147 | used in preference to the low-level interfaces. | ||
| 148 | This is because the code then becomes transparent to the algorithm used | ||
| 149 | and much more flexible. | ||
| 150 | .Pp | ||
| 151 | The call to | ||
| 152 | .Fn EVP_SignFinal | ||
| 153 | internally finalizes a copy of the digest context. | ||
| 154 | This means that calls to | ||
| 155 | .Fn EVP_SignUpdate | ||
| 156 | and | ||
| 157 | .Fn EVP_SignFinal | ||
| 158 | can be called later to digest and sign additional data. | ||
| 159 | .Pp | ||
| 160 | Since only a copy of the digest context is ever finalized, the context | ||
| 161 | must be cleaned up after use by calling | ||
| 162 | .Xr EVP_MD_CTX_free 3 | ||
| 163 | or a memory leak will occur. | ||
| 164 | .Pp | ||
| 165 | .Fn EVP_SignInit_ex , | ||
| 166 | .Fn EVP_SignUpdate , | ||
| 167 | and | ||
| 168 | .Fn EVP_SignInit | ||
| 169 | are implemented as macros. | ||
| 170 | .Sh RETURN VALUES | ||
| 171 | .Fn EVP_SignInit_ex , | ||
| 172 | .Fn EVP_SignUpdate , | ||
| 173 | and | ||
| 174 | .Fn EVP_SignFinal | ||
| 175 | return 1 for success and 0 for failure. | ||
| 176 | .Pp | ||
| 177 | The error codes can be obtained by | ||
| 178 | .Xr ERR_get_error 3 . | ||
| 179 | .Sh SEE ALSO | ||
| 180 | .Xr evp 3 , | ||
| 181 | .Xr EVP_DigestInit 3 , | ||
| 182 | .Xr EVP_PKEY_size 3 , | ||
| 183 | .Xr EVP_VerifyInit 3 | ||
| 184 | .Sh HISTORY | ||
| 185 | .Fn EVP_SignInit , | ||
| 186 | .Fn EVP_SignUpdate , | ||
| 187 | and | ||
| 188 | .Fn EVP_SignFinal | ||
| 189 | first appeared in SSLeay 0.5.1 and have been available since | ||
| 190 | .Ox 2.4 . | ||
| 191 | .Pp | ||
| 192 | .Fn EVP_SignInit_ex | ||
| 193 | first appeared in OpenSSL 0.9.7 and has been available since | ||
| 194 | .Ox 3.2 . | ||
| 195 | .Sh BUGS | ||
| 196 | Older versions of this documentation wrongly stated that calls to | ||
| 197 | .Fn EVP_SignUpdate | ||
| 198 | could not be made after calling | ||
| 199 | .Fn EVP_SignFinal . | ||
| 200 | .Pp | ||
| 201 | Since the private key is passed in the call to | ||
| 202 | .Fn EVP_SignFinal , | ||
| 203 | any error relating to the private key (for example an unsuitable key and | ||
| 204 | digest combination) will not be indicated until after potentially large | ||
| 205 | amounts of data have been passed through | ||
| 206 | .Fn EVP_SignUpdate . | ||
| 207 | .Pp | ||
| 208 | It is not possible to change the signing parameters using these | ||
| 209 | function. | ||
| 210 | .Pp | ||
| 211 | The previous two bugs are fixed in the newer EVP_DigestSign* function. | ||
