diff options
author | schwarze <> | 2023-09-05 14:19:02 +0000 |
---|---|---|
committer | schwarze <> | 2023-09-05 14:19:02 +0000 |
commit | 07c9f1bc14ce93fb6a9b3e94115b1f649714c156 (patch) | |
tree | 5d2bb6e0a7ca7e0510c0bcd5614ead49f986e1f9 /src/lib | |
parent | f3e03e30764769d345b4643fb2d65b6b5b758f5a (diff) | |
download | openbsd-07c9f1bc14ce93fb6a9b3e94115b1f649714c156.tar.gz openbsd-07c9f1bc14ce93fb6a9b3e94115b1f649714c156.tar.bz2 openbsd-07c9f1bc14ce93fb6a9b3e94115b1f649714c156.zip |
improve the descriptions of almost all flags,
in particular saying which API functions each flag affects
Diffstat (limited to 'src/lib')
-rw-r--r-- | src/lib/libcrypto/man/EVP_CIPHER_meth_new.3 | 141 |
1 files changed, 101 insertions, 40 deletions
diff --git a/src/lib/libcrypto/man/EVP_CIPHER_meth_new.3 b/src/lib/libcrypto/man/EVP_CIPHER_meth_new.3 index 0ecb87340e..c9e1d3ed66 100644 --- a/src/lib/libcrypto/man/EVP_CIPHER_meth_new.3 +++ b/src/lib/libcrypto/man/EVP_CIPHER_meth_new.3 | |||
@@ -1,6 +1,23 @@ | |||
1 | .\" $OpenBSD: EVP_CIPHER_meth_new.3,v 1.2 2023/08/26 15:14:28 schwarze Exp $ | 1 | .\" $OpenBSD: EVP_CIPHER_meth_new.3,v 1.3 2023/09/05 14:19:02 schwarze Exp $ |
2 | .\" selective merge up to: OpenSSL b0edda11 Mar 20 13:00:17 2018 +0000 | 2 | .\" selective merge up to: OpenSSL b0edda11 Mar 20 13:00:17 2018 +0000 |
3 | .\" | 3 | .\" |
4 | .\" This file is a derived work. | ||
5 | .\" The changes are covered by the following Copyright and license: | ||
6 | .\" | ||
7 | .\" Copyright (c) 2023 Ingo Schwarze <schwarze@openbsd.org> | ||
8 | .\" | ||
9 | .\" Permission to use, copy, modify, and distribute this software for any | ||
10 | .\" purpose with or without fee is hereby granted, provided that the above | ||
11 | .\" copyright notice and this permission notice appear in all copies. | ||
12 | .\" | ||
13 | .\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES | ||
14 | .\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF | ||
15 | .\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR | ||
16 | .\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES | ||
17 | .\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN | ||
18 | .\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF | ||
19 | .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. | ||
20 | .\" | ||
4 | .\" The original file was written by Richard Levitte <levitte@openssl.org> | 21 | .\" The original file was written by Richard Levitte <levitte@openssl.org> |
5 | .\" Copyright (c) 2015 The OpenSSL Project. | 22 | .\" Copyright (c) 2015 The OpenSSL Project. |
6 | .\" All rights reserved. | 23 | .\" All rights reserved. |
@@ -49,7 +66,7 @@ | |||
49 | .\" 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 |
50 | .\" OF THE POSSIBILITY OF SUCH DAMAGE. | 67 | .\" OF THE POSSIBILITY OF SUCH DAMAGE. |
51 | .\" | 68 | .\" |
52 | .Dd $Mdocdate: August 26 2023 $ | 69 | .Dd $Mdocdate: September 5 2023 $ |
53 | .Dt EVP_CIPHER_METH_NEW 3 | 70 | .Dt EVP_CIPHER_METH_NEW 3 |
54 | .Os | 71 | .Os |
55 | .Sh NAME | 72 | .Sh NAME |
@@ -185,73 +202,114 @@ Zero or more of the following flags can be OR'ed into the | |||
185 | argument: | 202 | argument: |
186 | .Bl -tag -width Ds | 203 | .Bl -tag -width Ds |
187 | .It EVP_CIPH_VARIABLE_LENGTH | 204 | .It EVP_CIPH_VARIABLE_LENGTH |
188 | This cipher is of variable length. | 205 | This cipher has a variable key length, and the function |
206 | .Xr EVP_CIPHER_CTX_set_key_length 3 | ||
207 | can be used with it. | ||
189 | .It EVP_CIPH_CUSTOM_IV | 208 | .It EVP_CIPH_CUSTOM_IV |
190 | Storing and initialising the IV is left entirely to the implementation. | 209 | Instruct |
210 | .Xr EVP_CipherInit_ex 3 | ||
211 | and similar initialization functions to leave storing and initialising | ||
212 | the IV entirely to the implementation. | ||
213 | If this flag is set, | ||
214 | the implementation is typically expected to do that in its | ||
215 | .Fa init | ||
216 | function. | ||
191 | .It EVP_CIPH_ALWAYS_CALL_INIT | 217 | .It EVP_CIPH_ALWAYS_CALL_INIT |
192 | Set this if the implementation's | 218 | Instruct |
193 | .Fn init | 219 | .Xr EVP_CipherInit_ex 3 |
194 | function should be called even if | 220 | and similar initialization functions to call the implementation's |
221 | .Fa init | ||
222 | function even if the | ||
195 | .Fa key | 223 | .Fa key |
196 | is | 224 | argument is |
197 | .Dv NULL . | 225 | .Dv NULL . |
198 | .It EVP_CIPH_CTRL_INIT | 226 | .It EVP_CIPH_CTRL_INIT |
199 | Set this to have the implementation's | 227 | Instruct |
200 | .Fn ctrl | 228 | .Xr EVP_CipherInit_ex 3 |
201 | function called with command code | 229 | and similar initialization functions to call the implementation's |
230 | .Fa ctrl | ||
231 | function with a command | ||
232 | .Fa type | ||
233 | of | ||
202 | .Dv EVP_CTRL_INIT | 234 | .Dv EVP_CTRL_INIT |
203 | early in its setup. | 235 | early during the setup. |
204 | .It EVP_CIPH_CUSTOM_KEY_LENGTH | 236 | .It EVP_CIPH_CUSTOM_KEY_LENGTH |
205 | Checking and setting the key length after creating the | 237 | Instruct |
206 | .Vt EVP_CIPHER | ||
207 | is left to the implementation. | ||
208 | Whenever someone uses | ||
209 | .Xr EVP_CIPHER_CTX_set_key_length 3 | 238 | .Xr EVP_CIPHER_CTX_set_key_length 3 |
210 | on a | 239 | to not check and set the key length itself, |
211 | .Vt EVP_CIPHER | 240 | but to leave that to the implementation by instead calling its |
212 | with this flag set, the implementation's | 241 | .Fa ctrl |
213 | .Fn ctrl | 242 | function with a command |
214 | function will be called with the control code | 243 | .Fa type |
244 | of | ||
215 | .Dv EVP_CTRL_SET_KEY_LENGTH | 245 | .Dv EVP_CTRL_SET_KEY_LENGTH |
216 | and the key length in | 246 | and the key length in |
217 | .Fa arg . | 247 | .Fa arg . |
218 | .It EVP_CIPH_NO_PADDING | 248 | .It EVP_CIPH_NO_PADDING |
219 | Don't use standard block padding. | 249 | Instruct |
250 | .Xr EVP_CipherFinal_ex 3 | ||
251 | and similar finalization functions to not use standard block padding | ||
252 | but instead report an error if the total amount of data | ||
253 | to be encrypted or decrypted is not a multiple of the block size. | ||
220 | .It EVP_CIPH_RAND_KEY | 254 | .It EVP_CIPH_RAND_KEY |
221 | Making a key with random content is left to the implementation. | 255 | Instruct |
222 | This is done by calling the implementation's | 256 | .Xr EVP_CIPHER_CTX_rand_key 3 |
223 | .Fn ctrl | 257 | to not generate a random key using |
224 | function with the control code | 258 | .Xr arc4random_buf 3 |
259 | but instead leave that to the implementation by calling the | ||
260 | .Fa ctrl | ||
261 | function with a command | ||
262 | .Fa type | ||
263 | of | ||
225 | .Dv EVP_CTRL_RAND_KEY | 264 | .Dv EVP_CTRL_RAND_KEY |
226 | and the pointer to the key memory storage in | 265 | and the pointer to the key memory storage in |
227 | .Fa ptr . | 266 | .Fa ptr . |
228 | .It EVP_CIPH_CUSTOM_COPY | 267 | .It EVP_CIPH_CUSTOM_COPY |
229 | Set this to have the implementation's | 268 | Instruct |
230 | .Fn ctrl | 269 | .Xr EVP_CIPHER_CTX_copy 3 |
231 | function called with command code | 270 | to call the implementation's |
271 | .Fa ctrl | ||
272 | function with a command | ||
273 | .Fa type | ||
274 | of | ||
232 | .Dv EVP_CTRL_COPY | 275 | .Dv EVP_CTRL_COPY |
233 | at the end of | 276 | and the destination |
234 | .Xr EVP_CIPHER_CTX_copy 3 . | 277 | .Fa "EVP_CIPHER_CTX *out" |
278 | in the | ||
279 | .Fa ptr | ||
280 | argument immediately before returning successfully. | ||
235 | The intended use is for further things to deal with after the | 281 | The intended use is for further things to deal with after the |
236 | implementation specific data block has been copied. | 282 | implementation specific data block has been copied. |
237 | The destination | ||
238 | .Vt EVP_CIPHER_CTX | ||
239 | object is passed to the control with the | ||
240 | .Fa ptr | ||
241 | parameter. | ||
242 | The implementation-specific data block is reached with | 283 | The implementation-specific data block is reached with |
243 | .Xr EVP_CIPHER_CTX_get_cipher_data 3 . | 284 | .Xr EVP_CIPHER_CTX_get_cipher_data 3 . |
244 | .It EVP_CIPH_FLAG_DEFAULT_ASN1 | 285 | .It EVP_CIPH_FLAG_DEFAULT_ASN1 |
245 | Use the default EVP routines to pass IV to and from ASN.1. | 286 | Instruct |
287 | .Xr EVP_CIPHER_param_to_asn1 3 | ||
288 | to use | ||
289 | .Xr ASN1_TYPE_set_octetstring 3 | ||
290 | if no | ||
291 | .Fa set_asn1_parameters | ||
292 | function is installed, and instruct | ||
293 | .Xr EVP_CIPHER_asn1_to_param 3 | ||
294 | to use | ||
295 | .Xr ASN1_TYPE_get_octetstring 3 | ||
296 | if no | ||
297 | .Fa get_asn1_parameters | ||
298 | function is installed. | ||
246 | .It EVP_CIPH_FLAG_LENGTH_BITS | 299 | .It EVP_CIPH_FLAG_LENGTH_BITS |
247 | Signals that the length of the input buffer for encryption / decryption | 300 | Signals that the length of the input buffer for encryption / decryption |
248 | is to be understood as the number of bits instead of bytes for this | 301 | is to be understood as the number of bits instead of bytes for this |
249 | implementation. | 302 | implementation. |
250 | This is only useful for CFB1 ciphers. | 303 | This is only useful for CFB1 ciphers. |
251 | .It EVP_CIPH_FLAG_CUSTOM_CIPHER | 304 | .It EVP_CIPH_FLAG_CUSTOM_CIPHER |
252 | This indicates that the implementation takes care of everything, | 305 | Instruct |
306 | .Xr EVP_CipherUpdate 3 , | ||
307 | .Xr EVP_CipherFinal_ex 3 , | ||
308 | and similar encryption, decryption, and finalization functions | ||
309 | that the implementation's | ||
310 | .Fa do_cipher | ||
311 | function takes care of everything, | ||
253 | including padding, buffering and finalization. | 312 | including padding, buffering and finalization. |
254 | The EVP routines will simply give them control and do nothing more. | ||
255 | .It EVP_CIPH_FLAG_AEAD_CIPHER | 313 | .It EVP_CIPH_FLAG_AEAD_CIPHER |
256 | This indicates that this is an AEAD cipher implementation. | 314 | This indicates that this is an AEAD cipher implementation. |
257 | .El | 315 | .El |
@@ -261,7 +319,9 @@ sets the size of the EVP_CIPHER's implementation context so that it can | |||
261 | be automatically allocated. | 319 | be automatically allocated. |
262 | .Pp | 320 | .Pp |
263 | .Fn EVP_CIPHER_meth_set_init | 321 | .Fn EVP_CIPHER_meth_set_init |
264 | sets the cipher init function for | 322 | sets the |
323 | .Fa init | ||
324 | function for | ||
265 | .Fa cipher . | 325 | .Fa cipher . |
266 | The cipher init function is called by | 326 | The cipher init function is called by |
267 | .Xr EVP_CipherInit 3 , | 327 | .Xr EVP_CipherInit 3 , |
@@ -269,6 +329,7 @@ The cipher init function is called by | |||
269 | .Xr EVP_EncryptInit 3 , | 329 | .Xr EVP_EncryptInit 3 , |
270 | .Xr EVP_EncryptInit_ex 3 , | 330 | .Xr EVP_EncryptInit_ex 3 , |
271 | .Xr EVP_DecryptInit 3 , | 331 | .Xr EVP_DecryptInit 3 , |
332 | and | ||
272 | .Xr EVP_DecryptInit_ex 3 . | 333 | .Xr EVP_DecryptInit_ex 3 . |
273 | .Pp | 334 | .Pp |
274 | .Fn EVP_CIPHER_meth_set_do_cipher | 335 | .Fn EVP_CIPHER_meth_set_do_cipher |