diff options
author | jmc <> | 2016-11-21 22:19:15 +0000 |
---|---|---|
committer | jmc <> | 2016-11-21 22:19:15 +0000 |
commit | f3924d02d50eef96d8e3498921ed3ea2a635859b (patch) | |
tree | 4f2ead661ef1282b4d3b9864c0b0a6c1f1509065 | |
parent | 67d9e3da39b97c33cb856ba418ad6f98cd957912 (diff) | |
download | openbsd-f3924d02d50eef96d8e3498921ed3ea2a635859b.tar.gz openbsd-f3924d02d50eef96d8e3498921ed3ea2a635859b.tar.bz2 openbsd-f3924d02d50eef96d8e3498921ed3ea2a635859b.zip |
various cleanup;
22 files changed, 131 insertions, 127 deletions
diff --git a/src/lib/libcrypto/man/EC_GROUP_copy.3 b/src/lib/libcrypto/man/EC_GROUP_copy.3 index 37b3d089bc..28b4aee21a 100644 --- a/src/lib/libcrypto/man/EC_GROUP_copy.3 +++ b/src/lib/libcrypto/man/EC_GROUP_copy.3 | |||
@@ -1,6 +1,6 @@ | |||
1 | .\" $OpenBSD: EC_GROUP_copy.3,v 1.3 2016/11/15 09:25:45 jmc Exp $ | 1 | .\" $OpenBSD: EC_GROUP_copy.3,v 1.4 2016/11/21 22:19:15 jmc Exp $ |
2 | .\" | 2 | .\" |
3 | .Dd $Mdocdate: November 15 2016 $ | 3 | .Dd $Mdocdate: November 21 2016 $ |
4 | .Dt EC_GROUP_COPY 3 | 4 | .Dt EC_GROUP_COPY 3 |
5 | .Os | 5 | .Os |
6 | .Sh NAME | 6 | .Sh NAME |
@@ -313,7 +313,7 @@ non-zero. | |||
313 | The function | 313 | The function |
314 | .Fn EC_GROUP_check | 314 | .Fn EC_GROUP_check |
315 | performs a number of checks on a curve to verify that it is valid. | 315 | performs a number of checks on a curve to verify that it is valid. |
316 | Checks performed include verifying that the discriminant is non zero; | 316 | Checks performed include verifying that the discriminant is non-zero; |
317 | that a generator has been defined; that the generator is on the curve | 317 | that a generator has been defined; that the generator is on the curve |
318 | and has the correct order. | 318 | and has the correct order. |
319 | .Pp | 319 | .Pp |
diff --git a/src/lib/libcrypto/man/EVP_AEAD_CTX_init.3 b/src/lib/libcrypto/man/EVP_AEAD_CTX_init.3 index 02e2b26f0e..ff24d3bf10 100644 --- a/src/lib/libcrypto/man/EVP_AEAD_CTX_init.3 +++ b/src/lib/libcrypto/man/EVP_AEAD_CTX_init.3 | |||
@@ -1,4 +1,4 @@ | |||
1 | .\" $OpenBSD: EVP_AEAD_CTX_init.3,v 1.4 2016/11/05 14:41:31 schwarze Exp $ | 1 | .\" $OpenBSD: EVP_AEAD_CTX_init.3,v 1.5 2016/11/21 22:19:15 jmc Exp $ |
2 | .\" | 2 | .\" |
3 | .\" Copyright (c) 2014, Google Inc. | 3 | .\" Copyright (c) 2014, Google Inc. |
4 | .\" Parts of the text were written by Adam Langley and David Benjamin. | 4 | .\" Parts of the text were written by Adam Langley and David Benjamin. |
@@ -16,7 +16,7 @@ | |||
16 | .\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF | 16 | .\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF |
17 | .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. | 17 | .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. |
18 | .\" | 18 | .\" |
19 | .Dd $Mdocdate: November 5 2016 $ | 19 | .Dd $Mdocdate: November 21 2016 $ |
20 | .Dt EVP_AEAD_CTX_INIT 3 | 20 | .Dt EVP_AEAD_CTX_INIT 3 |
21 | .Os | 21 | .Os |
22 | .Sh NAME | 22 | .Sh NAME |
@@ -184,7 +184,7 @@ bytes are written as output and, in order to ensure success, this value | |||
184 | should be the | 184 | should be the |
185 | .Fa in_len | 185 | .Fa in_len |
186 | plus the result of | 186 | plus the result of |
187 | .Xr EVP_AEAD_overhead 3 . | 187 | .Fn EVP_AEAD_max_overhead . |
188 | On successful return, | 188 | On successful return, |
189 | .Fa out_len | 189 | .Fa out_len |
190 | is set to the actual number of bytes written. | 190 | is set to the actual number of bytes written. |
@@ -237,8 +237,8 @@ interface to AEAD ciphers should be used in preference to the older | |||
237 | .Sy EVP | 237 | .Sy EVP |
238 | variants or to the low level interfaces. | 238 | variants or to the low level interfaces. |
239 | This is because the code then becomes transparent to the AEAD cipher | 239 | This is because the code then becomes transparent to the AEAD cipher |
240 | used and much more flexible, | 240 | used and much more flexible. |
241 | it is also safer to use as it prevents common mistakes with the native APIs. | 241 | It is also safer to use as it prevents common mistakes with the native APIs. |
242 | .Sh RETURN VALUES | 242 | .Sh RETURN VALUES |
243 | .Fn EVP_AEAD_CTX_init , | 243 | .Fn EVP_AEAD_CTX_init , |
244 | .Fn EVP_AEAD_CTX_open , | 244 | .Fn EVP_AEAD_CTX_open , |
@@ -262,8 +262,7 @@ This is the largest value that can be passed as a tag length to | |||
262 | returns the length of the per-message nonce. | 262 | returns the length of the per-message nonce. |
263 | .Sh EXAMPLES | 263 | .Sh EXAMPLES |
264 | Encrypt a string using ChaCha20-Poly1305: | 264 | Encrypt a string using ChaCha20-Poly1305: |
265 | .Bd -literal | 265 | .Bd -literal -offset indent |
266 | .\" XXX | ||
267 | const EVP_AEAD *aead = EVP_aead_chacha20_poly1305(); | 266 | const EVP_AEAD *aead = EVP_aead_chacha20_poly1305(); |
268 | static const unsigned char nonce[32] = {0}; | 267 | static const unsigned char nonce[32] = {0}; |
269 | size_t buf_len, nonce_len; | 268 | size_t buf_len, nonce_len; |
diff --git a/src/lib/libcrypto/man/EVP_BytesToKey.3 b/src/lib/libcrypto/man/EVP_BytesToKey.3 index feb6280cd2..d2950e0894 100644 --- a/src/lib/libcrypto/man/EVP_BytesToKey.3 +++ b/src/lib/libcrypto/man/EVP_BytesToKey.3 | |||
@@ -1,4 +1,4 @@ | |||
1 | .\" $OpenBSD: EVP_BytesToKey.3,v 1.3 2016/11/21 09:56:35 schwarze Exp $ | 1 | .\" $OpenBSD: EVP_BytesToKey.3,v 1.4 2016/11/21 22:19:15 jmc Exp $ |
2 | .\" | 2 | .\" |
3 | .Dd $Mdocdate: November 21 2016 $ | 3 | .Dd $Mdocdate: November 21 2016 $ |
4 | .Dt EVP_BYTESTOKEY 3 | 4 | .Dt EVP_BYTESTOKEY 3 |
@@ -28,8 +28,8 @@ is the cipher to derive the key and IV for. | |||
28 | is the message digest to use. | 28 | is the message digest to use. |
29 | The | 29 | The |
30 | .Fa salt | 30 | .Fa salt |
31 | parameter is used as a salt in the derivation: it should point to an 8 | 31 | parameter is used as a salt in the derivation: |
32 | byte buffer or | 32 | it should point to an 8-byte buffer or |
33 | .Dv NULL | 33 | .Dv NULL |
34 | if no salt is used. | 34 | if no salt is used. |
35 | .Fa data | 35 | .Fa data |
@@ -51,18 +51,18 @@ parameter. | |||
51 | .Pp | 51 | .Pp |
52 | Increasing the | 52 | Increasing the |
53 | .Fa count | 53 | .Fa count |
54 | parameter slows down the algorithm which makes it harder for an attacker | 54 | parameter slows down the algorithm, which makes it harder for an attacker |
55 | to perform a brute force attack using a large number of candidate | 55 | to perform a brute force attack using a large number of candidate |
56 | passwords. | 56 | passwords. |
57 | .Pp | 57 | .Pp |
58 | If the total key and IV length is less than the digest length and MD5 | 58 | If the total key and IV length is less than the digest length and MD5 |
59 | is used, then the derivation algorithm is compatible with PKCS#5 v1.5. | 59 | is used, then the derivation algorithm is compatible with PKCS#5 v1.5. |
60 | Otherwise, a non standard extension is used to derive the extra data. | 60 | Otherwise, a non-standard extension is used to derive the extra data. |
61 | .Pp | 61 | .Pp |
62 | Newer applications should use more standard algorithms such as PBKDF2 as | 62 | Newer applications should use more standard algorithms such as PBKDF2 as |
63 | defined in PKCS#5v2.1 for key derivation. | 63 | defined in PKCS#5v2.1 for key derivation. |
64 | .Sh KEY DERIVATION ALGORITHM | 64 | .Sh KEY DERIVATION ALGORITHM |
65 | The key and IV is derived by concatenating D_1, D_2, etc until enough | 65 | The key and IV is derived by concatenating D_1, D_2, etc. until enough |
66 | data is available for the key and IV. | 66 | data is available for the key and IV. |
67 | D_i is defined recursively as: | 67 | D_i is defined recursively as: |
68 | .Pp | 68 | .Pp |
diff --git a/src/lib/libcrypto/man/EVP_DigestInit.3 b/src/lib/libcrypto/man/EVP_DigestInit.3 index f9be8ef75b..353084435f 100644 --- a/src/lib/libcrypto/man/EVP_DigestInit.3 +++ b/src/lib/libcrypto/man/EVP_DigestInit.3 | |||
@@ -1,6 +1,6 @@ | |||
1 | .\" $OpenBSD: EVP_DigestInit.3,v 1.2 2016/11/06 15:52:50 jmc Exp $ | 1 | .\" $OpenBSD: EVP_DigestInit.3,v 1.3 2016/11/21 22:19:15 jmc Exp $ |
2 | .\" | 2 | .\" |
3 | .Dd $Mdocdate: November 6 2016 $ | 3 | .Dd $Mdocdate: November 21 2016 $ |
4 | .Dt EVP_DIGESTINIT 3 | 4 | .Dt EVP_DIGESTINIT 3 |
5 | .Os | 5 | .Os |
6 | .Sh NAME | 6 | .Sh NAME |
@@ -11,9 +11,11 @@ | |||
11 | .Nm EVP_DigestFinal_ex , | 11 | .Nm EVP_DigestFinal_ex , |
12 | .Nm EVP_MD_CTX_cleanup , | 12 | .Nm EVP_MD_CTX_cleanup , |
13 | .Nm EVP_MD_CTX_destroy , | 13 | .Nm EVP_MD_CTX_destroy , |
14 | .Nm EVP_MAX_MD_SIZE , | ||
15 | .Nm EVP_MD_CTX_copy_ex , | 14 | .Nm EVP_MD_CTX_copy_ex , |
15 | .Nm EVP_DigestInit , | ||
16 | .Nm EVP_DigestFinal , | ||
16 | .Nm EVP_MD_CTX_copy , | 17 | .Nm EVP_MD_CTX_copy , |
18 | .Nm EVP_MAX_MD_SIZE , | ||
17 | .Nm EVP_MD_type , | 19 | .Nm EVP_MD_type , |
18 | .Nm EVP_MD_pkey_type , | 20 | .Nm EVP_MD_pkey_type , |
19 | .Nm EVP_MD_size , | 21 | .Nm EVP_MD_size , |
@@ -35,9 +37,7 @@ | |||
35 | .Nm EVP_ripemd160 , | 37 | .Nm EVP_ripemd160 , |
36 | .Nm EVP_get_digestbyname , | 38 | .Nm EVP_get_digestbyname , |
37 | .Nm EVP_get_digestbynid , | 39 | .Nm EVP_get_digestbynid , |
38 | .Nm EVP_get_digestbyobj , | 40 | .Nm EVP_get_digestbyobj |
39 | .Nm EVP_DigestInit , | ||
40 | .Nm EVP_DigestFinal | ||
41 | .Nd EVP digest routines | 41 | .Nd EVP digest routines |
42 | .Sh SYNOPSIS | 42 | .Sh SYNOPSIS |
43 | .In openssl/evp.h | 43 | .In openssl/evp.h |
@@ -127,12 +127,6 @@ | |||
127 | .Ft const EVP_MD * | 127 | .Ft const EVP_MD * |
128 | .Fn EVP_sha1 void | 128 | .Fn EVP_sha1 void |
129 | .Ft const EVP_MD * | 129 | .Ft const EVP_MD * |
130 | .Fn EVP_dss void | ||
131 | .Ft const EVP_MD * | ||
132 | .Fn EVP_dss1 void | ||
133 | .Ft const EVP_MD * | ||
134 | .Fn EVP_ripemd160 void | ||
135 | .Ft const EVP_MD * | ||
136 | .Fn EVP_sha224 void | 130 | .Fn EVP_sha224 void |
137 | .Ft const EVP_MD * | 131 | .Ft const EVP_MD * |
138 | .Fn EVP_sha256 void | 132 | .Fn EVP_sha256 void |
@@ -141,6 +135,12 @@ | |||
141 | .Ft const EVP_MD * | 135 | .Ft const EVP_MD * |
142 | .Fn EVP_sha512 void | 136 | .Fn EVP_sha512 void |
143 | .Ft const EVP_MD * | 137 | .Ft const EVP_MD * |
138 | .Fn EVP_dss void | ||
139 | .Ft const EVP_MD * | ||
140 | .Fn EVP_dss1 void | ||
141 | .Ft const EVP_MD * | ||
142 | .Fn EVP_ripemd160 void | ||
143 | .Ft const EVP_MD * | ||
144 | .Fo EVP_get_digestbyname | 144 | .Fo EVP_get_digestbyname |
145 | .Fa "const char *name" | 145 | .Fa "const char *name" |
146 | .Fc | 146 | .Fc |
@@ -199,7 +199,7 @@ parameter is not | |||
199 | .Dv NULL , | 199 | .Dv NULL , |
200 | then the number of bytes of data written (i.e. the length of the | 200 | then the number of bytes of data written (i.e. the length of the |
201 | digest) will be written to the integer at | 201 | digest) will be written to the integer at |
202 | .Fa s , | 202 | .Fa s ; |
203 | at most | 203 | at most |
204 | .Dv EVP_MAX_MD_SIZE | 204 | .Dv EVP_MAX_MD_SIZE |
205 | bytes will be written. | 205 | bytes will be written. |
@@ -284,7 +284,7 @@ For example | |||
284 | .Fn EVP_MD_type EVP_sha1() | 284 | .Fn EVP_MD_type EVP_sha1() |
285 | returns | 285 | returns |
286 | .Dv NID_sha1 . | 286 | .Dv NID_sha1 . |
287 | This function is normally used when setting ASN1 OIDs. | 287 | This function is normally used when setting ASN.1 OIDs. |
288 | .Pp | 288 | .Pp |
289 | .Fn EVP_MD_CTX_md | 289 | .Fn EVP_MD_CTX_md |
290 | returns the | 290 | returns the |
@@ -324,7 +324,7 @@ return | |||
324 | structures for SHA1 digest algorithms but using DSS (DSA) for the | 324 | structures for SHA1 digest algorithms but using DSS (DSA) for the |
325 | signature algorithm. | 325 | signature algorithm. |
326 | Note: there is no need to use these pseudo-digests in OpenSSL 1.0.0 and | 326 | Note: there is no need to use these pseudo-digests in OpenSSL 1.0.0 and |
327 | later, they are however retained for compatibility. | 327 | later; they are however retained for compatibility. |
328 | .Pp | 328 | .Pp |
329 | .Fn EVP_md_null | 329 | .Fn EVP_md_null |
330 | is a "null" message digest that does nothing: | 330 | is a "null" message digest that does nothing: |
@@ -369,7 +369,7 @@ New applications should use | |||
369 | and | 369 | and |
370 | .Fn EVP_MD_CTX_copy_ex | 370 | .Fn EVP_MD_CTX_copy_ex |
371 | because they can efficiently reuse a digest context instead of | 371 | because they can efficiently reuse a digest context instead of |
372 | initializing and cleaning it up on each call and allow non default | 372 | initializing and cleaning it up on each call and allow non-default |
373 | implementations of digests to be specified. | 373 | implementations of digests to be specified. |
374 | .Pp | 374 | .Pp |
375 | In OpenSSL 0.9.7 and later if digest contexts are not cleaned up after | 375 | In OpenSSL 0.9.7 and later if digest contexts are not cleaned up after |
@@ -440,7 +440,7 @@ if an error occurs. | |||
440 | .Sh EXAMPLES | 440 | .Sh EXAMPLES |
441 | This example digests the data "Test Message\en" and "Hello World\en", | 441 | This example digests the data "Test Message\en" and "Hello World\en", |
442 | using the digest name passed on the command line. | 442 | using the digest name passed on the command line. |
443 | .Bd -literal | 443 | .Bd -literal -offset indent |
444 | #include <stdio.h> | 444 | #include <stdio.h> |
445 | #include <openssl/evp.h> | 445 | #include <openssl/evp.h> |
446 | 446 | ||
@@ -514,7 +514,7 @@ pointers in OpenSSL 0.9.7. | |||
514 | The link between digests and signing algorithms was fixed in OpenSSL 1.0 | 514 | The link between digests and signing algorithms was fixed in OpenSSL 1.0 |
515 | and later, so now | 515 | and later, so now |
516 | .Fn EVP_sha1 | 516 | .Fn EVP_sha1 |
517 | can be used with RSA and DSA, there is no need to use | 517 | can be used with RSA and DSA; there is no need to use |
518 | .Fn EVP_dss1 | 518 | .Fn EVP_dss1 |
519 | any more. | 519 | any more. |
520 | .Pp | 520 | .Pp |
diff --git a/src/lib/libcrypto/man/EVP_EncryptInit.3 b/src/lib/libcrypto/man/EVP_EncryptInit.3 index e786468550..3757bfc815 100644 --- a/src/lib/libcrypto/man/EVP_EncryptInit.3 +++ b/src/lib/libcrypto/man/EVP_EncryptInit.3 | |||
@@ -1,6 +1,6 @@ | |||
1 | .\" $OpenBSD: EVP_EncryptInit.3,v 1.2 2016/11/06 15:52:50 jmc Exp $ | 1 | .\" $OpenBSD: EVP_EncryptInit.3,v 1.3 2016/11/21 22:19:15 jmc Exp $ |
2 | .\" | 2 | .\" |
3 | .Dd $Mdocdate: November 6 2016 $ | 3 | .Dd $Mdocdate: November 21 2016 $ |
4 | .Dt EVP_ENCRYPTINIT 3 | 4 | .Dt EVP_ENCRYPTINIT 3 |
5 | .Os | 5 | .Os |
6 | .Sh NAME | 6 | .Sh NAME |
@@ -14,15 +14,16 @@ | |||
14 | .Nm EVP_CipherInit_ex , | 14 | .Nm EVP_CipherInit_ex , |
15 | .Nm EVP_CipherUpdate , | 15 | .Nm EVP_CipherUpdate , |
16 | .Nm EVP_CipherFinal_ex , | 16 | .Nm EVP_CipherFinal_ex , |
17 | .Nm EVP_CIPHER_CTX_set_key_length , | ||
18 | .Nm EVP_CIPHER_CTX_ctrl , | ||
19 | .Nm EVP_CIPHER_CTX_cleanup , | ||
20 | .Nm EVP_EncryptInit , | 17 | .Nm EVP_EncryptInit , |
21 | .Nm EVP_EncryptFinal , | 18 | .Nm EVP_EncryptFinal , |
22 | .Nm EVP_DecryptInit , | 19 | .Nm EVP_DecryptInit , |
23 | .Nm EVP_DecryptFinal , | 20 | .Nm EVP_DecryptFinal , |
24 | .Nm EVP_CipherInit , | 21 | .Nm EVP_CipherInit , |
25 | .Nm EVP_CipherFinal , | 22 | .Nm EVP_CipherFinal , |
23 | .Nm EVP_CIPHER_CTX_set_padding , | ||
24 | .Nm EVP_CIPHER_CTX_set_key_length , | ||
25 | .Nm EVP_CIPHER_CTX_ctrl , | ||
26 | .Nm EVP_CIPHER_CTX_cleanup , | ||
26 | .Nm EVP_get_cipherbyname , | 27 | .Nm EVP_get_cipherbyname , |
27 | .Nm EVP_get_cipherbynid , | 28 | .Nm EVP_get_cipherbynid , |
28 | .Nm EVP_get_cipherbyobj , | 29 | .Nm EVP_get_cipherbyobj , |
@@ -45,7 +46,6 @@ | |||
45 | .Nm EVP_CIPHER_CTX_mode , | 46 | .Nm EVP_CIPHER_CTX_mode , |
46 | .Nm EVP_CIPHER_param_to_asn1 , | 47 | .Nm EVP_CIPHER_param_to_asn1 , |
47 | .Nm EVP_CIPHER_asn1_to_param , | 48 | .Nm EVP_CIPHER_asn1_to_param , |
48 | .Nm EVP_CIPHER_CTX_set_padding , | ||
49 | .Nm EVP_enc_null , | 49 | .Nm EVP_enc_null , |
50 | .Nm EVP_des_cbc , | 50 | .Nm EVP_des_cbc , |
51 | .Nm EVP_des_ecb , | 51 | .Nm EVP_des_ecb , |
@@ -291,7 +291,8 @@ then the default implementation is used. | |||
291 | .Fa key | 291 | .Fa key |
292 | is the symmetric key to use and | 292 | is the symmetric key to use and |
293 | .Fa iv | 293 | .Fa iv |
294 | is the IV to use (if necessary), the actual number of bytes used for the | 294 | is the IV to use (if necessary). |
295 | The actual number of bytes used for the | ||
295 | key and IV depends on the cipher. | 296 | key and IV depends on the cipher. |
296 | It is possible to set all parameters to | 297 | It is possible to set all parameters to |
297 | .Dv NULL | 298 | .Dv NULL |
@@ -375,7 +376,7 @@ being supplied in a previous call). | |||
375 | .Pp | 376 | .Pp |
376 | .Fn EVP_CIPHER_CTX_cleanup | 377 | .Fn EVP_CIPHER_CTX_cleanup |
377 | clears all information from a cipher context and free up any allocated | 378 | clears all information from a cipher context and free up any allocated |
378 | memory associate with it. | 379 | memory associated with it. |
379 | It should be called after all operations using a cipher are complete so | 380 | It should be called after all operations using a cipher are complete so |
380 | sensitive information does not remain in memory. | 381 | sensitive information does not remain in memory. |
381 | .Pp | 382 | .Pp |
@@ -490,10 +491,10 @@ and | |||
490 | .Fn EVP_CIPHER_CTX_type | 491 | .Fn EVP_CIPHER_CTX_type |
491 | return the type of the passed cipher or context. | 492 | return the type of the passed cipher or context. |
492 | This "type" is the actual NID of the cipher OBJECT IDENTIFIER as such it | 493 | This "type" is the actual NID of the cipher OBJECT IDENTIFIER as such it |
493 | ignores the cipher parameters and 40 bit RC2 and 128 bit RC2 have the | 494 | ignores the cipher parameters and 40-bit RC2 and 128-bit RC2 have the |
494 | same NID. | 495 | same NID. |
495 | If the cipher does not have an object identifier or does not | 496 | If the cipher does not have an object identifier or does not |
496 | have ASN1 support this function will return | 497 | have ASN.1 support this function will return |
497 | .Dv NID_undef . | 498 | .Dv NID_undef . |
498 | .Pp | 499 | .Pp |
499 | .Fn EVP_CIPHER_CTX_cipher | 500 | .Fn EVP_CIPHER_CTX_cipher |
@@ -521,13 +522,14 @@ sets the AlgorithmIdentifier "parameter" based on the passed cipher. | |||
521 | This will typically include any parameters and an IV. | 522 | This will typically include any parameters and an IV. |
522 | The cipher IV (if any) must be set when this call is made. | 523 | The cipher IV (if any) must be set when this call is made. |
523 | This call should be made before the cipher is actually "used" (before any | 524 | This call should be made before the cipher is actually "used" (before any |
524 | .Fn EVP_EncryptUpdate , | 525 | .Fn EVP_EncryptUpdate |
526 | or | ||
525 | .Fn EVP_DecryptUpdate | 527 | .Fn EVP_DecryptUpdate |
526 | calls for example). | 528 | calls, for example). |
527 | This function may fail if the cipher does not have any ASN1 support. | 529 | This function may fail if the cipher does not have any ASN.1 support. |
528 | .Pp | 530 | .Pp |
529 | .Fn EVP_CIPHER_asn1_to_param | 531 | .Fn EVP_CIPHER_asn1_to_param |
530 | sets the cipher parameters based on an ASN1 AlgorithmIdentifier | 532 | sets the cipher parameters based on an ASN.1 AlgorithmIdentifier |
531 | "parameter". | 533 | "parameter". |
532 | The precise effect depends on the cipher. | 534 | The precise effect depends on the cipher. |
533 | In the case of RC2, for example, it will set the IV and effective | 535 | In the case of RC2, for example, it will set the IV and effective |
@@ -544,7 +546,7 @@ will be called and finally | |||
544 | again with all parameters except the key set to | 546 | again with all parameters except the key set to |
545 | .Dv NULL . | 547 | .Dv NULL . |
546 | It is possible for this function to fail if the cipher does not | 548 | It is possible for this function to fail if the cipher does not |
547 | have any ASN1 support or the parameters cannot be set (for example | 549 | have any ASN.1 support or the parameters cannot be set (for example |
548 | the RC2 effective key length is not supported). | 550 | the RC2 effective key length is not supported). |
549 | .Pp | 551 | .Pp |
550 | .Fn EVP_CIPHER_CTX_ctrl | 552 | .Fn EVP_CIPHER_CTX_ctrl |
@@ -720,7 +722,7 @@ DESX algorithm in CBC mode. | |||
720 | RC4 stream cipher. | 722 | RC4 stream cipher. |
721 | This is a variable key length cipher with default key length 128 bits. | 723 | This is a variable key length cipher with default key length 128 bits. |
722 | .It Fn EVP_rc4_40 void | 724 | .It Fn EVP_rc4_40 void |
723 | RC4 stream cipher with 40 bit key length. | 725 | RC4 stream cipher with 40-bit key length. |
724 | This is obsolete and new code should use | 726 | This is obsolete and new code should use |
725 | .Fn EVP_rc4 | 727 | .Fn EVP_rc4 |
726 | and the | 728 | and the |
@@ -785,31 +787,31 @@ By default the key length is set to 128 bits and 12 rounds. | |||
785 | .El | 787 | .El |
786 | .Sh EXAMPLES | 788 | .Sh EXAMPLES |
787 | Get the number of rounds used in RC5: | 789 | Get the number of rounds used in RC5: |
788 | .Bd -literal | 790 | .Bd -literal -offset indent |
789 | int nrounds; | 791 | int nrounds; |
790 | EVP_CIPHER_CTX_ctrl(ctx, EVP_CTRL_GET_RC5_ROUNDS, 0, &nrounds); | 792 | EVP_CIPHER_CTX_ctrl(ctx, EVP_CTRL_GET_RC5_ROUNDS, 0, &nrounds); |
791 | .Ed | 793 | .Ed |
792 | .Pp | 794 | .Pp |
793 | Get the RC2 effective key length: | 795 | Get the RC2 effective key length: |
794 | .Bd -literal | 796 | .Bd -literal -offset indent |
795 | int key_bits; | 797 | int key_bits; |
796 | EVP_CIPHER_CTX_ctrl(ctx, EVP_CTRL_GET_RC2_KEY_BITS, 0, &key_bits); | 798 | EVP_CIPHER_CTX_ctrl(ctx, EVP_CTRL_GET_RC2_KEY_BITS, 0, &key_bits); |
797 | .Ed | 799 | .Ed |
798 | .Pp | 800 | .Pp |
799 | Set the number of rounds used in RC5: | 801 | Set the number of rounds used in RC5: |
800 | .Bd -literal | 802 | .Bd -literal -offset indent |
801 | int nrounds; | 803 | int nrounds; |
802 | EVP_CIPHER_CTX_ctrl(ctx, EVP_CTRL_SET_RC5_ROUNDS, nrounds, NULL); | 804 | EVP_CIPHER_CTX_ctrl(ctx, EVP_CTRL_SET_RC5_ROUNDS, nrounds, NULL); |
803 | .Ed | 805 | .Ed |
804 | .Pp | 806 | .Pp |
805 | Set the effective key length used in RC2: | 807 | Set the effective key length used in RC2: |
806 | .Bd -literal | 808 | .Bd -literal -offset indent |
807 | int key_bits; | 809 | int key_bits; |
808 | EVP_CIPHER_CTX_ctrl(ctx, EVP_CTRL_SET_RC2_KEY_BITS, key_bits, NULL); | 810 | EVP_CIPHER_CTX_ctrl(ctx, EVP_CTRL_SET_RC2_KEY_BITS, key_bits, NULL); |
809 | .Ed | 811 | .Ed |
810 | .Pp | 812 | .Pp |
811 | Encrypt a string using blowfish: | 813 | Encrypt a string using blowfish: |
812 | .Bd -literal | 814 | .Bd -literal -offset 3n |
813 | int | 815 | int |
814 | do_crypt(char *outfile) | 816 | do_crypt(char *outfile) |
815 | { | 817 | { |
@@ -858,13 +860,13 @@ do_crypt(char *outfile) | |||
858 | The ciphertext from the above example can be decrypted using the | 860 | The ciphertext from the above example can be decrypted using the |
859 | .Xr openssl 1 | 861 | .Xr openssl 1 |
860 | utility with the command line: | 862 | utility with the command line: |
861 | .Bd -literal | 863 | .Bd -literal -offset indent |
862 | openssl bf -in cipher.bin -K 000102030405060708090A0B0C0D0E0F \e | 864 | openssl bf -in cipher.bin -K 000102030405060708090A0B0C0D0E0F \e |
863 | -iv 0102030405060708 -d | 865 | -iv 0102030405060708 -d |
864 | .Ed | 866 | .Ed |
865 | .Pp | 867 | .Pp |
866 | General encryption, decryption function example using FILE I/O and RC2 | 868 | General encryption, decryption function example using FILE I/O and RC2 |
867 | with an 80 bit key: | 869 | with an 80-bit key: |
868 | .Bd -literal | 870 | .Bd -literal |
869 | int | 871 | int |
870 | do_crypt(FILE *in, FILE *out, int do_encrypt) | 872 | do_crypt(FILE *in, FILE *out, int do_encrypt) |
@@ -937,6 +939,6 @@ as a fixed unsigned char array containing | |||
937 | .Dv EVP_MAX_KEY_LENGTH | 939 | .Dv EVP_MAX_KEY_LENGTH |
938 | bytes. | 940 | bytes. |
939 | .Pp | 941 | .Pp |
940 | The ASN1 code is incomplete (and sometimes inaccurate) it has only been | 942 | The ASN.1 code is incomplete (and sometimes inaccurate). |
941 | tested for certain common S/MIME ciphers (RC2, DES, triple DES) in CBC | 943 | It has only been tested for certain common S/MIME ciphers |
942 | mode. | 944 | (RC2, DES, triple DES) in CBC mode. |
diff --git a/src/lib/libcrypto/man/EVP_OpenInit.3 b/src/lib/libcrypto/man/EVP_OpenInit.3 index 02e79742ab..92f68d3cc0 100644 --- a/src/lib/libcrypto/man/EVP_OpenInit.3 +++ b/src/lib/libcrypto/man/EVP_OpenInit.3 | |||
@@ -1,4 +1,4 @@ | |||
1 | .\" $OpenBSD: EVP_OpenInit.3,v 1.3 2016/11/21 09:56:35 schwarze Exp $ | 1 | .\" $OpenBSD: EVP_OpenInit.3,v 1.4 2016/11/21 22:19:15 jmc Exp $ |
2 | .\" | 2 | .\" |
3 | .Dd $Mdocdate: November 21 2016 $ | 3 | .Dd $Mdocdate: November 21 2016 $ |
4 | .Dt EVP_OPENINIT 3 | 4 | .Dt EVP_OPENINIT 3 |
@@ -85,7 +85,7 @@ If the cipher is a fixed length cipher then the recovered key length | |||
85 | must match the fixed cipher length. | 85 | must match the fixed cipher length. |
86 | .Sh RETURN VALUES | 86 | .Sh RETURN VALUES |
87 | .Fn EVP_OpenInit | 87 | .Fn EVP_OpenInit |
88 | returns 0 on error or a non zero integer (actually the recovered secret | 88 | returns 0 on error or a non-zero integer (actually the recovered secret |
89 | key size) if successful. | 89 | key size) if successful. |
90 | .Pp | 90 | .Pp |
91 | .Fn EVP_OpenUpdate | 91 | .Fn EVP_OpenUpdate |
diff --git a/src/lib/libcrypto/man/EVP_PKEY_CTX_ctrl.3 b/src/lib/libcrypto/man/EVP_PKEY_CTX_ctrl.3 index 6715e11f41..149caa7316 100644 --- a/src/lib/libcrypto/man/EVP_PKEY_CTX_ctrl.3 +++ b/src/lib/libcrypto/man/EVP_PKEY_CTX_ctrl.3 | |||
@@ -1,6 +1,6 @@ | |||
1 | .\" $OpenBSD: EVP_PKEY_CTX_ctrl.3,v 1.3 2016/11/06 16:58:08 schwarze Exp $ | 1 | .\" $OpenBSD: EVP_PKEY_CTX_ctrl.3,v 1.4 2016/11/21 22:19:15 jmc Exp $ |
2 | .\" | 2 | .\" |
3 | .Dd $Mdocdate: November 6 2016 $ | 3 | .Dd $Mdocdate: November 21 2016 $ |
4 | .Dt EVP_PKEY_CTX_CTRL 3 | 4 | .Dt EVP_PKEY_CTX_CTRL 3 |
5 | .Os | 5 | .Os |
6 | .Sh NAME | 6 | .Sh NAME |
@@ -169,8 +169,8 @@ expected to be the algorithm identifier byte. | |||
169 | The | 169 | The |
170 | .Fn EVP_PKEY_CTX_set_rsa_pss_saltlen | 170 | .Fn EVP_PKEY_CTX_set_rsa_pss_saltlen |
171 | macro sets the RSA PSS salt length to | 171 | macro sets the RSA PSS salt length to |
172 | .Fa len | 172 | .Fa len . |
173 | as its name implies it is only supported for PSS padding. | 173 | As its name implies, it is only supported for PSS padding. |
174 | Two special values are supported: -1 sets the salt length to the digest | 174 | Two special values are supported: -1 sets the salt length to the digest |
175 | length. | 175 | length. |
176 | When signing -2 sets the salt length to the maximum permissible value. | 176 | When signing -2 sets the salt length to the maximum permissible value. |
diff --git a/src/lib/libcrypto/man/EVP_PKEY_CTX_new.3 b/src/lib/libcrypto/man/EVP_PKEY_CTX_new.3 index 03439d6658..63fefed9a3 100644 --- a/src/lib/libcrypto/man/EVP_PKEY_CTX_new.3 +++ b/src/lib/libcrypto/man/EVP_PKEY_CTX_new.3 | |||
@@ -1,6 +1,6 @@ | |||
1 | .\" $OpenBSD: EVP_PKEY_CTX_new.3,v 1.2 2016/11/06 15:52:50 jmc Exp $ | 1 | .\" $OpenBSD: EVP_PKEY_CTX_new.3,v 1.3 2016/11/21 22:19:15 jmc Exp $ |
2 | .\" | 2 | .\" |
3 | .Dd $Mdocdate: November 6 2016 $ | 3 | .Dd $Mdocdate: November 21 2016 $ |
4 | .Dt EVP_PKEY_CTX_NEW 3 | 4 | .Dt EVP_PKEY_CTX_NEW 3 |
5 | .Os | 5 | .Os |
6 | .Sh NAME | 6 | .Sh NAME |
@@ -62,10 +62,11 @@ frees up the context | |||
62 | .Sh RETURN VALUES | 62 | .Sh RETURN VALUES |
63 | .Fn EVP_PKEY_CTX_new , | 63 | .Fn EVP_PKEY_CTX_new , |
64 | .Fn EVP_PKEY_CTX_new_id , | 64 | .Fn EVP_PKEY_CTX_new_id , |
65 | and | ||
65 | .Fn EVP_PKEY_CTX_dup | 66 | .Fn EVP_PKEY_CTX_dup |
66 | returns either the newly allocated | 67 | return either the newly allocated |
67 | .Vt EVP_PKEY_CTX | 68 | .Vt EVP_PKEY_CTX |
68 | structure of | 69 | structure or |
69 | .Dv NULL | 70 | .Dv NULL |
70 | if an error occurred. | 71 | if an error occurred. |
71 | .Pp | 72 | .Pp |
diff --git a/src/lib/libcrypto/man/EVP_PKEY_cmp.3 b/src/lib/libcrypto/man/EVP_PKEY_cmp.3 index 2e366402ca..d06d0e8a35 100644 --- a/src/lib/libcrypto/man/EVP_PKEY_cmp.3 +++ b/src/lib/libcrypto/man/EVP_PKEY_cmp.3 | |||
@@ -1,11 +1,11 @@ | |||
1 | .\" $OpenBSD: EVP_PKEY_cmp.3,v 1.2 2016/11/06 15:52:50 jmc Exp $ | 1 | .\" $OpenBSD: EVP_PKEY_cmp.3,v 1.3 2016/11/21 22:19:15 jmc Exp $ |
2 | .\" | 2 | .\" |
3 | .Dd $Mdocdate: November 6 2016 $ | 3 | .Dd $Mdocdate: November 21 2016 $ |
4 | .Dt EVP_PKEY_CMP 3 | 4 | .Dt EVP_PKEY_CMP 3 |
5 | .Os | 5 | .Os |
6 | .Sh NAME | 6 | .Sh NAME |
7 | .Nm EVP_PKEY_copy_parameters , | ||
8 | .Nm EVP_PKEY_missing_parameters , | 7 | .Nm EVP_PKEY_missing_parameters , |
8 | .Nm EVP_PKEY_copy_parameters , | ||
9 | .Nm EVP_PKEY_cmp_parameters , | 9 | .Nm EVP_PKEY_cmp_parameters , |
10 | .Nm EVP_PKEY_cmp | 10 | .Nm EVP_PKEY_cmp |
11 | .Nd public key parameter and comparison functions | 11 | .Nd public key parameter and comparison functions |
@@ -83,7 +83,7 @@ The function | |||
83 | .Fn EVP_PKEY_copy_parameters | 83 | .Fn EVP_PKEY_copy_parameters |
84 | returns 1 for success and 0 for failure. | 84 | returns 1 for success and 0 for failure. |
85 | .Pp | 85 | .Pp |
86 | The function | 86 | The functions |
87 | .Fn EVP_PKEY_cmp_parameters | 87 | .Fn EVP_PKEY_cmp_parameters |
88 | and | 88 | and |
89 | .Fn EVP_PKEY_cmp | 89 | .Fn EVP_PKEY_cmp |
diff --git a/src/lib/libcrypto/man/EVP_PKEY_decrypt.3 b/src/lib/libcrypto/man/EVP_PKEY_decrypt.3 index f8d29fbef2..15e44a6510 100644 --- a/src/lib/libcrypto/man/EVP_PKEY_decrypt.3 +++ b/src/lib/libcrypto/man/EVP_PKEY_decrypt.3 | |||
@@ -1,6 +1,6 @@ | |||
1 | .\" $OpenBSD: EVP_PKEY_decrypt.3,v 1.2 2016/11/06 15:52:50 jmc Exp $ | 1 | .\" $OpenBSD: EVP_PKEY_decrypt.3,v 1.3 2016/11/21 22:19:15 jmc Exp $ |
2 | .\" | 2 | .\" |
3 | .Dd $Mdocdate: November 6 2016 $ | 3 | .Dd $Mdocdate: November 21 2016 $ |
4 | .Dt EVP_PKEY_DECRYPT 3 | 4 | .Dt EVP_PKEY_DECRYPT 3 |
5 | .Os | 5 | .Os |
6 | .Sh NAME | 6 | .Sh NAME |
@@ -52,7 +52,8 @@ then before the call the | |||
52 | .Fa outlen | 52 | .Fa outlen |
53 | parameter should contain the length of the | 53 | parameter should contain the length of the |
54 | .Fa out | 54 | .Fa out |
55 | buffer, if the call is successful the decrypted data is written to | 55 | buffer. |
56 | If the call is successful the decrypted data is written to | ||
56 | .Fa out | 57 | .Fa out |
57 | and the amount of data written to | 58 | and the amount of data written to |
58 | .Fa outlen . | 59 | .Fa outlen . |
@@ -75,7 +76,7 @@ In particular, a return value of -2 indicates the operation is not | |||
75 | supported by the public key algorithm. | 76 | supported by the public key algorithm. |
76 | .Sh EXAMPLES | 77 | .Sh EXAMPLES |
77 | Decrypt data using OAEP (for RSA keys): | 78 | Decrypt data using OAEP (for RSA keys): |
78 | .Bd -literal | 79 | .Bd -literal -offset indent |
79 | #include <openssl/evp.h> | 80 | #include <openssl/evp.h> |
80 | #include <openssl/rsa.h> | 81 | #include <openssl/rsa.h> |
81 | 82 | ||
diff --git a/src/lib/libcrypto/man/EVP_PKEY_derive.3 b/src/lib/libcrypto/man/EVP_PKEY_derive.3 index e29587be7e..e449a91439 100644 --- a/src/lib/libcrypto/man/EVP_PKEY_derive.3 +++ b/src/lib/libcrypto/man/EVP_PKEY_derive.3 | |||
@@ -1,6 +1,6 @@ | |||
1 | .\" $OpenBSD: EVP_PKEY_derive.3,v 1.2 2016/11/06 15:52:50 jmc Exp $ | 1 | .\" $OpenBSD: EVP_PKEY_derive.3,v 1.3 2016/11/21 22:19:15 jmc Exp $ |
2 | .\" | 2 | .\" |
3 | .Dd $Mdocdate: November 6 2016 $ | 3 | .Dd $Mdocdate: November 21 2016 $ |
4 | .Dt EVP_PKEY_DERIVE 3 | 4 | .Dt EVP_PKEY_DERIVE 3 |
5 | .Os | 5 | .Os |
6 | .Sh NAME | 6 | .Sh NAME |
@@ -38,7 +38,7 @@ function sets the peer key: this will normally be a public key. | |||
38 | .Pp | 38 | .Pp |
39 | The | 39 | The |
40 | .Fn EVP_PKEY_derive | 40 | .Fn EVP_PKEY_derive |
41 | derives a shared secret using | 41 | function derives a shared secret using |
42 | .Fa ctx . | 42 | .Fa ctx . |
43 | If | 43 | If |
44 | .Fa key | 44 | .Fa key |
@@ -79,7 +79,7 @@ In particular, a return value of -2 indicates the operation is not | |||
79 | supported by the public key algorithm. | 79 | supported by the public key algorithm. |
80 | .Sh EXAMPLES | 80 | .Sh EXAMPLES |
81 | Derive shared secret (for example DH or EC keys): | 81 | Derive shared secret (for example DH or EC keys): |
82 | .Bd -literal | 82 | .Bd -literal -offset indent |
83 | #include <openssl/evp.h> | 83 | #include <openssl/evp.h> |
84 | #include <openssl/rsa.h> | 84 | #include <openssl/rsa.h> |
85 | 85 | ||
diff --git a/src/lib/libcrypto/man/EVP_PKEY_encrypt.3 b/src/lib/libcrypto/man/EVP_PKEY_encrypt.3 index 8edd53745d..0e1c72e270 100644 --- a/src/lib/libcrypto/man/EVP_PKEY_encrypt.3 +++ b/src/lib/libcrypto/man/EVP_PKEY_encrypt.3 | |||
@@ -1,6 +1,6 @@ | |||
1 | .\" $OpenBSD: EVP_PKEY_encrypt.3,v 1.2 2016/11/06 15:52:50 jmc Exp $ | 1 | .\" $OpenBSD: EVP_PKEY_encrypt.3,v 1.3 2016/11/21 22:19:15 jmc Exp $ |
2 | .\" | 2 | .\" |
3 | .Dd $Mdocdate: November 6 2016 $ | 3 | .Dd $Mdocdate: November 21 2016 $ |
4 | .Dt EVP_PKEY_ENCRYPT 3 | 4 | .Dt EVP_PKEY_ENCRYPT 3 |
5 | .Os | 5 | .Os |
6 | .Sh NAME | 6 | .Sh NAME |
@@ -52,7 +52,8 @@ then before the call the | |||
52 | .Fa outlen | 52 | .Fa outlen |
53 | parameter should contain the length of the | 53 | parameter should contain the length of the |
54 | .Fa out | 54 | .Fa out |
55 | buffer, if the call is successful the encrypted data is written to | 55 | buffer. |
56 | If the call is successful the encrypted data is written to | ||
56 | .Fa out | 57 | .Fa out |
57 | and the amount of data written to | 58 | and the amount of data written to |
58 | .Fa outlen . | 59 | .Fa outlen . |
@@ -75,7 +76,7 @@ In particular, a return value of -2 indicates the operation is not | |||
75 | supported by the public key algorithm. | 76 | supported by the public key algorithm. |
76 | .Sh EXAMPLES | 77 | .Sh EXAMPLES |
77 | Encrypt data using OAEP (for RSA keys): | 78 | Encrypt data using OAEP (for RSA keys): |
78 | .Bd -literal | 79 | .Bd -literal -offset indent |
79 | #include <openssl/evp.h> | 80 | #include <openssl/evp.h> |
80 | #include <openssl/rsa.h> | 81 | #include <openssl/rsa.h> |
81 | 82 | ||
diff --git a/src/lib/libcrypto/man/EVP_PKEY_keygen.3 b/src/lib/libcrypto/man/EVP_PKEY_keygen.3 index c464924384..fd64e1eb66 100644 --- a/src/lib/libcrypto/man/EVP_PKEY_keygen.3 +++ b/src/lib/libcrypto/man/EVP_PKEY_keygen.3 | |||
@@ -1,6 +1,6 @@ | |||
1 | .\" $OpenBSD: EVP_PKEY_keygen.3,v 1.2 2016/11/06 15:52:50 jmc Exp $ | 1 | .\" $OpenBSD: EVP_PKEY_keygen.3,v 1.3 2016/11/21 22:19:15 jmc Exp $ |
2 | .\" | 2 | .\" |
3 | .Dd $Mdocdate: November 6 2016 $ | 3 | .Dd $Mdocdate: November 21 2016 $ |
4 | .Dt EVP_PKEY_KEYGEN 3 | 4 | .Dt EVP_PKEY_KEYGEN 3 |
5 | .Os | 5 | .Os |
6 | .Sh NAME | 6 | .Sh NAME |
@@ -70,8 +70,8 @@ for a key generation operation. | |||
70 | .Pp | 70 | .Pp |
71 | The | 71 | The |
72 | .Fn EVP_PKEY_keygen | 72 | .Fn EVP_PKEY_keygen |
73 | function performs a key generation operation, the generated key is | 73 | function performs a key generation operation. |
74 | written to | 74 | The generated key is written to |
75 | .Fa ppkey . | 75 | .Fa ppkey . |
76 | .Pp | 76 | .Pp |
77 | The functions | 77 | The functions |
@@ -94,7 +94,7 @@ returns parameters associated with the generation operation. | |||
94 | If | 94 | If |
95 | .Fa idx | 95 | .Fa idx |
96 | is -1, the total number of parameters available is returned. | 96 | is -1, the total number of parameters available is returned. |
97 | Any non negative value returns the value of that parameter. | 97 | Any non-negative value returns the value of that parameter. |
98 | .Fn EVP_PKEY_CTX_get_keygen_info | 98 | .Fn EVP_PKEY_CTX_get_keygen_info |
99 | with a non-negative value for | 99 | with a non-negative value for |
100 | .Fa idx | 100 | .Fa idx |
@@ -159,8 +159,8 @@ return 1 for success and 0 or a negative value for failure. | |||
159 | In particular, a return value of -2 indicates the operation is not | 159 | In particular, a return value of -2 indicates the operation is not |
160 | supported by the public key algorithm. | 160 | supported by the public key algorithm. |
161 | .Sh EXAMPLES | 161 | .Sh EXAMPLES |
162 | Generate a 2048 bit RSA key: | 162 | Generate a 2048-bit RSA key: |
163 | .Bd -literal | 163 | .Bd -literal -offset indent |
164 | #include <openssl/evp.h> | 164 | #include <openssl/evp.h> |
165 | #include <openssl/rsa.h> | 165 | #include <openssl/rsa.h> |
166 | 166 | ||
@@ -180,7 +180,7 @@ if (EVP_PKEY_keygen(ctx, &pkey) <= 0) | |||
180 | .Ed | 180 | .Ed |
181 | .Pp | 181 | .Pp |
182 | Generate a key from a set of parameters: | 182 | Generate a key from a set of parameters: |
183 | .Bd -literal | 183 | .Bd -literal -offset indent |
184 | #include <openssl/evp.h> | 184 | #include <openssl/evp.h> |
185 | #include <openssl/rsa.h> | 185 | #include <openssl/rsa.h> |
186 | 186 | ||
@@ -199,7 +199,7 @@ if (EVP_PKEY_keygen(ctx, &pkey) <= 0) | |||
199 | .Ed | 199 | .Ed |
200 | .Pp | 200 | .Pp |
201 | Example of generation callback for OpenSSL public key implementations: | 201 | Example of generation callback for OpenSSL public key implementations: |
202 | .Bd -literal | 202 | .Bd -literal -offset indent |
203 | /* Application data is a BIO to output status to */ | 203 | /* Application data is a BIO to output status to */ |
204 | 204 | ||
205 | EVP_PKEY_CTX_set_app_data(ctx, status_bio); | 205 | EVP_PKEY_CTX_set_app_data(ctx, status_bio); |
diff --git a/src/lib/libcrypto/man/EVP_PKEY_print_private.3 b/src/lib/libcrypto/man/EVP_PKEY_print_private.3 index a271835f9c..0f8a74cb9c 100644 --- a/src/lib/libcrypto/man/EVP_PKEY_print_private.3 +++ b/src/lib/libcrypto/man/EVP_PKEY_print_private.3 | |||
@@ -1,6 +1,6 @@ | |||
1 | .\" $OpenBSD: EVP_PKEY_print_private.3,v 1.2 2016/11/06 15:52:50 jmc Exp $ | 1 | .\" $OpenBSD: EVP_PKEY_print_private.3,v 1.3 2016/11/21 22:19:15 jmc Exp $ |
2 | .\" | 2 | .\" |
3 | .Dd $Mdocdate: November 6 2016 $ | 3 | .Dd $Mdocdate: November 21 2016 $ |
4 | .Dt EVP_PKEY_PRINT_PRIVATE 3 | 4 | .Dt EVP_PKEY_PRINT_PRIVATE 3 |
5 | .Os | 5 | .Os |
6 | .Sh NAME | 6 | .Sh NAME |
@@ -50,7 +50,7 @@ indicates how far the printout should be indented. | |||
50 | .Pp | 50 | .Pp |
51 | The | 51 | The |
52 | .Fa pctx | 52 | .Fa pctx |
53 | parameter allows the print output to be finely tuned by using ASN1 | 53 | parameter allows the print output to be finely tuned by using ASN.1 |
54 | printing options. | 54 | printing options. |
55 | If | 55 | If |
56 | .Fa pctx | 56 | .Fa pctx |
diff --git a/src/lib/libcrypto/man/EVP_PKEY_sign.3 b/src/lib/libcrypto/man/EVP_PKEY_sign.3 index 8ed1432618..82f4c1b8ad 100644 --- a/src/lib/libcrypto/man/EVP_PKEY_sign.3 +++ b/src/lib/libcrypto/man/EVP_PKEY_sign.3 | |||
@@ -1,6 +1,6 @@ | |||
1 | .\" $OpenBSD: EVP_PKEY_sign.3,v 1.2 2016/11/06 15:52:50 jmc Exp $ | 1 | .\" $OpenBSD: EVP_PKEY_sign.3,v 1.3 2016/11/21 22:19:15 jmc Exp $ |
2 | .\" | 2 | .\" |
3 | .Dd $Mdocdate: November 6 2016 $ | 3 | .Dd $Mdocdate: November 21 2016 $ |
4 | .Dt EVP_PKEY_SIGN 3 | 4 | .Dt EVP_PKEY_SIGN 3 |
5 | .Os | 5 | .Os |
6 | .Sh NAME | 6 | .Sh NAME |
@@ -76,7 +76,7 @@ In particular, a return value of -2 indicates the operation is not | |||
76 | supported by the public key algorithm. | 76 | supported by the public key algorithm. |
77 | .Sh EXAMPLES | 77 | .Sh EXAMPLES |
78 | Sign data using RSA with PKCS#1 padding and SHA256 digest: | 78 | Sign data using RSA with PKCS#1 padding and SHA256 digest: |
79 | .Bd -literal | 79 | .Bd -literal -offset indent |
80 | #include <openssl/evp.h> | 80 | #include <openssl/evp.h> |
81 | #include <openssl/rsa.h> | 81 | #include <openssl/rsa.h> |
82 | 82 | ||
diff --git a/src/lib/libcrypto/man/EVP_PKEY_verify.3 b/src/lib/libcrypto/man/EVP_PKEY_verify.3 index faf2dca1f6..70f9c31d51 100644 --- a/src/lib/libcrypto/man/EVP_PKEY_verify.3 +++ b/src/lib/libcrypto/man/EVP_PKEY_verify.3 | |||
@@ -1,6 +1,6 @@ | |||
1 | .\" $OpenBSD: EVP_PKEY_verify.3,v 1.2 2016/11/06 15:52:50 jmc Exp $ | 1 | .\" $OpenBSD: EVP_PKEY_verify.3,v 1.3 2016/11/21 22:19:15 jmc Exp $ |
2 | .\" | 2 | .\" |
3 | .Dd $Mdocdate: November 6 2016 $ | 3 | .Dd $Mdocdate: November 21 2016 $ |
4 | .Dt EVP_PKEY_VERIFY 3 | 4 | .Dt EVP_PKEY_VERIFY 3 |
5 | .Os | 5 | .Os |
6 | .Sh NAME | 6 | .Sh NAME |
@@ -72,7 +72,7 @@ In particular, a return value of -2 indicates the operation is not | |||
72 | supported by the public key algorithm. | 72 | supported by the public key algorithm. |
73 | .Sh EXAMPLES | 73 | .Sh EXAMPLES |
74 | Verify signature using PKCS#1 and SHA256 digest: | 74 | Verify signature using PKCS#1 and SHA256 digest: |
75 | .Bd -literal | 75 | .Bd -literal -offset 3n |
76 | #include <openssl/evp.h> | 76 | #include <openssl/evp.h> |
77 | #include <openssl/rsa.h> | 77 | #include <openssl/rsa.h> |
78 | 78 | ||
diff --git a/src/lib/libcrypto/man/EVP_PKEY_verify_recover.3 b/src/lib/libcrypto/man/EVP_PKEY_verify_recover.3 index d1cedadef4..12db9259ae 100644 --- a/src/lib/libcrypto/man/EVP_PKEY_verify_recover.3 +++ b/src/lib/libcrypto/man/EVP_PKEY_verify_recover.3 | |||
@@ -1,6 +1,6 @@ | |||
1 | .\" $OpenBSD: EVP_PKEY_verify_recover.3,v 1.3 2016/11/06 15:52:50 jmc Exp $ | 1 | .\" $OpenBSD: EVP_PKEY_verify_recover.3,v 1.4 2016/11/21 22:19:15 jmc Exp $ |
2 | .\" | 2 | .\" |
3 | .Dd $Mdocdate: November 6 2016 $ | 3 | .Dd $Mdocdate: November 21 2016 $ |
4 | .Dt EVP_PKEY_VERIFY_RECOVER 3 | 4 | .Dt EVP_PKEY_VERIFY_RECOVER 3 |
5 | .Os | 5 | .Os |
6 | .Sh NAME | 6 | .Sh NAME |
@@ -87,7 +87,7 @@ In particular, a return value of -2 indicates the operation is not | |||
87 | supported by the public key algorithm. | 87 | supported by the public key algorithm. |
88 | .Sh EXAMPLES | 88 | .Sh EXAMPLES |
89 | Recover digest originally signed using PKCS#1 and SHA256 digest: | 89 | Recover digest originally signed using PKCS#1 and SHA256 digest: |
90 | .Bd -literal | 90 | .Bd -literal -offset indent |
91 | #include <openssl/evp.h> | 91 | #include <openssl/evp.h> |
92 | #include <openssl/rsa.h> | 92 | #include <openssl/rsa.h> |
93 | 93 | ||
diff --git a/src/lib/libcrypto/man/EVP_SealInit.3 b/src/lib/libcrypto/man/EVP_SealInit.3 index 75113fcbe8..983b648297 100644 --- a/src/lib/libcrypto/man/EVP_SealInit.3 +++ b/src/lib/libcrypto/man/EVP_SealInit.3 | |||
@@ -1,4 +1,4 @@ | |||
1 | .\" $OpenBSD: EVP_SealInit.3,v 1.3 2016/11/21 09:56:35 schwarze Exp $ | 1 | .\" $OpenBSD: EVP_SealInit.3,v 1.4 2016/11/21 22:19:15 jmc Exp $ |
2 | .\" | 2 | .\" |
3 | .Dd $Mdocdate: November 21 2016 $ | 3 | .Dd $Mdocdate: November 21 2016 $ |
4 | .Dt EVP_SEALINIT 3 | 4 | .Dt EVP_SEALINIT 3 |
@@ -49,7 +49,7 @@ for encryption with cipher | |||
49 | using a random secret key and IV. | 49 | using a random secret key and IV. |
50 | .Fa type | 50 | .Fa type |
51 | is normally supplied by a function such as | 51 | is normally supplied by a function such as |
52 | .Fn EVP_aes_256_cbc 3 ; | 52 | .Fn EVP_aes_256_cbc ; |
53 | see | 53 | see |
54 | .Xr EVP_EncryptInit 3 | 54 | .Xr EVP_EncryptInit 3 |
55 | for details. | 55 | for details. |
diff --git a/src/lib/libcrypto/man/EVP_SignInit.3 b/src/lib/libcrypto/man/EVP_SignInit.3 index c18b074b6d..0a76dd7eaf 100644 --- a/src/lib/libcrypto/man/EVP_SignInit.3 +++ b/src/lib/libcrypto/man/EVP_SignInit.3 | |||
@@ -1,12 +1,13 @@ | |||
1 | .\" $OpenBSD: EVP_SignInit.3,v 1.2 2016/11/06 15:52:50 jmc Exp $ | 1 | .\" $OpenBSD: EVP_SignInit.3,v 1.3 2016/11/21 22:19:15 jmc Exp $ |
2 | .\" | 2 | .\" |
3 | .Dd $Mdocdate: November 6 2016 $ | 3 | .Dd $Mdocdate: November 21 2016 $ |
4 | .Dt EVP_SIGNINIT 3 | 4 | .Dt EVP_SIGNINIT 3 |
5 | .Os | 5 | .Os |
6 | .Sh NAME | 6 | .Sh NAME |
7 | .Nm EVP_SignInit , | 7 | .Nm EVP_SignInit_ex , |
8 | .Nm EVP_SignUpdate , | 8 | .Nm EVP_SignUpdate , |
9 | .Nm EVP_SignFinal , | 9 | .Nm EVP_SignFinal , |
10 | .Nm EVP_SignInit , | ||
10 | .Nm EVP_PKEY_size | 11 | .Nm EVP_PKEY_size |
11 | .Nd EVP signing functions | 12 | .Nd EVP signing functions |
12 | .Sh SYNOPSIS | 13 | .Sh SYNOPSIS |
@@ -80,7 +81,7 @@ must be at least | |||
80 | bytes in size. | 81 | bytes in size. |
81 | .Fa s | 82 | .Fa s |
82 | is an OUT parameter, and not used as an IN parameter. | 83 | is an OUT parameter, and not used as an IN parameter. |
83 | The number of bytes of data written (i.e. | 84 | The number of bytes of data written (i.e.\& |
84 | the length of the signature) will be written to the integer at | 85 | the length of the signature) will be written to the integer at |
85 | .Fa s . | 86 | .Fa s . |
86 | At most | 87 | At most |
@@ -164,6 +165,4 @@ amounts of data have been passed through | |||
164 | It is not possible to change the signing parameters using these | 165 | It is not possible to change the signing parameters using these |
165 | function. | 166 | function. |
166 | .Pp | 167 | .Pp |
167 | The previous two bugs are fixed in the newer | 168 | The previous two bugs are fixed in the newer EVP_SignDigest* function. |
168 | .Xr EVP_SignDigest* 3 | ||
169 | function. | ||
diff --git a/src/lib/libcrypto/man/EVP_VerifyInit.3 b/src/lib/libcrypto/man/EVP_VerifyInit.3 index cec803136e..ab43e4faf2 100644 --- a/src/lib/libcrypto/man/EVP_VerifyInit.3 +++ b/src/lib/libcrypto/man/EVP_VerifyInit.3 | |||
@@ -1,12 +1,13 @@ | |||
1 | .\" $OpenBSD: EVP_VerifyInit.3,v 1.2 2016/11/06 15:52:50 jmc Exp $ | 1 | .\" $OpenBSD: EVP_VerifyInit.3,v 1.3 2016/11/21 22:19:15 jmc Exp $ |
2 | .\" | 2 | .\" |
3 | .Dd $Mdocdate: November 6 2016 $ | 3 | .Dd $Mdocdate: November 21 2016 $ |
4 | .Dt EVP_VERIFYINIT 3 | 4 | .Dt EVP_VERIFYINIT 3 |
5 | .Os | 5 | .Os |
6 | .Sh NAME | 6 | .Sh NAME |
7 | .Nm EVP_VerifyInit , | 7 | .Nm EVP_VerifyInit_ex , |
8 | .Nm EVP_VerifyUpdate , | 8 | .Nm EVP_VerifyUpdate , |
9 | .Nm EVP_VerifyFinal | 9 | .Nm EVP_VerifyFinal , |
10 | .Nm EVP_VerifyInit | ||
10 | .Nd EVP signature verification functions | 11 | .Nd EVP signature verification functions |
11 | .Sh SYNOPSIS | 12 | .Sh SYNOPSIS |
12 | .In openssl/evp.h | 13 | .In openssl/evp.h |
diff --git a/src/lib/libcrypto/man/bn_dump.3 b/src/lib/libcrypto/man/bn_dump.3 index 73f0cfe23f..9c4b06e9b3 100644 --- a/src/lib/libcrypto/man/bn_dump.3 +++ b/src/lib/libcrypto/man/bn_dump.3 | |||
@@ -1,6 +1,6 @@ | |||
1 | .\" $OpenBSD: bn_dump.3,v 1.2 2015/11/12 09:51:55 jmc Exp $ | 1 | .\" $OpenBSD: bn_dump.3,v 1.3 2016/11/21 22:19:15 jmc Exp $ |
2 | .\" | 2 | .\" |
3 | .Dd $Mdocdate: November 12 2015 $ | 3 | .Dd $Mdocdate: November 21 2016 $ |
4 | .Dt BN_DUMP 3 | 4 | .Dt BN_DUMP 3 |
5 | .Os | 5 | .Os |
6 | .Sh NAME | 6 | .Sh NAME |
@@ -327,7 +327,7 @@ This structure contains BN_CTX_NUM | |||
327 | .Vt BIGNUM Ns s, | 327 | .Vt BIGNUM Ns s, |
328 | see | 328 | see |
329 | .Xr BN_CTX_start 3 . | 329 | .Xr BN_CTX_start 3 . |
330 | .Ss Low-level arithmetic operations | 330 | .Ss Low level arithmetic operations |
331 | These functions are implemented in C and for several platforms in | 331 | These functions are implemented in C and for several platforms in |
332 | assembly language: | 332 | assembly language: |
333 | .Pp | 333 | .Pp |
diff --git a/src/lib/libcrypto/man/evp.3 b/src/lib/libcrypto/man/evp.3 index 832009f3a0..6666d47939 100644 --- a/src/lib/libcrypto/man/evp.3 +++ b/src/lib/libcrypto/man/evp.3 | |||
@@ -1,15 +1,15 @@ | |||
1 | .\" $OpenBSD: evp.3,v 1.2 2016/11/06 15:52:50 jmc Exp $ | 1 | .\" $OpenBSD: evp.3,v 1.3 2016/11/21 22:19:15 jmc Exp $ |
2 | .\" | 2 | .\" |
3 | .Dd $Mdocdate: November 6 2016 $ | 3 | .Dd $Mdocdate: November 21 2016 $ |
4 | .Dt EVP 3 | 4 | .Dt EVP 3 |
5 | .Os | 5 | .Os |
6 | .Sh NAME | 6 | .Sh NAME |
7 | .Nm evp | 7 | .Nm evp |
8 | .Nd high-level cryptographic functions | 8 | .Nd high level cryptographic functions |
9 | .Sh SYNOPSIS | 9 | .Sh SYNOPSIS |
10 | .In openssl/evp.h | 10 | .In openssl/evp.h |
11 | .Sh DESCRIPTION | 11 | .Sh DESCRIPTION |
12 | The EVP library provides a high-level interface to cryptographic | 12 | The EVP library provides a high level interface to cryptographic |
13 | functions. | 13 | functions. |
14 | .Pp | 14 | .Pp |
15 | .Xr EVP_SealInit 3 | 15 | .Xr EVP_SealInit 3 |