summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjmc <>2016-11-21 22:19:15 +0000
committerjmc <>2016-11-21 22:19:15 +0000
commitf3924d02d50eef96d8e3498921ed3ea2a635859b (patch)
tree4f2ead661ef1282b4d3b9864c0b0a6c1f1509065
parent67d9e3da39b97c33cb856ba418ad6f98cd957912 (diff)
downloadopenbsd-f3924d02d50eef96d8e3498921ed3ea2a635859b.tar.gz
openbsd-f3924d02d50eef96d8e3498921ed3ea2a635859b.tar.bz2
openbsd-f3924d02d50eef96d8e3498921ed3ea2a635859b.zip
various cleanup;
-rw-r--r--src/lib/libcrypto/man/EC_GROUP_copy.36
-rw-r--r--src/lib/libcrypto/man/EVP_AEAD_CTX_init.313
-rw-r--r--src/lib/libcrypto/man/EVP_BytesToKey.312
-rw-r--r--src/lib/libcrypto/man/EVP_DigestInit.336
-rw-r--r--src/lib/libcrypto/man/EVP_EncryptInit.354
-rw-r--r--src/lib/libcrypto/man/EVP_OpenInit.34
-rw-r--r--src/lib/libcrypto/man/EVP_PKEY_CTX_ctrl.38
-rw-r--r--src/lib/libcrypto/man/EVP_PKEY_CTX_new.39
-rw-r--r--src/lib/libcrypto/man/EVP_PKEY_cmp.38
-rw-r--r--src/lib/libcrypto/man/EVP_PKEY_decrypt.39
-rw-r--r--src/lib/libcrypto/man/EVP_PKEY_derive.38
-rw-r--r--src/lib/libcrypto/man/EVP_PKEY_encrypt.39
-rw-r--r--src/lib/libcrypto/man/EVP_PKEY_keygen.318
-rw-r--r--src/lib/libcrypto/man/EVP_PKEY_print_private.36
-rw-r--r--src/lib/libcrypto/man/EVP_PKEY_sign.36
-rw-r--r--src/lib/libcrypto/man/EVP_PKEY_verify.36
-rw-r--r--src/lib/libcrypto/man/EVP_PKEY_verify_recover.36
-rw-r--r--src/lib/libcrypto/man/EVP_SealInit.34
-rw-r--r--src/lib/libcrypto/man/EVP_SignInit.313
-rw-r--r--src/lib/libcrypto/man/EVP_VerifyInit.39
-rw-r--r--src/lib/libcrypto/man/bn_dump.36
-rw-r--r--src/lib/libcrypto/man/evp.38
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.
313The function 313The function
314.Fn EC_GROUP_check 314.Fn EC_GROUP_check
315performs a number of checks on a curve to verify that it is valid. 315performs a number of checks on a curve to verify that it is valid.
316Checks performed include verifying that the discriminant is non zero; 316Checks performed include verifying that the discriminant is non-zero;
317that a generator has been defined; that the generator is on the curve 317that a generator has been defined; that the generator is on the curve
318and has the correct order. 318and 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
184should be the 184should be the
185.Fa in_len 185.Fa in_len
186plus the result of 186plus the result of
187.Xr EVP_AEAD_overhead 3 . 187.Fn EVP_AEAD_max_overhead .
188On successful return, 188On successful return,
189.Fa out_len 189.Fa out_len
190is set to the actual number of bytes written. 190is 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
238variants or to the low level interfaces. 238variants or to the low level interfaces.
239This is because the code then becomes transparent to the AEAD cipher 239This is because the code then becomes transparent to the AEAD cipher
240used and much more flexible, 240used and much more flexible.
241it is also safer to use as it prevents common mistakes with the native APIs. 241It 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
262returns the length of the per-message nonce. 262returns the length of the per-message nonce.
263.Sh EXAMPLES 263.Sh EXAMPLES
264Encrypt a string using ChaCha20-Poly1305: 264Encrypt a string using ChaCha20-Poly1305:
265.Bd -literal 265.Bd -literal -offset indent
266.\" XXX
267const EVP_AEAD *aead = EVP_aead_chacha20_poly1305(); 266const EVP_AEAD *aead = EVP_aead_chacha20_poly1305();
268static const unsigned char nonce[32] = {0}; 267static const unsigned char nonce[32] = {0};
269size_t buf_len, nonce_len; 268size_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.
28is the message digest to use. 28is the message digest to use.
29The 29The
30.Fa salt 30.Fa salt
31parameter is used as a salt in the derivation: it should point to an 8 31parameter is used as a salt in the derivation:
32byte buffer or 32it should point to an 8-byte buffer or
33.Dv NULL 33.Dv NULL
34if no salt is used. 34if no salt is used.
35.Fa data 35.Fa data
@@ -51,18 +51,18 @@ parameter.
51.Pp 51.Pp
52Increasing the 52Increasing the
53.Fa count 53.Fa count
54parameter slows down the algorithm which makes it harder for an attacker 54parameter slows down the algorithm, which makes it harder for an attacker
55to perform a brute force attack using a large number of candidate 55to perform a brute force attack using a large number of candidate
56passwords. 56passwords.
57.Pp 57.Pp
58If the total key and IV length is less than the digest length and MD5 58If the total key and IV length is less than the digest length and MD5
59is used, then the derivation algorithm is compatible with PKCS#5 v1.5. 59is used, then the derivation algorithm is compatible with PKCS#5 v1.5.
60Otherwise, a non standard extension is used to derive the extra data. 60Otherwise, a non-standard extension is used to derive the extra data.
61.Pp 61.Pp
62Newer applications should use more standard algorithms such as PBKDF2 as 62Newer applications should use more standard algorithms such as PBKDF2 as
63defined in PKCS#5v2.1 for key derivation. 63defined in PKCS#5v2.1 for key derivation.
64.Sh KEY DERIVATION ALGORITHM 64.Sh KEY DERIVATION ALGORITHM
65The key and IV is derived by concatenating D_1, D_2, etc until enough 65The key and IV is derived by concatenating D_1, D_2, etc. until enough
66data is available for the key and IV. 66data is available for the key and IV.
67D_i is defined recursively as: 67D_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 ,
200then the number of bytes of data written (i.e. the length of the 200then the number of bytes of data written (i.e. the length of the
201digest) will be written to the integer at 201digest) will be written to the integer at
202.Fa s , 202.Fa s ;
203at most 203at most
204.Dv EVP_MAX_MD_SIZE 204.Dv EVP_MAX_MD_SIZE
205bytes will be written. 205bytes will be written.
@@ -284,7 +284,7 @@ For example
284.Fn EVP_MD_type EVP_sha1() 284.Fn EVP_MD_type EVP_sha1()
285returns 285returns
286.Dv NID_sha1 . 286.Dv NID_sha1 .
287This function is normally used when setting ASN1 OIDs. 287This 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
290returns the 290returns the
@@ -324,7 +324,7 @@ return
324structures for SHA1 digest algorithms but using DSS (DSA) for the 324structures for SHA1 digest algorithms but using DSS (DSA) for the
325signature algorithm. 325signature algorithm.
326Note: there is no need to use these pseudo-digests in OpenSSL 1.0.0 and 326Note: there is no need to use these pseudo-digests in OpenSSL 1.0.0 and
327later, they are however retained for compatibility. 327later; they are however retained for compatibility.
328.Pp 328.Pp
329.Fn EVP_md_null 329.Fn EVP_md_null
330is a "null" message digest that does nothing: 330is a "null" message digest that does nothing:
@@ -369,7 +369,7 @@ New applications should use
369and 369and
370.Fn EVP_MD_CTX_copy_ex 370.Fn EVP_MD_CTX_copy_ex
371because they can efficiently reuse a digest context instead of 371because they can efficiently reuse a digest context instead of
372initializing and cleaning it up on each call and allow non default 372initializing and cleaning it up on each call and allow non-default
373implementations of digests to be specified. 373implementations of digests to be specified.
374.Pp 374.Pp
375In OpenSSL 0.9.7 and later if digest contexts are not cleaned up after 375In 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
441This example digests the data "Test Message\en" and "Hello World\en", 441This example digests the data "Test Message\en" and "Hello World\en",
442using the digest name passed on the command line. 442using 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.
514The link between digests and signing algorithms was fixed in OpenSSL 1.0 514The link between digests and signing algorithms was fixed in OpenSSL 1.0
515and later, so now 515and later, so now
516.Fn EVP_sha1 516.Fn EVP_sha1
517can be used with RSA and DSA, there is no need to use 517can be used with RSA and DSA; there is no need to use
518.Fn EVP_dss1 518.Fn EVP_dss1
519any more. 519any 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
292is the symmetric key to use and 292is the symmetric key to use and
293.Fa iv 293.Fa iv
294is the IV to use (if necessary), the actual number of bytes used for the 294is the IV to use (if necessary).
295The actual number of bytes used for the
295key and IV depends on the cipher. 296key and IV depends on the cipher.
296It is possible to set all parameters to 297It 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
377clears all information from a cipher context and free up any allocated 378clears all information from a cipher context and free up any allocated
378memory associate with it. 379memory associated with it.
379It should be called after all operations using a cipher are complete so 380It should be called after all operations using a cipher are complete so
380sensitive information does not remain in memory. 381sensitive 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
491return the type of the passed cipher or context. 492return the type of the passed cipher or context.
492This "type" is the actual NID of the cipher OBJECT IDENTIFIER as such it 493This "type" is the actual NID of the cipher OBJECT IDENTIFIER as such it
493ignores the cipher parameters and 40 bit RC2 and 128 bit RC2 have the 494ignores the cipher parameters and 40-bit RC2 and 128-bit RC2 have the
494same NID. 495same NID.
495If the cipher does not have an object identifier or does not 496If the cipher does not have an object identifier or does not
496have ASN1 support this function will return 497have 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.
521This will typically include any parameters and an IV. 522This will typically include any parameters and an IV.
522The cipher IV (if any) must be set when this call is made. 523The cipher IV (if any) must be set when this call is made.
523This call should be made before the cipher is actually "used" (before any 524This call should be made before the cipher is actually "used" (before any
524.Fn EVP_EncryptUpdate , 525.Fn EVP_EncryptUpdate
526or
525.Fn EVP_DecryptUpdate 527.Fn EVP_DecryptUpdate
526calls for example). 528calls, for example).
527This function may fail if the cipher does not have any ASN1 support. 529This 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
530sets the cipher parameters based on an ASN1 AlgorithmIdentifier 532sets the cipher parameters based on an ASN.1 AlgorithmIdentifier
531"parameter". 533"parameter".
532The precise effect depends on the cipher. 534The precise effect depends on the cipher.
533In the case of RC2, for example, it will set the IV and effective 535In the case of RC2, for example, it will set the IV and effective
@@ -544,7 +546,7 @@ will be called and finally
544again with all parameters except the key set to 546again with all parameters except the key set to
545.Dv NULL . 547.Dv NULL .
546It is possible for this function to fail if the cipher does not 548It is possible for this function to fail if the cipher does not
547have any ASN1 support or the parameters cannot be set (for example 549have any ASN.1 support or the parameters cannot be set (for example
548the RC2 effective key length is not supported). 550the 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.
720RC4 stream cipher. 722RC4 stream cipher.
721This is a variable key length cipher with default key length 128 bits. 723This 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
723RC4 stream cipher with 40 bit key length. 725RC4 stream cipher with 40-bit key length.
724This is obsolete and new code should use 726This is obsolete and new code should use
725.Fn EVP_rc4 727.Fn EVP_rc4
726and the 728and 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
787Get the number of rounds used in RC5: 789Get the number of rounds used in RC5:
788.Bd -literal 790.Bd -literal -offset indent
789int nrounds; 791int nrounds;
790EVP_CIPHER_CTX_ctrl(ctx, EVP_CTRL_GET_RC5_ROUNDS, 0, &nrounds); 792EVP_CIPHER_CTX_ctrl(ctx, EVP_CTRL_GET_RC5_ROUNDS, 0, &nrounds);
791.Ed 793.Ed
792.Pp 794.Pp
793Get the RC2 effective key length: 795Get the RC2 effective key length:
794.Bd -literal 796.Bd -literal -offset indent
795int key_bits; 797int key_bits;
796EVP_CIPHER_CTX_ctrl(ctx, EVP_CTRL_GET_RC2_KEY_BITS, 0, &key_bits); 798EVP_CIPHER_CTX_ctrl(ctx, EVP_CTRL_GET_RC2_KEY_BITS, 0, &key_bits);
797.Ed 799.Ed
798.Pp 800.Pp
799Set the number of rounds used in RC5: 801Set the number of rounds used in RC5:
800.Bd -literal 802.Bd -literal -offset indent
801int nrounds; 803int nrounds;
802EVP_CIPHER_CTX_ctrl(ctx, EVP_CTRL_SET_RC5_ROUNDS, nrounds, NULL); 804EVP_CIPHER_CTX_ctrl(ctx, EVP_CTRL_SET_RC5_ROUNDS, nrounds, NULL);
803.Ed 805.Ed
804.Pp 806.Pp
805Set the effective key length used in RC2: 807Set the effective key length used in RC2:
806.Bd -literal 808.Bd -literal -offset indent
807int key_bits; 809int key_bits;
808EVP_CIPHER_CTX_ctrl(ctx, EVP_CTRL_SET_RC2_KEY_BITS, key_bits, NULL); 810EVP_CIPHER_CTX_ctrl(ctx, EVP_CTRL_SET_RC2_KEY_BITS, key_bits, NULL);
809.Ed 811.Ed
810.Pp 812.Pp
811Encrypt a string using blowfish: 813Encrypt a string using blowfish:
812.Bd -literal 814.Bd -literal -offset 3n
813int 815int
814do_crypt(char *outfile) 816do_crypt(char *outfile)
815{ 817{
@@ -858,13 +860,13 @@ do_crypt(char *outfile)
858The ciphertext from the above example can be decrypted using the 860The ciphertext from the above example can be decrypted using the
859.Xr openssl 1 861.Xr openssl 1
860utility with the command line: 862utility with the command line:
861.Bd -literal 863.Bd -literal -offset indent
862openssl bf -in cipher.bin -K 000102030405060708090A0B0C0D0E0F \e 864openssl bf -in cipher.bin -K 000102030405060708090A0B0C0D0E0F \e
863 -iv 0102030405060708 -d 865 -iv 0102030405060708 -d
864.Ed 866.Ed
865.Pp 867.Pp
866General encryption, decryption function example using FILE I/O and RC2 868General encryption, decryption function example using FILE I/O and RC2
867with an 80 bit key: 869with an 80-bit key:
868.Bd -literal 870.Bd -literal
869int 871int
870do_crypt(FILE *in, FILE *out, int do_encrypt) 872do_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
938bytes. 940bytes.
939.Pp 941.Pp
940The ASN1 code is incomplete (and sometimes inaccurate) it has only been 942The ASN.1 code is incomplete (and sometimes inaccurate).
941tested for certain common S/MIME ciphers (RC2, DES, triple DES) in CBC 943It has only been tested for certain common S/MIME ciphers
942mode. 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
85must match the fixed cipher length. 85must match the fixed cipher length.
86.Sh RETURN VALUES 86.Sh RETURN VALUES
87.Fn EVP_OpenInit 87.Fn EVP_OpenInit
88returns 0 on error or a non zero integer (actually the recovered secret 88returns 0 on error or a non-zero integer (actually the recovered secret
89key size) if successful. 89key 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.
169The 169The
170.Fn EVP_PKEY_CTX_set_rsa_pss_saltlen 170.Fn EVP_PKEY_CTX_set_rsa_pss_saltlen
171macro sets the RSA PSS salt length to 171macro sets the RSA PSS salt length to
172.Fa len 172.Fa len .
173as its name implies it is only supported for PSS padding. 173As its name implies, it is only supported for PSS padding.
174Two special values are supported: -1 sets the salt length to the digest 174Two special values are supported: -1 sets the salt length to the digest
175length. 175length.
176When signing -2 sets the salt length to the maximum permissible value. 176When 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 ,
65and
65.Fn EVP_PKEY_CTX_dup 66.Fn EVP_PKEY_CTX_dup
66returns either the newly allocated 67return either the newly allocated
67.Vt EVP_PKEY_CTX 68.Vt EVP_PKEY_CTX
68structure of 69structure or
69.Dv NULL 70.Dv NULL
70if an error occurred. 71if 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
84returns 1 for success and 0 for failure. 84returns 1 for success and 0 for failure.
85.Pp 85.Pp
86The function 86The functions
87.Fn EVP_PKEY_cmp_parameters 87.Fn EVP_PKEY_cmp_parameters
88and 88and
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
53parameter should contain the length of the 53parameter should contain the length of the
54.Fa out 54.Fa out
55buffer, if the call is successful the decrypted data is written to 55buffer.
56If the call is successful the decrypted data is written to
56.Fa out 57.Fa out
57and the amount of data written to 58and 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
75supported by the public key algorithm. 76supported by the public key algorithm.
76.Sh EXAMPLES 77.Sh EXAMPLES
77Decrypt data using OAEP (for RSA keys): 78Decrypt 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
39The 39The
40.Fn EVP_PKEY_derive 40.Fn EVP_PKEY_derive
41derives a shared secret using 41function derives a shared secret using
42.Fa ctx . 42.Fa ctx .
43If 43If
44.Fa key 44.Fa key
@@ -79,7 +79,7 @@ In particular, a return value of -2 indicates the operation is not
79supported by the public key algorithm. 79supported by the public key algorithm.
80.Sh EXAMPLES 80.Sh EXAMPLES
81Derive shared secret (for example DH or EC keys): 81Derive 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
53parameter should contain the length of the 53parameter should contain the length of the
54.Fa out 54.Fa out
55buffer, if the call is successful the encrypted data is written to 55buffer.
56If the call is successful the encrypted data is written to
56.Fa out 57.Fa out
57and the amount of data written to 58and 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
75supported by the public key algorithm. 76supported by the public key algorithm.
76.Sh EXAMPLES 77.Sh EXAMPLES
77Encrypt data using OAEP (for RSA keys): 78Encrypt 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
71The 71The
72.Fn EVP_PKEY_keygen 72.Fn EVP_PKEY_keygen
73function performs a key generation operation, the generated key is 73function performs a key generation operation.
74written to 74The generated key is written to
75.Fa ppkey . 75.Fa ppkey .
76.Pp 76.Pp
77The functions 77The functions
@@ -94,7 +94,7 @@ returns parameters associated with the generation operation.
94If 94If
95.Fa idx 95.Fa idx
96is -1, the total number of parameters available is returned. 96is -1, the total number of parameters available is returned.
97Any non negative value returns the value of that parameter. 97Any 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
99with a non-negative value for 99with 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.
159In particular, a return value of -2 indicates the operation is not 159In particular, a return value of -2 indicates the operation is not
160supported by the public key algorithm. 160supported by the public key algorithm.
161.Sh EXAMPLES 161.Sh EXAMPLES
162Generate a 2048 bit RSA key: 162Generate 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
182Generate a key from a set of parameters: 182Generate 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
201Example of generation callback for OpenSSL public key implementations: 201Example 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
205EVP_PKEY_CTX_set_app_data(ctx, status_bio); 205EVP_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
51The 51The
52.Fa pctx 52.Fa pctx
53parameter allows the print output to be finely tuned by using ASN1 53parameter allows the print output to be finely tuned by using ASN.1
54printing options. 54printing options.
55If 55If
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
76supported by the public key algorithm. 76supported by the public key algorithm.
77.Sh EXAMPLES 77.Sh EXAMPLES
78Sign data using RSA with PKCS#1 padding and SHA256 digest: 78Sign 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
72supported by the public key algorithm. 72supported by the public key algorithm.
73.Sh EXAMPLES 73.Sh EXAMPLES
74Verify signature using PKCS#1 and SHA256 digest: 74Verify 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
87supported by the public key algorithm. 87supported by the public key algorithm.
88.Sh EXAMPLES 88.Sh EXAMPLES
89Recover digest originally signed using PKCS#1 and SHA256 digest: 89Recover 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
49using a random secret key and IV. 49using a random secret key and IV.
50.Fa type 50.Fa type
51is normally supplied by a function such as 51is normally supplied by a function such as
52.Fn EVP_aes_256_cbc 3 ; 52.Fn EVP_aes_256_cbc ;
53see 53see
54.Xr EVP_EncryptInit 3 54.Xr EVP_EncryptInit 3
55for details. 55for 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
80bytes in size. 81bytes in size.
81.Fa s 82.Fa s
82is an OUT parameter, and not used as an IN parameter. 83is an OUT parameter, and not used as an IN parameter.
83The number of bytes of data written (i.e. 84The number of bytes of data written (i.e.\&
84the length of the signature) will be written to the integer at 85the length of the signature) will be written to the integer at
85.Fa s . 86.Fa s .
86At most 87At most
@@ -164,6 +165,4 @@ amounts of data have been passed through
164It is not possible to change the signing parameters using these 165It is not possible to change the signing parameters using these
165function. 166function.
166.Pp 167.Pp
167The previous two bugs are fixed in the newer 168The previous two bugs are fixed in the newer EVP_SignDigest* function.
168.Xr EVP_SignDigest* 3
169function.
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,
328see 328see
329.Xr BN_CTX_start 3 . 329.Xr BN_CTX_start 3 .
330.Ss Low-level arithmetic operations 330.Ss Low level arithmetic operations
331These functions are implemented in C and for several platforms in 331These functions are implemented in C and for several platforms in
332assembly language: 332assembly 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
12The EVP library provides a high-level interface to cryptographic 12The EVP library provides a high level interface to cryptographic
13functions. 13functions.
14.Pp 14.Pp
15.Xr EVP_SealInit 3 15.Xr EVP_SealInit 3