summaryrefslogtreecommitdiff
path: root/src/lib
diff options
context:
space:
mode:
authorschwarze <>2018-03-21 22:08:04 +0000
committerschwarze <>2018-03-21 22:08:04 +0000
commit06cedd6f2ac65939a767213f243a7c11aef2d0be (patch)
treec98fb17ad7143964c99a5e0a0e600ecd5d16e061 /src/lib
parenta270a496c5b6eff7217e0ad875c170ba530c6dd9 (diff)
downloadopenbsd-06cedd6f2ac65939a767213f243a7c11aef2d0be.tar.gz
openbsd-06cedd6f2ac65939a767213f243a7c11aef2d0be.tar.bz2
openbsd-06cedd6f2ac65939a767213f243a7c11aef2d0be.zip
Catch up after beck@ fixed autoconfiguration:
* Say more precisely what OPENSSL_config(3) and OPENSSL_no_config(3) do. * Revert the deprecation notice for them, nothing wrong with them. * Document OPENSSL_INIT_LOAD_CONFIG. * Deprecate OpenSSL_add_all_algorithms(3), it's now automatic. * Add OpenSSL_add_all_algorithms(3) HISTORY. Substantial feedback and OK beck@.
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/libcrypto/man/OPENSSL_config.339
-rw-r--r--src/lib/libcrypto/man/OPENSSL_init_crypto.325
-rw-r--r--src/lib/libcrypto/man/OpenSSL_add_all_algorithms.353
3 files changed, 55 insertions, 62 deletions
diff --git a/src/lib/libcrypto/man/OPENSSL_config.3 b/src/lib/libcrypto/man/OPENSSL_config.3
index 6e2a1ef56f..cdfdb3fea4 100644
--- a/src/lib/libcrypto/man/OPENSSL_config.3
+++ b/src/lib/libcrypto/man/OPENSSL_config.3
@@ -1,4 +1,4 @@
1.\" $OpenBSD: OPENSSL_config.3,v 1.8 2018/03/17 20:18:44 schwarze Exp $ 1.\" $OpenBSD: OPENSSL_config.3,v 1.9 2018/03/21 22:08:04 schwarze Exp $
2.\" full merge up to: OpenSSL b97fdb57 Nov 11 09:33:09 2016 +0100 2.\" full merge up to: OpenSSL b97fdb57 Nov 11 09:33:09 2016 +0100
3.\" 3.\"
4.\" This file is a derived work. 4.\" This file is a derived work.
@@ -65,13 +65,13 @@
65.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED 65.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
66.\" OF THE POSSIBILITY OF SUCH DAMAGE. 66.\" OF THE POSSIBILITY OF SUCH DAMAGE.
67.\" 67.\"
68.Dd $Mdocdate: March 17 2018 $ 68.Dd $Mdocdate: March 21 2018 $
69.Dt OPENSSL_CONFIG 3 69.Dt OPENSSL_CONFIG 3
70.Os 70.Os
71.Sh NAME 71.Sh NAME
72.Nm OPENSSL_config , 72.Nm OPENSSL_config ,
73.Nm OPENSSL_no_config 73.Nm OPENSSL_no_config
74.Nd old style crypto and ssl library initialization 74.Nd simple crypto and ssl library configuration
75.Sh SYNOPSIS 75.Sh SYNOPSIS
76.In openssl/conf.h 76.In openssl/conf.h
77.Ft void 77.Ft void
@@ -81,25 +81,12 @@
81.Ft void 81.Ft void
82.Fn OPENSSL_no_config void 82.Fn OPENSSL_no_config void
83.Sh DESCRIPTION 83.Sh DESCRIPTION
84These functions have been deprecated since OpenSSL 1.1.0.
85It is recommended to use
86.Xr CONF_modules_load_file 3
87instead of
88.Fn OPENSSL_config
89or
90.Xr OPENSSL_init_crypto 3
91with
92.Dv OPENSSL_INIT_NO_LOAD_CONFIG
93instead of
94.Fn OPENSSL_no_config .
95Except to disable the standard configuration file, application programs
96do not need to call any library initialization function at all because
97LibreSSL does all the required initialization automatically, and so does
98OpenSSL 1.1.0 and later.
99.Pp
100.Fn OPENSSL_config 84.Fn OPENSSL_config
101initializes the crypto library, in particular calling 85initializes the crypto library with
102.Xr OPENSSL_init_crypto 3 86.Xr OPENSSL_init_crypto 3
87and then calls
88.Xr OPENSSL_load_builtin_modules 3 ,
89.Xr ENGINE_load_builtin_engines 3 ,
103and 90and
104.Xr CONF_modules_load_file 3 91.Xr CONF_modules_load_file 3
105with the standard configuration file and the given 92with the standard configuration file and the given
@@ -117,10 +104,13 @@ Further calls to
117have no effect. 104have no effect.
118.Pp 105.Pp
119.Fn OPENSSL_no_config 106.Fn OPENSSL_no_config
120disables configuration. 107has no effect except that later calls to
121If called before 108.Fn OPENSSL_config
122.Fn OPENSSL_config , 109will be ignored.
123no configuration takes place. 110.Pp
111Calling these functions is optional.
112All required initialization of the crypto libraries happens
113automatically when needed.
124.Pp 114.Pp
125If an application is compiled with the preprocessor symbol 115If an application is compiled with the preprocessor symbol
126.Dv OPENSSL_LOAD_CONF 116.Dv OPENSSL_LOAD_CONF
@@ -141,6 +131,7 @@ standard configuration file
141.Xr CONF_modules_free 3 , 131.Xr CONF_modules_free 3 ,
142.Xr CONF_modules_load_file 3 , 132.Xr CONF_modules_load_file 3 ,
143.Xr OPENSSL_init_crypto 3 , 133.Xr OPENSSL_init_crypto 3 ,
134.Xr OPENSSL_load_builtin_modules 3 ,
144.Xr openssl.cnf 5 135.Xr openssl.cnf 5
145.Sh HISTORY 136.Sh HISTORY
146.Fn OPENSSL_config 137.Fn OPENSSL_config
diff --git a/src/lib/libcrypto/man/OPENSSL_init_crypto.3 b/src/lib/libcrypto/man/OPENSSL_init_crypto.3
index 27c60561fe..525d748cea 100644
--- a/src/lib/libcrypto/man/OPENSSL_init_crypto.3
+++ b/src/lib/libcrypto/man/OPENSSL_init_crypto.3
@@ -1,4 +1,4 @@
1.\" $OpenBSD: OPENSSL_init_crypto.3,v 1.1 2018/03/17 18:52:42 schwarze Exp $ 1.\" $OpenBSD: OPENSSL_init_crypto.3,v 1.2 2018/03/21 22:08:04 schwarze Exp $
2.\" Copyright (c) 2018 Ingo Schwarze <schwarze@openbsd.org> 2.\" Copyright (c) 2018 Ingo Schwarze <schwarze@openbsd.org>
3.\" 3.\"
4.\" Permission to use, copy, modify, and distribute this software for any 4.\" Permission to use, copy, modify, and distribute this software for any
@@ -13,7 +13,7 @@
13.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF 13.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
14.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 14.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
15.\" 15.\"
16.Dd $Mdocdate: March 17 2018 $ 16.Dd $Mdocdate: March 21 2018 $
17.Dt OPENSSL_INIT_CRYPTO 3 17.Dt OPENSSL_INIT_CRYPTO 3
18.Os 18.Os
19.Sh NAME 19.Sh NAME
@@ -31,14 +31,21 @@ If
31.Fn OPENSSL_init_crypto 31.Fn OPENSSL_init_crypto
32is called before any other crypto or ssl functions, the crypto 32is called before any other crypto or ssl functions, the crypto
33library is initialised by allocating various internal resources. 33library is initialised by allocating various internal resources.
34Unless the 34.Pp
35.Dv OPENSSL_INIT_NO_LOAD_CONFIG 35The following
36bit is set in the
37.Fa options 36.Fa options
38argument, the default 37are supported:
39.Xr openssl.cnf 5 38.Bl -tag -width Ds
40configuration file is also loaded as documented in 39.It Dv OPENSSL_INIT_LOAD_CONFIG
40At the end of the initialization, call
41.Xr OPENSSL_config 3
42with a
43.Dv NULL
44argument, loading the default configuration file.
45.It Dv OPENSSL_INIT_NO_LOAD_CONFIG
46Ignore any later calls to
41.Xr OPENSSL_config 3 . 47.Xr OPENSSL_config 3 .
48.El
42.Pp 49.Pp
43The other 50The other
44.Fa options 51.Fa options
@@ -61,7 +68,9 @@ the first one have any effect.
61is intended to return 1 on success or 0 on error. 68is intended to return 1 on success or 0 on error.
62.Sh SEE ALSO 69.Sh SEE ALSO
63.Xr CONF_modules_load_file 3 , 70.Xr CONF_modules_load_file 3 ,
71.Xr OPENSSL_config 3 ,
64.Xr OPENSSL_init_ssl 3 , 72.Xr OPENSSL_init_ssl 3 ,
73.Xr OPENSSL_load_builtin_modules 3 ,
65.Xr openssl.cnf 5 74.Xr openssl.cnf 5
66.Sh HISTORY 75.Sh HISTORY
67.Fn OPENSSL_init_crypto 76.Fn OPENSSL_init_crypto
diff --git a/src/lib/libcrypto/man/OpenSSL_add_all_algorithms.3 b/src/lib/libcrypto/man/OpenSSL_add_all_algorithms.3
index 270298cb85..329fef8130 100644
--- a/src/lib/libcrypto/man/OpenSSL_add_all_algorithms.3
+++ b/src/lib/libcrypto/man/OpenSSL_add_all_algorithms.3
@@ -1,5 +1,5 @@
1.\" $OpenBSD: OpenSSL_add_all_algorithms.3,v 1.4 2016/11/28 16:40:27 schwarze Exp $ 1.\" $OpenBSD: OpenSSL_add_all_algorithms.3,v 1.5 2018/03/21 22:08:04 schwarze Exp $
2.\" OpenSSL f672aee4 Feb 9 11:52:40 2016 -0500 2.\" full merge up to: OpenSSL b3696a55 Sep 2 09:35:50 2017 -0400
3.\" 3.\"
4.\" This file was written by Dr. Stephen Henson <steve@openssl.org>. 4.\" This file was written by Dr. Stephen Henson <steve@openssl.org>.
5.\" Copyright (c) 2000, 2003, 2013 The OpenSSL Project. All rights reserved. 5.\" Copyright (c) 2000, 2003, 2013 The OpenSSL Project. All rights reserved.
@@ -48,7 +48,7 @@
48.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED 48.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
49.\" OF THE POSSIBILITY OF SUCH DAMAGE. 49.\" OF THE POSSIBILITY OF SUCH DAMAGE.
50.\" 50.\"
51.Dd $Mdocdate: November 28 2016 $ 51.Dd $Mdocdate: March 21 2018 $
52.Dt OPENSSL_ADD_ALL_ALGORITHMS 3 52.Dt OPENSSL_ADD_ALL_ALGORITHMS 3
53.Os 53.Os
54.Sh NAME 54.Sh NAME
@@ -68,6 +68,11 @@
68.Ft void 68.Ft void
69.Fn EVP_cleanup void 69.Fn EVP_cleanup void
70.Sh DESCRIPTION 70.Sh DESCRIPTION
71These functions are deprecated.
72It is never useful for any application program
73to call any of them explicitly.
74The library automatically calls them internally whenever needed.
75.Pp
71OpenSSL keeps an internal table of digest algorithms and ciphers. 76OpenSSL keeps an internal table of digest algorithms and ciphers.
72It uses this table to look up ciphers via functions such as 77It uses this table to look up ciphers via functions such as
73.Xr EVP_get_cipherbyname 3 . 78.Xr EVP_get_cipherbyname 3 .
@@ -82,38 +87,26 @@ adds all digest algorithms to the table.
82adds all encryption algorithms to the table including password based 87adds all encryption algorithms to the table including password based
83encryption algorithms. 88encryption algorithms.
84.Pp 89.Pp
85.Fn EVP_cleanup 90If any of the above functions is called more than once,
86removes all ciphers and digests from the table. 91only the first call has an effect.
87.Pp 92.Pp
88A typical application will call
89.Fn OpenSSL_add_all_algorithms
90initially and
91.Fn EVP_cleanup 93.Fn EVP_cleanup
92before exiting. 94removes all ciphers and digests from the table.
93.Pp
94An application does not need to add algorithms to use them explicitly,
95for example by
96.Xr EVP_sha1 3 .
97It just needs to add them if it (or any of the functions it calls) needs
98to look up algorithms.
99.Pp
100The cipher and digest lookup functions are used in many parts of the
101library.
102If the table is not initialized, several functions will misbehave and
103complain they cannot find algorithms.
104This includes the PEM, PKCS#12, SSL and S/MIME libraries.
105This is a common query in the OpenSSL mailing lists.
106.Pp
107Calling
108.Fn OpenSSL_add_all_algorithms
109links in all algorithms: as a result a statically linked executable can
110be quite large.
111If this is important, it is possible to just add the required ciphers and
112digests.
113.Sh SEE ALSO 95.Sh SEE ALSO
114.Xr evp 3 , 96.Xr evp 3 ,
115.Xr EVP_DigestInit 3 , 97.Xr EVP_DigestInit 3 ,
116.Xr EVP_EncryptInit 3 98.Xr EVP_EncryptInit 3 ,
99.Xr OPENSSL_config 3 ,
100.Xr OPENSSL_init_crypto 3
101.Sh HISTORY
102.Fn EVP_cleanup
103and precursor functions
104.Fn SSLeay_add_all_algorithms ,
105.Fn SSLeay_add_all_ciphers ,
106and
107.Fn SSLeay_add_all_digests
108appeared in SSLeay 0.8.1b or earlier and have been available since
109.Ox 2.4 .
117.Sh BUGS 110.Sh BUGS
118Although the functions do not return error codes, it is possible for them 111Although the functions do not return error codes, it is possible for them
119to fail. 112to fail.