summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/man
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/libcrypto/man')
-rw-r--r--src/lib/libcrypto/man/Makefile10
-rw-r--r--src/lib/libcrypto/man/OPENSSL_VERSION_NUMBER.396
-rw-r--r--src/lib/libcrypto/man/OPENSSL_config.3115
-rw-r--r--src/lib/libcrypto/man/OPENSSL_load_builtin_modules.353
-rw-r--r--src/lib/libcrypto/man/OpenSSL_add_all_algorithms.371
5 files changed, 340 insertions, 5 deletions
diff --git a/src/lib/libcrypto/man/Makefile b/src/lib/libcrypto/man/Makefile
index 802b34399f..17efba0d08 100644
--- a/src/lib/libcrypto/man/Makefile
+++ b/src/lib/libcrypto/man/Makefile
@@ -1,4 +1,4 @@
1# $OpenBSD: Makefile,v 1.40 2016/11/03 10:24:26 schwarze Exp $ 1# $OpenBSD: Makefile,v 1.41 2016/11/03 12:21:50 schwarze Exp $
2 2
3.include <bsd.own.mk> # for NOMAN 3.include <bsd.own.mk> # for NOMAN
4 4
@@ -118,6 +118,10 @@ MAN= \
118 HMAC.3 \ 118 HMAC.3 \
119 MD5.3 \ 119 MD5.3 \
120 OBJ_nid2obj.3 \ 120 OBJ_nid2obj.3 \
121 OPENSSL_VERSION_NUMBER.3 \
122 OPENSSL_config.3 \
123 OPENSSL_load_builtin_modules.3 \
124 OpenSSL_add_all_algorithms.3 \
121 UI_new.3 \ 125 UI_new.3 \
122 bn_dump.3 \ 126 bn_dump.3 \
123 crypto.3 \ 127 crypto.3 \
@@ -128,10 +132,6 @@ MAN= \
128 lh_new.3 \ 132 lh_new.3 \
129 133
130GENMAN= \ 134GENMAN= \
131 OPENSSL_VERSION_NUMBER.3 \
132 OPENSSL_config.3 \
133 OPENSSL_load_builtin_modules.3 \
134 OpenSSL_add_all_algorithms.3 \
135 PKCS5_PBKDF2_HMAC.3 \ 135 PKCS5_PBKDF2_HMAC.3 \
136 PEM_read_bio_PrivateKey.3 \ 136 PEM_read_bio_PrivateKey.3 \
137 PEM_write_bio_PKCS7_stream.3 \ 137 PEM_write_bio_PKCS7_stream.3 \
diff --git a/src/lib/libcrypto/man/OPENSSL_VERSION_NUMBER.3 b/src/lib/libcrypto/man/OPENSSL_VERSION_NUMBER.3
new file mode 100644
index 0000000000..660a964427
--- /dev/null
+++ b/src/lib/libcrypto/man/OPENSSL_VERSION_NUMBER.3
@@ -0,0 +1,96 @@
1.Dd $Mdocdate: November 3 2016 $
2.Dt OPENSSL_VERSION_NUMBER 3
3.Os
4.Sh NAME
5.Nm OPENSSL_VERSION_NUMBER ,
6.Nm SSLeay ,
7.Nm SSLeay_version
8.Nd get OpenSSL version number
9.Sh SYNOPSIS
10.In openssl/opensslv.h
11.Fd #define OPENSSL_VERSION_NUMBER 0xnnnnnnnnnL
12.In openssl/crypto.h
13.Ft long
14.Fn SSLeay void
15.Ft const char *
16.Fo SSLeay_version
17.Fa "int t"
18.Fc
19.Sh DESCRIPTION
20.Dv OPENSSL_VERSION_NUMBER
21is a numeric release version identifier.
22The first two digits contain the major release number,
23the third and fourth digits the minor release number,
24the fifth and sixth digits the fix release number,
25the seventh and eight digits the patch release number.
26The final digit is 0 for development, 1 to e for betas 1 to 14, or f
27for release.
28.Pp
29For example:
30.Bd -literal -offset indent
310x000906000 == 0.9.6 dev
320x000906023 == 0.9.6b beta 3
330x00090605f == 0.9.6e release
34.Ed
35.Pp
36Versions prior to 0.9.3 had identifiers < 0x0930.
37For versions between 0.9.3 and 0.9.5,
38the seventh digit was 1 for release and 0 otherwise,
39and the eighth and ninth digits were the patch release number.
40.Pp
41For example:
42.Bd -literal
430x000904100 == 0.9.4 release
440x000905000 == 0.9.5 dev
45.Ed
46.Pp
47Version 0.9.5a had an interim interpretation that is like the current
48one, except the patch level got the highest bit set, to keep continuity.
49The number was therefore 0x0090581f.
50.Pp
51For backward compatibility, SSLEAY_VERSION_NUMBER is also defined.
52.Pp
53.Fn SSLeay
54returns this number.
55The return value can be compared to the macro to make sure that the
56correct version of the library has been loaded, especially when using
57DLLs on Windows systems.
58.Pp
59.Fn SSLeay_version
60returns different strings depending on
61.Fa t :
62.Bl -tag -width Ds
63.It Dv SSLEAY_VERSION
64The text variant of the version number and the release date.
65For example, "OpenSSL 0.9.5a 1 Apr 2000".
66.It Dv SSLEAY_CFLAGS
67The compiler flags set for the compilation process in the form
68"compiler: ..." if available or "compiler: information not available"
69otherwise.
70.It Dv SSLEAY_BUILT_ON
71The date of the build process in the form "built on: ..." if available
72or "built on: date not available" otherwise.
73.It Dv SSLEAY_PLATFORM
74The "Configure" target of the library build in the form "platform: ..."
75if available or "platform: information not available" otherwise.
76.It Dv SSLEAY_DIR
77The "OPENSSLDIR" setting of the library build in the form "OPENSSLDIR:
78"..."" if available or "OPENSSLDIR: N/A" otherwise.
79.El
80.Pp
81For an unknown
82.Fa t ,
83the text "not available" is returned.
84.Sh RETURN VALUE
85The version number.
86.Sh SEE ALSO
87.Xr crypto 3
88.Sh HISTORY
89.Fn SSLeay
90and
91.Dv SSLEAY_VERSION_NUMBER
92are available in all versions of SSLeay and OpenSSL.
93.Dv OPENSSL_VERSION_NUMBER
94is available in all versions of OpenSSL.
95.Dv SSLEAY_DIR
96was added in OpenSSL 0.9.7.
diff --git a/src/lib/libcrypto/man/OPENSSL_config.3 b/src/lib/libcrypto/man/OPENSSL_config.3
new file mode 100644
index 0000000000..a944ba7b4e
--- /dev/null
+++ b/src/lib/libcrypto/man/OPENSSL_config.3
@@ -0,0 +1,115 @@
1.Dd $Mdocdate: November 3 2016 $
2.Dt OPENSSL_CONFIG 3
3.Os
4.Sh NAME
5.Nm OPENSSL_config ,
6.Nm OPENSSL_no_config
7.Nd simple OpenSSL configuration functions
8.Sh SYNOPSIS
9.In openssl/conf.h
10.Ft void
11.Fo OPENSSL_config
12.Fa "const char *config_name"
13.Fc
14.Ft void
15.Fn OPENSSL_no_config void
16.Sh DESCRIPTION
17.Fn OPENSSL_config
18configures OpenSSL using the standard
19.Pa openssl.cnf
20configuration file name using
21.Fa config_name .
22If
23.Fa config_name
24is
25.Dv NULL
26then the default name
27.Sy openssl_conf
28will be used.
29Any errors are ignored.
30Further calls to
31.Fn OPENSSL_config
32will have no effect.
33.Pp
34.Fn OPENSSL_no_config
35disables configuration.
36If called before
37.Fn OPENSSL_config ,
38no configuration takes place.
39.Pp
40It is
41.Sy strongly
42recommended that
43.Sy all
44new applications call
45.Fn OPENSSL_config
46or the more sophisticated functions such as
47.Xr CONF_modules_load 3
48during initialization (that is before starting any threads).
49By doing this, an application does not need to keep track of all
50configuration options and some new functionality can be supported
51automatically.
52.Pp
53It is also possible to automatically call
54.Fn OPENSSL_config
55when an application calls
56.Xr OPENSSL_add_all_algorithms 3
57by compiling an application with the preprocessor symbol
58.Dv OPENSSL_LOAD_CONF
59#define'd.
60In this way configuration can be added without source changes.
61.Pp
62The environment variable
63.Ev OPENSSL_CONF
64can be set to specify the location of the configuration file.
65.Pp
66Currently ASN1 OBJECT and ENGINE configuration can be performed.
67.Pp
68There are several reasons why calling the OpenSSL configuration routines
69is advisable.
70For example new ENGINE functionality was added to OpenSSL 0.9.7.
71In OpenSSL 0.9.7 control functions can be supported by ENGINEs, this can be
72used (among other things) to load dynamic ENGINEs from shared libraries
73(DSOs).
74However very few applications currently support the control interface
75and so very few can load and use dynamic ENGINEs.
76Equally in future more sophisticated ENGINEs will require certain
77control operations to customize them.
78If an application calls
79.Fn OPENSSL_config
80it doesn't need to know or care about ENGINE control operations because
81they can be performed by editing a configuration file.
82.Pp
83Applications should free up configuration at application closedown by
84calling
85.Xr CONF_modules_free 3 .
86.Sh RETURN VALUES
87Neither
88.Fn OPENSSL_config
89nor
90.Fn OPENSSL_no_config
91return a value.
92.Sh SEE ALSO
93.Xr CONF_modules_free 3 ,
94.Xr CONF_modules_load 3
95.Sh HISTORY
96.Fn OPENSSL_config
97and
98.Fn OPENSSL_no_config
99first appeared in OpenSSL 0.9.7.
100.Sh CAVEATS
101The
102.Fn OPENSSL_config
103function is designed to be a very simple "call it and forget it"
104function.
105As a result its behaviour is somewhat limited.
106It ignores all errors silently and it can only load from the standard
107configuration file location for example.
108.Pp
109It is however
110.Sy much
111better than nothing.
112Applications which need finer control over their configuration
113functionality should use the configuration functions such as
114.Xr CONF_load_modules 3
115directly.
diff --git a/src/lib/libcrypto/man/OPENSSL_load_builtin_modules.3 b/src/lib/libcrypto/man/OPENSSL_load_builtin_modules.3
new file mode 100644
index 0000000000..2a107ab7c4
--- /dev/null
+++ b/src/lib/libcrypto/man/OPENSSL_load_builtin_modules.3
@@ -0,0 +1,53 @@
1.Dd $Mdocdate: November 3 2016 $
2.Dt OPENSSL_LOAD_BUILTIN_MODULES 3
3.Os
4.Sh NAME
5.Nm OPENSSL_load_builtin_modules ,
6.Nm ASN1_add_oid_module ,
7.Nm ENGINE_add_conf_module
8.Nd add standard configuration modules
9.Sh SYNOPSIS
10.In openssl/conf.h
11.Ft void
12.Fn OPENSSL_load_builtin_modules void
13.Ft void
14.Fn ASN1_add_oid_module void
15.Ft void
16.Fn ENGINE_add_conf_module void
17.Sh DESCRIPTION
18The function
19.Fn OPENSSL_load_builtin_modules
20adds all the standard OpenSSL configuration modules to the internal
21list.
22They can then be used by the OpenSSL configuration code.
23.Pp
24.Fn ASN1_add_oid_module
25adds just the ASN1 OBJECT module.
26.Pp
27.Fn ENGINE_add_conf_module
28adds just the ENGINE configuration module.
29.Pp
30If the simple configuration function
31.Xr OPENSSL_config 3
32is called then
33.Fn OPENSSL_load_builtin_modules
34is called automatically.
35.Pp
36Applications which use the configuration functions directly will need to
37call
38.Fn OPENSSL_load_builtin_modules
39themselves
40.Em before
41any other configuration code.
42.Pp
43Applications should call
44.Fn OPENSSL_load_builtin_modules
45to load all configuration modules instead of adding modules selectively:
46otherwise functionality may be missing from the application when
47new modules are added.
48.Sh RETURN VALUE
49None of the functions return a value.
50.Sh SEE ALSO
51.Xr OPENSSL_config 3
52.Sh HISTORY
53These functions first appeared in OpenSSL 0.9.7.
diff --git a/src/lib/libcrypto/man/OpenSSL_add_all_algorithms.3 b/src/lib/libcrypto/man/OpenSSL_add_all_algorithms.3
new file mode 100644
index 0000000000..b6e93a939e
--- /dev/null
+++ b/src/lib/libcrypto/man/OpenSSL_add_all_algorithms.3
@@ -0,0 +1,71 @@
1.Dd $Mdocdate: November 3 2016 $
2.Dt OPENSSL_ADD_ALL_ALGORITHMS 3
3.Os
4.Sh NAME
5.Nm OpenSSL_add_all_algorithms ,
6.Nm OpenSSL_add_all_ciphers ,
7.Nm OpenSSL_add_all_digests ,
8.Nm EVP_cleanup
9.Nd add algorithms to internal table
10.Sh SYNOPSIS
11.In openssl/evp.h
12.Ft void
13.Fn OpenSSL_add_all_algorithms void
14.Ft void
15.Fn OpenSSL_add_all_ciphers void
16.Ft void
17.Fn OpenSSL_add_all_digests void
18.Ft void
19.Fn EVP_cleanup void
20.Sh DESCRIPTION
21OpenSSL keeps an internal table of digest algorithms and ciphers.
22It uses this table to lookup ciphers via functions such as
23.Xr EVP_get_cipherbyname 3 .
24.Pp
25.Fn OpenSSL_add_all_algorithms
26adds all algorithms to the table (digests and ciphers).
27.Pp
28.Fn OpenSSL_add_all_digests
29adds all digest algorithms to the table.
30.Pp
31.Fn OpenSSL_add_all_ciphers
32adds all encryption algorithms to the table including password based
33encryption algorithms.
34.Pp
35.Fn EVP_cleanup
36removes all ciphers and digests from the table.
37.Pp
38A typical application will call
39.Fn OpenSSL_add_all_algorithms
40initially and
41.Fn EVP_cleanup
42before exiting.
43.Pp
44An application does not need to add algorithms to use them explicitly,
45for example by
46.Xr EVP_sha1 3 .
47It just needs to add them if it (or any of the functions it calls) needs
48to lookup algorithms.
49.Pp
50The cipher and digest lookup functions are used in many parts of the
51library.
52If the table is not initialized, several functions will misbehave and
53complain they cannot find algorithms.
54This includes the PEM, PKCS#12, SSL and S/MIME libraries.
55This is a common query in the OpenSSL mailing lists.
56.Pp
57Calling
58.Fn OpenSSL_add_all_algorithms
59links in all algorithms: as a result a statically linked executable can
60be quite large.
61If this is important, it is possible to just add the required ciphers and
62digests.
63.Sh SEE ALSO
64.Xr evp 3 ,
65.Xr EVP_DigestInit 3 ,
66.Xr EVP_EncryptInit 3
67.Sh BUGS
68Although the functions do not return error codes, it is possible for them
69to fail.
70This will only happen as a result of a memory allocation failure so this
71is not too much of a problem in practice.