summaryrefslogtreecommitdiff
path: root/src/lib
diff options
context:
space:
mode:
authorjmc <>2016-11-10 14:34:18 +0000
committerjmc <>2016-11-10 14:34:18 +0000
commitf09d61b594eba5f8f4ebf834ec2f18203636bcf5 (patch)
tree8e5a7bb432fb01e6ee508c5a7327eb41f4a0c92a /src/lib
parente19a4e15d73261c4eaf9f544789343e0ae570455 (diff)
downloadopenbsd-f09d61b594eba5f8f4ebf834ec2f18203636bcf5.tar.gz
openbsd-f09d61b594eba5f8f4ebf834ec2f18203636bcf5.tar.bz2
openbsd-f09d61b594eba5f8f4ebf834ec2f18203636bcf5.zip
various cleanup;
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/libcrypto/man/ASN1_OBJECT_new.34
-rw-r--r--src/lib/libcrypto/man/BUF_MEM_new.312
-rw-r--r--src/lib/libcrypto/man/CONF_modules_free.310
-rw-r--r--src/lib/libcrypto/man/CONF_modules_load_file.36
-rw-r--r--src/lib/libcrypto/man/CRYPTO_set_ex_data.313
-rw-r--r--src/lib/libcrypto/man/CRYPTO_set_locking_callback.329
-rw-r--r--src/lib/libcrypto/man/DES_set_key.335
7 files changed, 52 insertions, 57 deletions
diff --git a/src/lib/libcrypto/man/ASN1_OBJECT_new.3 b/src/lib/libcrypto/man/ASN1_OBJECT_new.3
index e78bfd1174..55a90bbcb2 100644
--- a/src/lib/libcrypto/man/ASN1_OBJECT_new.3
+++ b/src/lib/libcrypto/man/ASN1_OBJECT_new.3
@@ -1,4 +1,4 @@
1.\" $OpenBSD: ASN1_OBJECT_new.3,v 1.6 2016/11/10 11:30:07 schwarze Exp $ 1.\" $OpenBSD: ASN1_OBJECT_new.3,v 1.7 2016/11/10 14:34:18 jmc Exp $
2.\" OpenSSL 99d63d4 Mar 19 12:28:58 2016 -0400 2.\" OpenSSL 99d63d4 Mar 19 12:28:58 2016 -0400
3.\" 3.\"
4.\" This file was written by Dr. Stephen Henson. 4.\" This file was written by Dr. Stephen Henson.
@@ -9,7 +9,7 @@
9.\" are met: 9.\" are met:
10.\" 10.\"
11.\" 1. Redistributions of source code must retain the above copyright 11.\" 1. Redistributions of source code must retain the above copyright
12.\" notice, this list of conditions and the following disclaimer. 12.\" notice, this list of conditions and the following disclaimer.
13.\" 13.\"
14.\" 2. Redistributions in binary form must reproduce the above copyright 14.\" 2. Redistributions in binary form must reproduce the above copyright
15.\" notice, this list of conditions and the following disclaimer in 15.\" notice, this list of conditions and the following disclaimer in
diff --git a/src/lib/libcrypto/man/BUF_MEM_new.3 b/src/lib/libcrypto/man/BUF_MEM_new.3
index 609df41457..f658048a93 100644
--- a/src/lib/libcrypto/man/BUF_MEM_new.3
+++ b/src/lib/libcrypto/man/BUF_MEM_new.3
@@ -1,6 +1,6 @@
1.\" $OpenBSD: BUF_MEM_new.3,v 1.4 2016/11/06 15:52:50 jmc Exp $ 1.\" $OpenBSD: BUF_MEM_new.3,v 1.5 2016/11/10 14:34:18 jmc Exp $
2.\" 2.\"
3.Dd $Mdocdate: November 6 2016 $ 3.Dd $Mdocdate: November 10 2016 $
4.Dt BUF_MEM_NEW 3 4.Dt BUF_MEM_NEW 3
5.Os 5.Os
6.Sh NAME 6.Sh NAME
@@ -46,12 +46,10 @@ typedef struct buf_mem_st
46.Ed 46.Ed
47.Pp 47.Pp
48.Fa length 48.Fa length
49is the current size of the buffer in bytes, 49is the current size of the buffer in bytes;
50.Fa max 50.Fa max
51is the amount of memory allocated to the buffer. 51is the amount of memory allocated to the buffer.
52There are three functions which handle these and one 52There are three functions which handle these and one miscellaneous function.
53.Dq miscellaneous
54function.
55.Pp 53.Pp
56.Fn BUF_MEM_new 54.Fn BUF_MEM_new
57allocates a new buffer of zero size. 55allocates a new buffer of zero size.
@@ -92,7 +90,7 @@ returns the buffer or
92on error. 90on error.
93.Pp 91.Pp
94.Fn BUF_MEM_grow 92.Fn BUF_MEM_grow
95returns zero on error or the new size (i.e. 93returns zero on error or the new size (i.e.\&
96.Fa len ) . 94.Fa len ) .
97.Sh SEE ALSO 95.Sh SEE ALSO
98.Xr bio 3 96.Xr bio 3
diff --git a/src/lib/libcrypto/man/CONF_modules_free.3 b/src/lib/libcrypto/man/CONF_modules_free.3
index 2735db8d3b..bc20fdab0d 100644
--- a/src/lib/libcrypto/man/CONF_modules_free.3
+++ b/src/lib/libcrypto/man/CONF_modules_free.3
@@ -1,6 +1,6 @@
1.\" $OpenBSD: CONF_modules_free.3,v 1.2 2016/11/06 15:52:50 jmc Exp $ 1.\" $OpenBSD: CONF_modules_free.3,v 1.3 2016/11/10 14:34:18 jmc Exp $
2.\" 2.\"
3.Dd $Mdocdate: November 6 2016 $ 3.Dd $Mdocdate: November 10 2016 $
4.Dt CONF_MODULES_FREE 3 4.Dt CONF_MODULES_FREE 3
5.Os 5.Os
6.Sh NAME 6.Sh NAME
@@ -26,6 +26,8 @@
26.Fn CONF_modules_free 26.Fn CONF_modules_free
27closes down and frees up all memory allocated by all configuration 27closes down and frees up all memory allocated by all configuration
28modules. 28modules.
29Normally applications will only call this function
30at application to tidy up any configuration performed.
29.Pp 31.Pp
30.Fn CONF_modules_finish 32.Fn CONF_modules_finish
31calls the configuration 33calls the configuration
@@ -41,10 +43,6 @@ is set to 0, only modules loaded from DSOs will be unloaded.
41If 43If
42.Fa all 44.Fa all
43is 1, all modules, including builtin modules, will be unloaded. 45is 1, all modules, including builtin modules, will be unloaded.
44.Sh NOTES
45Normally applications will only call
46.Fn CONF_modules_free
47at application to tidy up any configuration performed.
48.Sh RETURN VALUES 46.Sh RETURN VALUES
49None of the functions return a value. 47None of the functions return a value.
50.Sh SEE ALSO 48.Sh SEE ALSO
diff --git a/src/lib/libcrypto/man/CONF_modules_load_file.3 b/src/lib/libcrypto/man/CONF_modules_load_file.3
index 9fbd1aba47..6e1a026727 100644
--- a/src/lib/libcrypto/man/CONF_modules_load_file.3
+++ b/src/lib/libcrypto/man/CONF_modules_load_file.3
@@ -1,6 +1,6 @@
1.\" $OpenBSD: CONF_modules_load_file.3,v 1.2 2016/11/06 15:52:50 jmc Exp $ 1.\" $OpenBSD: CONF_modules_load_file.3,v 1.3 2016/11/10 14:34:18 jmc Exp $
2.\" 2.\"
3.Dd $Mdocdate: November 6 2016 $ 3.Dd $Mdocdate: November 10 2016 $
4.Dt CONF_MODULES_LOAD_FILE 3 4.Dt CONF_MODULES_LOAD_FILE 3
5.Os 5.Os
6.Sh NAME 6.Sh NAME
@@ -74,7 +74,7 @@ failure.
74If module errors are not ignored, the return code will reflect the return 74If module errors are not ignored, the return code will reflect the return
75value of the failing module (this will always be zero or negative). 75value of the failing module (this will always be zero or negative).
76.Sh SEE ALSO 76.Sh SEE ALSO
77.Xr CONF_free 3 , 77.Xr CONF_modules_free 3 ,
78.Xr ERR 3 , 78.Xr ERR 3 ,
79.Xr OPENSSL_config 3 79.Xr OPENSSL_config 3
80.Sh HISTORY 80.Sh HISTORY
diff --git a/src/lib/libcrypto/man/CRYPTO_set_ex_data.3 b/src/lib/libcrypto/man/CRYPTO_set_ex_data.3
index d7a88b5293..afdaa7a418 100644
--- a/src/lib/libcrypto/man/CRYPTO_set_ex_data.3
+++ b/src/lib/libcrypto/man/CRYPTO_set_ex_data.3
@@ -1,6 +1,6 @@
1.\" $OpenBSD: CRYPTO_set_ex_data.3,v 1.2 2016/11/06 15:52:50 jmc Exp $ 1.\" $OpenBSD: CRYPTO_set_ex_data.3,v 1.3 2016/11/10 14:34:18 jmc Exp $
2.\" 2.\"
3.Dd $Mdocdate: November 6 2016 $ 3.Dd $Mdocdate: November 10 2016 $
4.Dt CRYPTO_SET_EX_DATA 3 4.Dt CRYPTO_SET_EX_DATA 3
5.Os 5.Os
6.Sh NAME 6.Sh NAME
@@ -33,18 +33,19 @@ structures passed to the
33.Fn free_func , 33.Fn free_func ,
34and 34and
35.Fn dup_func 35.Fn dup_func
36callbacks: as passed to 36callbacks, as passed to
37.Xr RSA_get_ex_new_index 3 37.Xr RSA_get_ex_new_index 3 ,
38for example. 38for example.
39.Pp 39.Pp
40.Fn CRYPTO_set_ex_data 40.Fn CRYPTO_set_ex_data
41is used to set application specific data, the data is supplied in the 41is used to set application specific data.
42The data is supplied in the
42.Fa arg 43.Fa arg
43parameter and its precise meaning is up to the application. 44parameter and its precise meaning is up to the application.
44.Pp 45.Pp
45.Fn CRYPTO_get_ex_data 46.Fn CRYPTO_get_ex_data
46is used to retrieve application specific data. 47is used to retrieve application specific data.
47The data is returned to the application, this will be the same value as 48The data is returned to the application; this will be the same value as
48supplied to a previous 49supplied to a previous
49.Fn CRYPTO_set_ex_data 50.Fn CRYPTO_set_ex_data
50call. 51call.
diff --git a/src/lib/libcrypto/man/CRYPTO_set_locking_callback.3 b/src/lib/libcrypto/man/CRYPTO_set_locking_callback.3
index eb99f30d23..6fdb68c005 100644
--- a/src/lib/libcrypto/man/CRYPTO_set_locking_callback.3
+++ b/src/lib/libcrypto/man/CRYPTO_set_locking_callback.3
@@ -1,16 +1,17 @@
1.\" $OpenBSD: CRYPTO_set_locking_callback.3,v 1.3 2016/11/06 15:52:50 jmc Exp $ 1.\" $OpenBSD: CRYPTO_set_locking_callback.3,v 1.4 2016/11/10 14:34:18 jmc Exp $
2.\" 2.\"
3.Dd $Mdocdate: November 6 2016 $ 3.Dd $Mdocdate: November 10 2016 $
4.Dt CRYPTO_SET_LOCKING_CALLBACK 3 4.Dt CRYPTO_SET_LOCKING_CALLBACK 3
5.Os 5.Os
6.Sh NAME 6.Sh NAME
7.Nm CRYPTO_THREADID_set_numeric ,
8.Nm CRYPTO_THREADID_set_pointer ,
7.Nm CRYPTO_THREADID_set_callback , 9.Nm CRYPTO_THREADID_set_callback ,
8.Nm CRYPTO_THREADID_get_callback , 10.Nm CRYPTO_THREADID_get_callback ,
9.Nm CRYPTO_THREADID_current , 11.Nm CRYPTO_THREADID_current ,
10.Nm CRYPTO_THREADID_cmp , 12.Nm CRYPTO_THREADID_cmp ,
11.Nm CRYPTO_THREADID_cpy , 13.Nm CRYPTO_THREADID_cpy ,
12.Nm CRYPTO_THREADID_hash , 14.Nm CRYPTO_THREADID_hash ,
13.Nm CRYPTO_set_locking_callback ,
14.Nm CRYPTO_num_locks , 15.Nm CRYPTO_num_locks ,
15.Nm CRYPTO_set_dynlock_create_callback , 16.Nm CRYPTO_set_dynlock_create_callback ,
16.Nm CRYPTO_set_dynlock_lock_callback , 17.Nm CRYPTO_set_dynlock_lock_callback ,
@@ -22,9 +23,7 @@
22.Nm CRYPTO_w_unlock , 23.Nm CRYPTO_w_unlock ,
23.Nm CRYPTO_r_lock , 24.Nm CRYPTO_r_lock ,
24.Nm CRYPTO_r_unlock , 25.Nm CRYPTO_r_unlock ,
25.Nm CRYPTO_add , 26.Nm CRYPTO_add
26.Nm CRYPTO_add_lock ,
27.Nm CRYPTO_set_id_callback
28.Nd OpenSSL thread support 27.Nd OpenSSL thread support
29.Sh SYNOPSIS 28.Sh SYNOPSIS
30.In openssl/crypto.h 29.In openssl/crypto.h
@@ -211,7 +210,7 @@ value even though it is not as wide as the platform's true thread
211IDs. 210IDs.
212.El 211.El
213.Pp 212.Pp
214Additionally, OpenSSL supports dynamic locks, and sometimes, some parts 213Additionally, OpenSSL supports dynamic locks and, sometimes, some parts
215of OpenSSL need it for better performance. 214of OpenSSL need it for better performance.
216To enable this, the following is required: 215To enable this, the following is required:
217.Bl -bullet 216.Bl -bullet
@@ -286,15 +285,7 @@ CRYPTO_UNLOCK 0x02
286CRYPTO_READ 0x04 285CRYPTO_READ 0x04
287CRYPTO_WRITE 0x08 286CRYPTO_WRITE 0x08
288.Ed 287.Ed
289.Sh RETURN VALUES
290.Fn CRYPTO_num_locks
291returns the required number of locks.
292.Pp
293.Fn CRYPTO_get_new_dynlockid
294returns the index to the newly created lock.
295.Pp 288.Pp
296The other functions return no values.
297.Sh NOTES
298You can find out if OpenSSL was configured with thread support: 289You can find out if OpenSSL was configured with thread support:
299.Bd -literal -offset indent 290.Bd -literal -offset indent
300#define OPENSSL_THREAD_DEFINES 291#define OPENSSL_THREAD_DEFINES
@@ -308,6 +299,14 @@ You can find out if OpenSSL was configured with thread support:
308.Pp 299.Pp
309Also, dynamic locks are currently not used internally by OpenSSL, but 300Also, dynamic locks are currently not used internally by OpenSSL, but
310may do so in the future. 301may do so in the future.
302.Sh RETURN VALUES
303.Fn CRYPTO_num_locks
304returns the required number of locks.
305.Pp
306.Fn CRYPTO_get_new_dynlockid
307returns the index to the newly created lock.
308.Pp
309The other functions return no values.
311.Sh EXAMPLES 310.Sh EXAMPLES
312.Pa crypto/threads/mttest.c 311.Pa crypto/threads/mttest.c
313shows examples of the callback functions on Solaris, Irix and Win32. 312shows examples of the callback functions on Solaris, Irix and Win32.
diff --git a/src/lib/libcrypto/man/DES_set_key.3 b/src/lib/libcrypto/man/DES_set_key.3
index 1e4de6255f..804754e2ce 100644
--- a/src/lib/libcrypto/man/DES_set_key.3
+++ b/src/lib/libcrypto/man/DES_set_key.3
@@ -1,6 +1,6 @@
1.\" $OpenBSD: DES_set_key.3,v 1.2 2016/11/06 15:52:50 jmc Exp $ 1.\" $OpenBSD: DES_set_key.3,v 1.3 2016/11/10 14:34:18 jmc Exp $
2.\" 2.\"
3.Dd $Mdocdate: November 6 2016 $ 3.Dd $Mdocdate: November 10 2016 $
4.Dt DES_SET_KEY 3 4.Dt DES_SET_KEY 3
5.Os 5.Os
6.Sh NAME 6.Sh NAME
@@ -300,10 +300,10 @@ algorithm.
300There are two phases to the use of DES encryption. 300There are two phases to the use of DES encryption.
301The first is the generation of a 301The first is the generation of a
302.Vt DES_key_schedule 302.Vt DES_key_schedule
303from a key, the second is the actual encryption. 303from a key, and the second is the actual encryption.
304A DES key is of type 304A DES key is of type
305.Vt DES_cblock . 305.Vt DES_cblock .
306This type is consists of 8 bytes with odd parity. 306This type consists of 8 bytes with odd parity.
307The least significant bit in each byte is the parity bit. 307The least significant bit in each byte is the parity bit.
308The key schedule is an expanded form of the key; it is used to speed the 308The key schedule is an expanded form of the key; it is used to speed the
309encryption process. 309encryption process.
@@ -343,7 +343,7 @@ sets the parity of the passed
343to odd. 343to odd.
344.Pp 344.Pp
345.Fn DES_is_weak_key 345.Fn DES_is_weak_key
346returns 1 is the passed key is a weak key, 0 if it is ok. 346returns 1 if the passed key is a weak key or 0 if it is ok.
347.Pp 347.Pp
348The following routines mostly operate on an input and output stream of 348The following routines mostly operate on an input and output stream of
349.Vt DES_cblock Ns s. 349.Vt DES_cblock Ns s.
@@ -364,7 +364,7 @@ argument is non-zero
364.Pq Dv DES_ENCRYPT , 364.Pq Dv DES_ENCRYPT ,
365the 365the
366.Fa input 366.Fa input
367(cleartext) is encrypted in to the 367(cleartext) is encrypted into the
368.Fa output 368.Fa output
369(ciphertext) using the key_schedule specified by the 369(ciphertext) using the key_schedule specified by the
370.Fa schedule 370.Fa schedule
@@ -435,7 +435,7 @@ It uses
435.Fa inw 435.Fa inw
436and 436and
437.Fa outw 437.Fa outw
438to 'whiten' the encryption. 438to "whiten" the encryption.
439.Fa inw 439.Fa inw
440and 440and
441.Fa outw 441.Fa outw
@@ -465,7 +465,7 @@ Its parameters are the same as
465.Pp 465.Pp
466.Fn DES_cfb_encrypt 466.Fn DES_cfb_encrypt
467encrypt/decrypts using cipher feedback mode. 467encrypt/decrypts using cipher feedback mode.
468This method takes an array of characters as input and outputs and array 468This method takes an array of characters as input and outputs an array
469of characters. 469of characters.
470It does not require any padding to 8 character groups. 470It does not require any padding to 8 character groups.
471Note: the 471Note: the
@@ -484,7 +484,7 @@ Because this routine will allow you to encrypt an arbitrary number of
484bytes, no 8 byte padding. 484bytes, no 8 byte padding.
485Each call to this routine will encrypt the input bytes to output and 485Each call to this routine will encrypt the input bytes to output and
486then update ivec and num. 486then update ivec and num.
487num contains 'how far' we are though ivec. 487num contains "how far" we are though ivec.
488If this does not make much sense, read more about cfb mode of DES :-). 488If this does not make much sense, read more about cfb mode of DES :-).
489.Pp 489.Pp
490.Fn DES_ede3_cfb64_encrypt 490.Fn DES_ede3_cfb64_encrypt
@@ -496,7 +496,7 @@ except that Triple-DES is used.
496.Pp 496.Pp
497.Fn DES_ofb_encrypt 497.Fn DES_ofb_encrypt
498encrypts using output feedback mode. 498encrypts using output feedback mode.
499This method takes an array of characters as input and outputs and array 499This method takes an array of characters as input and outputs an array
500of characters. 500of characters.
501It does not require any padding to 8 character groups. 501It does not require any padding to 8 character groups.
502Note: the 502Note: the
@@ -523,7 +523,7 @@ The following functions are included in the DES library for
523compatibility with the MIT Kerberos library. 523compatibility with the MIT Kerberos library.
524.Pp 524.Pp
525.Fn DES_cbc_cksum 525.Fn DES_cbc_cksum
526produces an 8 byte checksum based on the input stream (via CBC 526produces an 8-byte checksum based on the input stream (via CBC
527encryption). 527encryption).
528The last 4 bytes of the checksum are returned and the complete 8 bytes 528The last 4 bytes of the checksum are returned and the complete 8 bytes
529are placed in 529are placed in
@@ -535,7 +535,7 @@ etc. instead.
535.Pp 535.Pp
536.Fn DES_quad_cksum 536.Fn DES_quad_cksum
537is a Kerberos v4 function. 537is a Kerberos v4 function.
538It returns a 4 byte checksum from the input bytes. 538It returns a 4-byte checksum from the input bytes.
539The algorithm can be iterated over the input, depending on 539The algorithm can be iterated over the input, depending on
540.Fa out_count , 540.Fa out_count ,
5411, 2, 3 or 4 times. 5411, 2, 3 or 4 times.
@@ -606,12 +606,12 @@ for the key schedule and
606.Fa iv 606.Fa iv
607for the initial vector. 607for the initial vector.
608.Pp 608.Pp
609.Sy Warning: 609.Sy Warning :
610The data format used by 610The data format used by
611.Fn DES_enc_write 611.Fn DES_enc_write
612and 612and
613.Fn DES_enc_read 613.Fn DES_enc_read
614has a cryptographic weakness: When asked to write more than 614has a cryptographic weakness: when asked to write more than
615.Dv MAXWRITE 615.Dv MAXWRITE
616bytes, 616bytes,
617.Fn DES_enc_write 617.Fn DES_enc_write
@@ -657,7 +657,7 @@ were added in OpenSSL 0.9.5.
657.Fn des_init_random_number_generator , 657.Fn des_init_random_number_generator ,
658.Fn des_new_random_key , 658.Fn des_new_random_key ,
659.Fn des_set_random_generator_seed , 659.Fn des_set_random_generator_seed ,
660.Xr des_set_sequence_number , 660.Fn des_set_sequence_number ,
661and 661and
662.Fn des_rand_data 3 662.Fn des_rand_data 3
663are used in newer versions of Kerberos but are not implemented here. 663are used in newer versions of Kerberos but are not implemented here.
@@ -671,8 +671,7 @@ prior version 0.9.5, as well as in the original MIT library.
671Single-key DES is insecure due to its short key size. 671Single-key DES is insecure due to its short key size.
672ECB mode is not suitable for most applications. 672ECB mode is not suitable for most applications.
673.Sh BUGS 673.Sh BUGS
674.Xr DES_cbc_encrypt 3 674DES_cbc_encrypt does not modify
675does not modify
676.Fa ivec ; 675.Fa ivec ;
677use 676use
678.Fn DES_ncbc_encrypt 677.Fn DES_ncbc_encrypt
@@ -689,7 +688,7 @@ The second 12 bits will have the low 8 bits taken from the 3rd input
689byte and the top 4 bits taken from the 4th input byte. 688byte and the top 4 bits taken from the 4th input byte.
690The same holds for output. 689The same holds for output.
691This function has been implemented this way because most people will be 690This function has been implemented this way because most people will be
692using a multiple of 8 and because once you get into pulling bytes input 691using a multiple of 8 and because once you get into pulling input
693bytes apart things get ugly! 692bytes apart things get ugly!
694.Pp 693.Pp
695.Fn DES_string_to_key 694.Fn DES_string_to_key