diff options
author | schwarze <> | 2018-04-15 17:02:03 +0000 |
---|---|---|
committer | schwarze <> | 2018-04-15 17:02:03 +0000 |
commit | 8e0d0015d803e2db303942ec42a2e187853cb399 (patch) | |
tree | 9e18009b3c6be0ebc7dcf5101e962cea04369f89 | |
parent | 83e8d72fcb33da2c34c5964418ed6fa3b12d08c7 (diff) | |
download | openbsd-8e0d0015d803e2db303942ec42a2e187853cb399.tar.gz openbsd-8e0d0015d803e2db303942ec42a2e187853cb399.tar.bz2 openbsd-8e0d0015d803e2db303942ec42a2e187853cb399.zip |
Rewrite the ENGINE_*(3) documentation from scratch - step 2,
covering the remaining functions that were documented in engine(3),
except for seven functions that are completely pointless and that
were merely listed but not really documented.
-rw-r--r-- | src/lib/libcrypto/man/ENGINE_add.3 | 84 | ||||
-rw-r--r-- | src/lib/libcrypto/man/ENGINE_new.3 | 154 | ||||
-rw-r--r-- | src/lib/libcrypto/man/ENGINE_register_all_RSA.3 | 29 | ||||
-rw-r--r-- | src/lib/libcrypto/man/ENGINE_set_RSA.3 | 288 | ||||
-rw-r--r-- | src/lib/libcrypto/man/ENGINE_set_flags.3 | 79 | ||||
-rw-r--r-- | src/lib/libcrypto/man/ENGINE_unregister_RSA.3 | 4 | ||||
-rw-r--r-- | src/lib/libcrypto/man/Makefile | 5 | ||||
-rw-r--r-- | src/lib/libcrypto/man/engine.3 | 385 |
8 files changed, 633 insertions, 395 deletions
diff --git a/src/lib/libcrypto/man/ENGINE_add.3 b/src/lib/libcrypto/man/ENGINE_add.3 index faecb8a2ab..c54fa5cf05 100644 --- a/src/lib/libcrypto/man/ENGINE_add.3 +++ b/src/lib/libcrypto/man/ENGINE_add.3 | |||
@@ -1,4 +1,4 @@ | |||
1 | .\" $OpenBSD: ENGINE_add.3,v 1.1 2018/04/15 01:43:45 schwarze Exp $ | 1 | .\" $OpenBSD: ENGINE_add.3,v 1.2 2018/04/15 17:02:03 schwarze Exp $ |
2 | .\" content checked up to: OpenSSL 1f13ad31 Dec 25 17:50:39 2017 +0800 | 2 | .\" content checked up to: OpenSSL 1f13ad31 Dec 25 17:50:39 2017 +0800 |
3 | .\" | 3 | .\" |
4 | .\" Copyright (c) 2018 Ingo Schwarze <schwarze@openbsd.org> | 4 | .\" Copyright (c) 2018 Ingo Schwarze <schwarze@openbsd.org> |
@@ -20,7 +20,12 @@ | |||
20 | .Os | 20 | .Os |
21 | .Sh NAME | 21 | .Sh NAME |
22 | .Nm ENGINE_add , | 22 | .Nm ENGINE_add , |
23 | .Nm ENGINE_set_id , | ||
24 | .Nm ENGINE_get_id , | ||
25 | .Nm ENGINE_set_name , | ||
26 | .Nm ENGINE_get_name , | ||
23 | .Nm ENGINE_remove , | 27 | .Nm ENGINE_remove , |
28 | .Nm ENGINE_cleanup , | ||
24 | .Nm ENGINE_get_first , | 29 | .Nm ENGINE_get_first , |
25 | .Nm ENGINE_get_last , | 30 | .Nm ENGINE_get_last , |
26 | .Nm ENGINE_get_next , | 31 | .Nm ENGINE_get_next , |
@@ -34,9 +39,29 @@ | |||
34 | .Fa "ENGINE *e" | 39 | .Fa "ENGINE *e" |
35 | .Fc | 40 | .Fc |
36 | .Ft int | 41 | .Ft int |
42 | .Fo ENGINE_set_id | ||
43 | .Fa "ENGINE *e" | ||
44 | .Fa "const char *id" | ||
45 | .Fc | ||
46 | .Ft const char * | ||
47 | .Fo ENGINE_get_id | ||
48 | .Fa "const ENGINE *e" | ||
49 | .Fc | ||
50 | .Ft int | ||
51 | .Fo ENGINE_set_name | ||
52 | .Fa "ENGINE *e" | ||
53 | .Fa "const char *name" | ||
54 | .Fc | ||
55 | .Ft const char * | ||
56 | .Fo ENGINE_get_name | ||
57 | .Fa "const ENGINE *e" | ||
58 | .Fc | ||
59 | .Ft int | ||
37 | .Fo ENGINE_remove | 60 | .Fo ENGINE_remove |
38 | .Fa "ENGINE *e" | 61 | .Fa "ENGINE *e" |
39 | .Fc | 62 | .Fc |
63 | .Ft void | ||
64 | .Fn ENGINE_cleanup void | ||
40 | .Ft ENGINE * | 65 | .Ft ENGINE * |
41 | .Fn ENGINE_get_first void | 66 | .Fn ENGINE_get_first void |
42 | .Ft ENGINE * | 67 | .Ft ENGINE * |
@@ -63,12 +88,12 @@ appends | |||
63 | .Fa e | 88 | .Fa e |
64 | to the end of the list | 89 | to the end of the list |
65 | and increments its structural reference count by 1. | 90 | and increments its structural reference count by 1. |
66 | The name and identifier of | 91 | A unique identifier and a name of |
67 | .Fa e | 92 | .Fa e |
68 | have to be set with | 93 | have to be set with |
69 | .Xr ENGINE_set_name 3 | 94 | .Fn ENGINE_set_id |
70 | and | 95 | and |
71 | .Xr ENGINE_set_id 3 | 96 | .Fn ENGINE_set_name |
72 | before calling this function. | 97 | before calling this function. |
73 | .Fn ENGINE_add | 98 | .Fn ENGINE_add |
74 | fails if the list already contains an | 99 | fails if the list already contains an |
@@ -84,6 +109,26 @@ If successful, it calls | |||
84 | on | 109 | on |
85 | .Fa e . | 110 | .Fa e . |
86 | .Pp | 111 | .Pp |
112 | .Fn ENGINE_cleanup | ||
113 | calls | ||
114 | .Xr ENGINE_finish 3 | ||
115 | on all | ||
116 | .Vt ENGINE | ||
117 | objects that were selected as default engines, for example using the | ||
118 | functions documented in the | ||
119 | .Xr ENGINE_set_default 3 | ||
120 | and | ||
121 | .Xr ENGINE_get_default_RSA 3 | ||
122 | manual pages, and it calls | ||
123 | .Fn ENGINE_remove | ||
124 | on all | ||
125 | .Vt ENGINE | ||
126 | objects that were added to the global list with | ||
127 | .Fn ENGINE_add . | ||
128 | Calling this function is required at the end of each program using | ||
129 | .Fn ENGINE_add , | ||
130 | even if no engines are explicitly registered or used. | ||
131 | .Pp | ||
87 | .Fn ENGINE_get_first | 132 | .Fn ENGINE_get_first |
88 | and | 133 | and |
89 | .Fn ENGINE_get_last | 134 | .Fn ENGINE_get_last |
@@ -109,13 +154,40 @@ searches the list for an | |||
109 | .Vt ENGINE | 154 | .Vt ENGINE |
110 | object with a matching | 155 | object with a matching |
111 | .Fa id . | 156 | .Fa id . |
112 | If found, it increments the structural reference count of the | 157 | If found, it increments the structural reference count of the |
113 | retrieved object by 1. | 158 | retrieved object by 1. |
159 | If | ||
160 | .Dv ENGINE_FLAGS_BY_ID_COPY | ||
161 | was set on | ||
162 | .Fa e | ||
163 | with | ||
164 | .Xr ENGINE_set_flags 3 , | ||
165 | it returns a shallow copy of the object rather than incrementing | ||
166 | the reference count and returning a pointer to the original. | ||
114 | .Sh RETURN VALUES | 167 | .Sh RETURN VALUES |
115 | .Fn ENGINE_add | 168 | .Fn ENGINE_add , |
169 | .Fn ENGINE_set_id , | ||
170 | .Fn ENGINE_set_name , | ||
116 | and | 171 | and |
117 | .Fn ENGINE_remove | 172 | .Fn ENGINE_remove |
118 | return 1 on success or 0 on error. | 173 | return 1 on success or 0 on error. |
174 | .Fn ENGINE_set_id | ||
175 | and | ||
176 | .Fn ENGINE_set_name | ||
177 | can only fail if the supplied | ||
178 | .Fa id | ||
179 | or | ||
180 | .Fa name | ||
181 | is | ||
182 | .Dv NULL . | ||
183 | .Pp | ||
184 | .Fn ENGINE_get_id | ||
185 | and | ||
186 | .Fn ENGINE_get_name | ||
187 | return a pointer to an internal string | ||
188 | representing the identifier and the name of | ||
189 | .Fa e , | ||
190 | respectively. | ||
119 | .Pp | 191 | .Pp |
120 | .Fn ENGINE_get_first | 192 | .Fn ENGINE_get_first |
121 | and | 193 | and |
diff --git a/src/lib/libcrypto/man/ENGINE_new.3 b/src/lib/libcrypto/man/ENGINE_new.3 new file mode 100644 index 0000000000..ab875ce662 --- /dev/null +++ b/src/lib/libcrypto/man/ENGINE_new.3 | |||
@@ -0,0 +1,154 @@ | |||
1 | .\" $OpenBSD: ENGINE_new.3,v 1.1 2018/04/15 17:02:03 schwarze Exp $ | ||
2 | .\" content checked up to: | ||
3 | .\" OpenSSL ENGINE_add 1f13ad31 Dec 25 17:50:39 2017 +0800 | ||
4 | .\" | ||
5 | .\" Copyright (c) 2018 Ingo Schwarze <schwarze@openbsd.org> | ||
6 | .\" | ||
7 | .\" Permission to use, copy, modify, and distribute this software for any | ||
8 | .\" purpose with or without fee is hereby granted, provided that the above | ||
9 | .\" copyright notice and this permission notice appear in all copies. | ||
10 | .\" | ||
11 | .\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES | ||
12 | .\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF | ||
13 | .\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR | ||
14 | .\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES | ||
15 | .\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN | ||
16 | .\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF | ||
17 | .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. | ||
18 | .\" | ||
19 | .Dd $Mdocdate: April 15 2018 $ | ||
20 | .Dt ENGINE_NEW 3 | ||
21 | .Os | ||
22 | .Sh NAME | ||
23 | .Nm ENGINE_new , | ||
24 | .Nm ENGINE_up_ref , | ||
25 | .Nm ENGINE_free , | ||
26 | .Nm ENGINE_set_destroy_function , | ||
27 | .Nm ENGINE_get_destroy_function | ||
28 | .Nd create and destroy ENGINE objects | ||
29 | .Sh SYNOPSIS | ||
30 | .In openssl/engine.h | ||
31 | .Ft ENGINE * | ||
32 | .Fn ENGINE_new void | ||
33 | .Ft int | ||
34 | .Fo ENGINE_up_ref | ||
35 | .Fa "ENGINE *e" | ||
36 | .Fc | ||
37 | .Ft int | ||
38 | .Fo ENGINE_free | ||
39 | .Fa "ENGINE *e" | ||
40 | .Fc | ||
41 | .Ft typedef int | ||
42 | .Fo (*ENGINE_GEN_INT_FUNC_PTR) | ||
43 | .Fa "ENGINE *e" | ||
44 | .Fc | ||
45 | .Ft int | ||
46 | .Fo ENGINE_set_destroy_function | ||
47 | .Fa "ENGINE *e" | ||
48 | .Fa "ENGINE_GEN_INT_FUNC_PTR destroy_f" | ||
49 | .Fc | ||
50 | .Ft ENGINE_GEN_INT_FUNC_PTR | ||
51 | .Fo ENGINE_get_destroy_function | ||
52 | .Fa "const ENGINE *e" | ||
53 | .Fc | ||
54 | .Sh DESCRIPTION | ||
55 | .Fn ENGINE_new | ||
56 | allocates and initializes an empty | ||
57 | .Vt ENGINE | ||
58 | object and sets its structural reference count to 1 | ||
59 | and its functional reference count to 0. | ||
60 | For more information about the functional reference count, see the | ||
61 | .Xr ENGINE_init 3 | ||
62 | manual page. | ||
63 | .Pp | ||
64 | Many functions increment the structural reference count by 1 | ||
65 | when successful. | ||
66 | Some of them, including | ||
67 | .Xr ENGINE_get_first 3 , | ||
68 | .Xr ENGINE_get_last 3 , | ||
69 | .Xr ENGINE_get_next 3 , | ||
70 | .Xr ENGINE_get_prev 3 , | ||
71 | and | ||
72 | .Xr ENGINE_by_id 3 , | ||
73 | do so because they return a structural reference to the user. | ||
74 | Other functions, including | ||
75 | .Xr ENGINE_add 3 , | ||
76 | .Xr ENGINE_init 3 , | ||
77 | .Xr ENGINE_get_cipher_engine 3 , | ||
78 | .Xr ENGINE_get_digest_engine 3 , | ||
79 | and the | ||
80 | .Xr ENGINE_get_default_RSA 3 | ||
81 | and | ||
82 | .Xr ENGINE_set_default 3 | ||
83 | families of functions | ||
84 | do so when they store a structural refence internally. | ||
85 | .Pp | ||
86 | .Fn ENGINE_up_ref | ||
87 | explicitly increment the structural reference count by 1. | ||
88 | .Pp | ||
89 | .Fn ENGINE_free | ||
90 | decrements the structural reference count by 1, | ||
91 | and if it reaches 0, the optional | ||
92 | .Fa destroy_f | ||
93 | previously installed with | ||
94 | .Fn ENGINE_set_destroy_function | ||
95 | is called, if one is installed, and both the memory used internally by | ||
96 | .Fa e | ||
97 | and | ||
98 | .Fa e | ||
99 | itself are freed. | ||
100 | If | ||
101 | .Fa e | ||
102 | is a | ||
103 | .Dv NULL | ||
104 | pointer, no action occurs. | ||
105 | .Pp | ||
106 | Many functions internally call the equivalent of | ||
107 | .Fn ENGINE_free . | ||
108 | Some of them, including | ||
109 | .Xr ENGINE_get_next 3 | ||
110 | and | ||
111 | .Xr ENGINE_get_prev 3 , | ||
112 | thus invalidate the structural reference passed in by the user. | ||
113 | Other functions, including | ||
114 | .Xr ENGINE_finish 3 , | ||
115 | .Xr ENGINE_remove 3 , | ||
116 | and the | ||
117 | .Xr ENGINE_set_default 3 | ||
118 | family of functions | ||
119 | do so when an internally stored structural reference is no longer needed. | ||
120 | .Pp | ||
121 | .Fn ENGINE_set_destroy_function | ||
122 | installs a callback function that will be called by | ||
123 | .Fn ENGINE_free , | ||
124 | but only when | ||
125 | .Fa e | ||
126 | actually gets destroyed, | ||
127 | not when only its reference count gets decremented. | ||
128 | The value returned from the | ||
129 | .Fa destroy_f | ||
130 | will be ignored. | ||
131 | .Sh RETURN VALUES | ||
132 | .Fn ENGINE_new | ||
133 | returns a structural reference to the new | ||
134 | .Vt ENGINE | ||
135 | object or | ||
136 | .Dv NULL | ||
137 | if an error occurs. | ||
138 | .Pp | ||
139 | .Fn ENGINE_up_ref | ||
140 | returns 0 if | ||
141 | .Fa e | ||
142 | is | ||
143 | .Dv NULL | ||
144 | and 1 otherwise. | ||
145 | .Pp | ||
146 | .Fn ENGINE_free | ||
147 | and | ||
148 | .Fn ENGINE_set_destroy_function | ||
149 | always return 1. | ||
150 | .Pp | ||
151 | .Fn ENGINE_get_destroy_function | ||
152 | returns a function pointer to the callback, or | ||
153 | .Dv NULL | ||
154 | if none is installed. | ||
diff --git a/src/lib/libcrypto/man/ENGINE_register_all_RSA.3 b/src/lib/libcrypto/man/ENGINE_register_all_RSA.3 index f92a12b2f9..cb9a41f2a9 100644 --- a/src/lib/libcrypto/man/ENGINE_register_all_RSA.3 +++ b/src/lib/libcrypto/man/ENGINE_register_all_RSA.3 | |||
@@ -1,4 +1,4 @@ | |||
1 | .\" $OpenBSD: ENGINE_register_all_RSA.3,v 1.1 2018/04/15 01:43:45 schwarze Exp $ | 1 | .\" $OpenBSD: ENGINE_register_all_RSA.3,v 1.2 2018/04/15 17:02:03 schwarze Exp $ |
2 | .\" content checked up to: | 2 | .\" content checked up to: |
3 | .\" OpenSSL ENGINE_add 1f13ad31 Dec 25 17:50:39 2017 +0800 | 3 | .\" OpenSSL ENGINE_add 1f13ad31 Dec 25 17:50:39 2017 +0800 |
4 | .\" | 4 | .\" |
@@ -29,7 +29,9 @@ | |||
29 | .Nm ENGINE_register_all_STORE , | 29 | .Nm ENGINE_register_all_STORE , |
30 | .Nm ENGINE_register_all_ciphers , | 30 | .Nm ENGINE_register_all_ciphers , |
31 | .Nm ENGINE_register_all_digests , | 31 | .Nm ENGINE_register_all_digests , |
32 | .Nm ENGINE_register_all_complete | 32 | .Nm ENGINE_register_all_complete , |
33 | .Nm ENGINE_load_builtin_engines , | ||
34 | .Nm ENGINE_load_dynamic | ||
33 | .Nd register all engines as implementing an algorithm | 35 | .Nd register all engines as implementing an algorithm |
34 | .Sh SYNOPSIS | 36 | .Sh SYNOPSIS |
35 | .In openssl/engine.h | 37 | .In openssl/engine.h |
@@ -53,6 +55,10 @@ | |||
53 | .Fn ENGINE_register_all_digests void | 55 | .Fn ENGINE_register_all_digests void |
54 | .Ft int | 56 | .Ft int |
55 | .Fn ENGINE_register_all_complete void | 57 | .Fn ENGINE_register_all_complete void |
58 | .Ft void | ||
59 | .Fn ENGINE_load_builtin_engines void | ||
60 | .Ft void | ||
61 | .Fn ENGINE_load_dynamic void | ||
56 | .Sh DESCRIPTION | 62 | .Sh DESCRIPTION |
57 | These functions loop over all the | 63 | These functions loop over all the |
58 | .Vt ENGINE | 64 | .Vt ENGINE |
@@ -70,4 +76,21 @@ in this way, except that it skips those | |||
70 | .Vt ENGINE | 76 | .Vt ENGINE |
71 | objects that have the | 77 | objects that have the |
72 | .Dv ENGINE_FLAGS_NO_REGISTER_ALL | 78 | .Dv ENGINE_FLAGS_NO_REGISTER_ALL |
73 | flag set. | 79 | flag set with |
80 | .Xr ENGINE_set_flags 3 . | ||
81 | .Pp | ||
82 | .Fn ENGINE_load_builtin_engines | ||
83 | calls | ||
84 | .Xr OPENSSL_init_crypto 3 | ||
85 | with no options, loads any built-in engines | ||
86 | that are enabled by default, and calls | ||
87 | .Fn ENGINE_register_all_complete . | ||
88 | Currently, LibreSSL does not provide any engines. | ||
89 | .Sy GOST | ||
90 | and | ||
91 | .Sy aesni | ||
92 | support is provided by the crypto library itself | ||
93 | and does not require any engines, not even built-in ones. | ||
94 | .Pp | ||
95 | .Fn ENGINE_load_dynamic | ||
96 | has no effect and is only provided for compatibility. | ||
diff --git a/src/lib/libcrypto/man/ENGINE_set_RSA.3 b/src/lib/libcrypto/man/ENGINE_set_RSA.3 new file mode 100644 index 0000000000..d795f55c72 --- /dev/null +++ b/src/lib/libcrypto/man/ENGINE_set_RSA.3 | |||
@@ -0,0 +1,288 @@ | |||
1 | .\" $OpenBSD: ENGINE_set_RSA.3,v 1.1 2018/04/15 17:02:03 schwarze Exp $ | ||
2 | .\" content checked up to: | ||
3 | .\" OpenSSL ENGINE_add 1f13ad31 Dec 25 17:50:39 2017 +0800 | ||
4 | .\" | ||
5 | .\" Copyright (c) 2018 Ingo Schwarze <schwarze@openbsd.org> | ||
6 | .\" | ||
7 | .\" Permission to use, copy, modify, and distribute this software for any | ||
8 | .\" purpose with or without fee is hereby granted, provided that the above | ||
9 | .\" copyright notice and this permission notice appear in all copies. | ||
10 | .\" | ||
11 | .\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES | ||
12 | .\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF | ||
13 | .\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR | ||
14 | .\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES | ||
15 | .\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN | ||
16 | .\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF | ||
17 | .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. | ||
18 | .\" | ||
19 | .Dd $Mdocdate: April 15 2018 $ | ||
20 | .Dt ENGINE_SET_RSA 3 | ||
21 | .Os | ||
22 | .Sh NAME | ||
23 | .Nm ENGINE_set_RSA , | ||
24 | .Nm ENGINE_get_RSA , | ||
25 | .Nm ENGINE_set_DSA , | ||
26 | .Nm ENGINE_get_DSA , | ||
27 | .Nm ENGINE_set_ECDH , | ||
28 | .Nm ENGINE_get_ECDH , | ||
29 | .Nm ENGINE_set_ECDSA , | ||
30 | .Nm ENGINE_get_ECDSA , | ||
31 | .Nm ENGINE_set_DH , | ||
32 | .Nm ENGINE_get_DH , | ||
33 | .Nm ENGINE_set_RAND , | ||
34 | .Nm ENGINE_get_RAND , | ||
35 | .Nm ENGINE_set_STORE , | ||
36 | .Nm ENGINE_get_STORE , | ||
37 | .Nm ENGINE_set_ciphers , | ||
38 | .Nm ENGINE_get_ciphers , | ||
39 | .Nm ENGINE_get_cipher , | ||
40 | .Nm ENGINE_set_digests , | ||
41 | .Nm ENGINE_get_digests , | ||
42 | .Nm ENGINE_get_digest | ||
43 | .Nd install and retrieve function tables of crypto engines | ||
44 | .Sh SYNOPSIS | ||
45 | .In openssl/engine.h | ||
46 | .Ft int | ||
47 | .Fo ENGINE_set_RSA | ||
48 | .Fa "ENGINE *e" | ||
49 | .Fa "const RSA_METHOD *rsa_meth" | ||
50 | .Fc | ||
51 | .Ft const RSA_METHOD * | ||
52 | .Fo ENGINE_get_RSA | ||
53 | .Fa "const ENGINE *e" | ||
54 | .Fc | ||
55 | .Ft int | ||
56 | .Fo ENGINE_set_DSA | ||
57 | .Fa "ENGINE *e" | ||
58 | .Fa "const DSA_METHOD *dsa_meth" | ||
59 | .Fc | ||
60 | .Ft const DSA_METHOD * | ||
61 | .Fo ENGINE_get_DSA | ||
62 | .Fa "const ENGINE *e" | ||
63 | .Fc | ||
64 | .Ft int | ||
65 | .Fo ENGINE_set_ECDH | ||
66 | .Fa "ENGINE *e" | ||
67 | .Fa "const ECDH_METHOD *dh_meth" | ||
68 | .Fc | ||
69 | .Ft const ECDH_METHOD * | ||
70 | .Fo ENGINE_get_ECDH | ||
71 | .Fa "const ENGINE *e" | ||
72 | .Fc | ||
73 | .Ft int | ||
74 | .Fo ENGINE_set_ECDSA | ||
75 | .Fa "ENGINE *e" | ||
76 | .Fa "const ECDSA_METHOD *dh_meth" | ||
77 | .Fc | ||
78 | .Ft const ECDSA_METHOD * | ||
79 | .Fo ENGINE_get_ECDSA | ||
80 | .Fa "const ENGINE *e" | ||
81 | .Fc | ||
82 | .Ft int | ||
83 | .Fo ENGINE_set_DH | ||
84 | .Fa "ENGINE *e" | ||
85 | .Fa "const DH_METHOD *dh_meth" | ||
86 | .Fc | ||
87 | .Ft const DH_METHOD * | ||
88 | .Fo ENGINE_get_DH | ||
89 | .Fa "const ENGINE *e" | ||
90 | .Fc | ||
91 | .Ft int | ||
92 | .Fo ENGINE_set_RAND | ||
93 | .Fa "ENGINE *e" | ||
94 | .Fa "const RAND_METHOD *rand_meth" | ||
95 | .Fc | ||
96 | .Ft const RAND_METHOD * | ||
97 | .Fo ENGINE_get_RAND | ||
98 | .Fa "const ENGINE *e" | ||
99 | .Fc | ||
100 | .Ft int | ||
101 | .Fo ENGINE_set_STORE | ||
102 | .Fa "ENGINE *e" | ||
103 | .Fa "const STORE_METHOD *rand_meth" | ||
104 | .Fc | ||
105 | .Ft const STORE_METHOD * | ||
106 | .Fo ENGINE_get_STORE | ||
107 | .Fa "const ENGINE *e" | ||
108 | .Fc | ||
109 | .Ft typedef int | ||
110 | .Fo (*ENGINE_CIPHERS_PTR) | ||
111 | .Fa "ENGINE *e" | ||
112 | .Fa "const EVP_CIPHER **impl" | ||
113 | .Fa "const int **nids" | ||
114 | .Fa "int nid" | ||
115 | .Fc | ||
116 | .Ft int | ||
117 | .Fo ENGINE_set_ciphers | ||
118 | .Fa "ENGINE *e" | ||
119 | .Fa "ENGINE_CIPHERS_PTR f" | ||
120 | .Fc | ||
121 | .Ft ENGINE_CIPHERS_PTR | ||
122 | .Fo ENGINE_get_ciphers | ||
123 | .Fa "const ENGINE *e" | ||
124 | .Fc | ||
125 | .Ft const EVP_CIPHER * | ||
126 | .Fo ENGINE_get_cipher | ||
127 | .Fa "ENGINE *e" | ||
128 | .Fa "int nid" | ||
129 | .Fc | ||
130 | .Ft typedef int | ||
131 | .Fo (*ENGINE_DIGESTS_PTR) | ||
132 | .Fa "ENGINE *e" | ||
133 | .Fa "const EVP_MD **impl" | ||
134 | .Fa "const int **nids" | ||
135 | .Fa "int nid" | ||
136 | .Fc | ||
137 | .Ft int | ||
138 | .Fo ENGINE_set_digests | ||
139 | .Fa "ENGINE *e" | ||
140 | .Fa "ENGINE_DIGESTS_PTR f" | ||
141 | .Fc | ||
142 | .Ft ENGINE_DIGESTS_PTR | ||
143 | .Fo ENGINE_get_digests | ||
144 | .Fa "const ENGINE *e" | ||
145 | .Fc | ||
146 | .Ft const EVP_MD * | ||
147 | .Fo ENGINE_get_digest | ||
148 | .Fa "ENGINE *e" | ||
149 | .Fa "int nid" | ||
150 | .Fc | ||
151 | .Sh DESCRIPTION | ||
152 | The | ||
153 | .Fn ENGINE_set_* | ||
154 | functions install a table of function pointers | ||
155 | implementing the respective algorithm in | ||
156 | .Fa e . | ||
157 | Partial information about the various method objects is available from | ||
158 | .Xr RSA_meth_new 3 , | ||
159 | .Xr RSA_get_default_method 3 , | ||
160 | .Xr DSA_meth_new 3 , | ||
161 | .Xr DSA_get_default_method 3 , | ||
162 | .Fn ECDH_get_default_method , | ||
163 | .Xr ECDSA_get_default_method 3 , | ||
164 | .Xr DH_get_default_method 3 , | ||
165 | .Xr RAND_get_rand_method 3 , | ||
166 | .Xr EVP_get_cipherbynid 3 , | ||
167 | and | ||
168 | .Xr EVP_get_digestbynid 3 . | ||
169 | .Vt STORE_METHOD | ||
170 | is an incomplete type, and the pointers to it are not used for anything. | ||
171 | For complete descriptions of these types, | ||
172 | refer to the respective header files. | ||
173 | .Pp | ||
174 | The functions described in the | ||
175 | .Xr ENGINE_register_RSA 3 | ||
176 | and | ||
177 | .Xr ENGINE_set_default 3 | ||
178 | manual pages only have an effect after function pointers | ||
179 | were installed using the functions decribed here. | ||
180 | .Pp | ||
181 | .Fn ENGINE_set_ciphers | ||
182 | and | ||
183 | .Fn ENGINE_set_digests | ||
184 | are special in so far as the | ||
185 | .Vt ENGINE | ||
186 | structure does not provide fields to store function pointers | ||
187 | implementing ciphers or digests. | ||
188 | Instead, these two functions only install a callback to | ||
189 | retrieve implementations. | ||
190 | Where the pointers to the implementations are stored internally, | ||
191 | how they get initialized, and how the | ||
192 | .Vt ENGINE_CIPHERS_PTR | ||
193 | and | ||
194 | .Vt ENGINE_DIGESTS_PTR | ||
195 | callbacks retrieve them | ||
196 | is up to the implementation of each individual engine. | ||
197 | .Pp | ||
198 | If the | ||
199 | .Vt ENGINE_CIPHERS_PTR | ||
200 | and | ||
201 | .Vt ENGINE_DIGESTS_PTR | ||
202 | callbacks are called with a non-zero | ||
203 | .Fa nid , | ||
204 | they retrieve the implementation of that cipher or digest, | ||
205 | respectively. | ||
206 | In this case, a | ||
207 | .Dv NULL | ||
208 | pointer can be passed as the | ||
209 | .Fa nids | ||
210 | argument. | ||
211 | .Fn ENGINE_get_cipher | ||
212 | and | ||
213 | .Fn ENGINE_get_digest | ||
214 | call the callbacks installed in | ||
215 | .Fa e | ||
216 | in this way. | ||
217 | .Pp | ||
218 | If 0 is passed as the | ||
219 | .Fa nid | ||
220 | argument, an internal pointer | ||
221 | to the array of implementations available in | ||
222 | .Fa e | ||
223 | is returned in | ||
224 | .Pf * Fa impl , | ||
225 | and an internal pointer | ||
226 | to the array of corresponding identifiers in | ||
227 | .Pf * Fa nids . | ||
228 | The return value of the callback indicates | ||
229 | the number of implementations returned. | ||
230 | .Pp | ||
231 | The | ||
232 | .Fn ENGINE_get_* | ||
233 | functions retrieve the previously installed function tables. | ||
234 | They are used when constructing basic cryptographic objects | ||
235 | as shown in the following table: | ||
236 | .Bl -column "ENGINE_get_digestMM" | ||
237 | .It Accessor: Ta Called by: | ||
238 | .It Fn ENGINE_get_RSA Ta Xr RSA_new_method 3 , Xr RSA_new 3 | ||
239 | .It Fn ENGINE_get_DSA Ta Xr DSA_new_method 3 , Xr DSA_new 3 | ||
240 | .It Fn ENGINE_get_ECDH Ta Fn ECDH_set_method , Fn ECDH_compute_key | ||
241 | .It Fn ENGINE_get_ECDSA Ta Xr ECDSA_set_method 3 , Xr ECDSA_sign_setup 3 , | ||
242 | .Xr ECDSA_do_sign_ex 3 , Xr ECDSA_do_verify 3 | ||
243 | .It Fn ENGINE_get_DH Ta Xr DH_new_method 3 , Xr DH_new 3 | ||
244 | .It Fn ENGINE_get_RAND Ta unused | ||
245 | .It Fn ENGINE_get_STORE Ta unused | ||
246 | .It Fn ENGINE_get_cipher Ta Xr EVP_CipherInit_ex 3 | ||
247 | .It Fn ENGINE_get_digest Ta Xr EVP_DigestInit_ex 3 | ||
248 | .El | ||
249 | .Sh RETURN VALUES | ||
250 | The | ||
251 | .Fn ENGINE_set_* | ||
252 | functions return 1 on success or 0 on error. | ||
253 | Currently, they cannot fail. | ||
254 | .Pp | ||
255 | The | ||
256 | .Fn ENGINE_get_* | ||
257 | functions return a method object for the respective algorithm, or | ||
258 | .Dv NULL | ||
259 | if none is installed. | ||
260 | .Pp | ||
261 | .Fn ENGINE_get_ciphers | ||
262 | and | ||
263 | .Fn ENGINE_get_digests | ||
264 | return a function pointer to the respective callback, or | ||
265 | .Dv NULL | ||
266 | if none is installed. | ||
267 | .Pp | ||
268 | .Fn ENGINE_get_cipher | ||
269 | returns an | ||
270 | .Vt EVP_CIPHER | ||
271 | object implementing the cipher | ||
272 | .Fa nid | ||
273 | or | ||
274 | .Dv NULL | ||
275 | if | ||
276 | .Fa e | ||
277 | does not implement that cipher. | ||
278 | .Pp | ||
279 | .Fn ENGINE_get_digest | ||
280 | returns an | ||
281 | .Vt EVP_MD | ||
282 | object implementing the digest | ||
283 | .Fa nid | ||
284 | or | ||
285 | .Dv NULL | ||
286 | if | ||
287 | .Fa e | ||
288 | does not implement that digest. | ||
diff --git a/src/lib/libcrypto/man/ENGINE_set_flags.3 b/src/lib/libcrypto/man/ENGINE_set_flags.3 new file mode 100644 index 0000000000..a4ac107f9e --- /dev/null +++ b/src/lib/libcrypto/man/ENGINE_set_flags.3 | |||
@@ -0,0 +1,79 @@ | |||
1 | .\" $OpenBSD: ENGINE_set_flags.3,v 1.1 2018/04/15 17:02:03 schwarze Exp $ | ||
2 | .\" content checked up to: | ||
3 | .\" OpenSSL ENGINE_add 1f13ad31 Dec 25 17:50:39 2017 +0800 | ||
4 | .\" | ||
5 | .\" Copyright (c) 2018 Ingo Schwarze <schwarze@openbsd.org> | ||
6 | .\" | ||
7 | .\" Permission to use, copy, modify, and distribute this software for any | ||
8 | .\" purpose with or without fee is hereby granted, provided that the above | ||
9 | .\" copyright notice and this permission notice appear in all copies. | ||
10 | .\" | ||
11 | .\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES | ||
12 | .\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF | ||
13 | .\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR | ||
14 | .\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES | ||
15 | .\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN | ||
16 | .\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF | ||
17 | .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. | ||
18 | .\" | ||
19 | .Dd $Mdocdate: April 15 2018 $ | ||
20 | .Dt ENGINE_SET_FLAGS 3 | ||
21 | .Os | ||
22 | .Sh NAME | ||
23 | .Nm ENGINE_set_flags , | ||
24 | .Nm ENGINE_get_flags | ||
25 | .Nd modify the behaviour of an ENGINE object | ||
26 | .Sh SYNOPSIS | ||
27 | .In openssl/engine.h | ||
28 | .Ft int | ||
29 | .Fo ENGINE_set_flags | ||
30 | .Fa "ENGINE *e" | ||
31 | .Fa "int flags" | ||
32 | .Fc | ||
33 | .Ft int | ||
34 | .Fo ENGINE_get_flags | ||
35 | .Fa "const ENGINE *e" | ||
36 | .Fc | ||
37 | .Sh DESCRIPTION | ||
38 | .Fn ENGINE_set_flags | ||
39 | sets the flags attribute of | ||
40 | .Fa e | ||
41 | to the new | ||
42 | .Fa flags . | ||
43 | The previous state of the flags attribute is overwritten. | ||
44 | Flags that were previously set are cleared | ||
45 | unless they are also present in the new | ||
46 | .Fa flags . | ||
47 | .Pp | ||
48 | The | ||
49 | .Fa flags | ||
50 | argument can be the bitwise OR of zero or more | ||
51 | of the following constants: | ||
52 | .Bl -tag -width Ds | ||
53 | .It Dv ENGINE_FLAGS_BY_ID_COPY | ||
54 | .Xr ENGINE_by_id 3 | ||
55 | returns a shallow copy of the | ||
56 | .Vt ENGINE | ||
57 | object it found rather than incrementing the reference count | ||
58 | and returning a pointer to the original. | ||
59 | .It Dv ENGINE_FLAGS_MANUAL_CMD_CTRL | ||
60 | .Xr ENGINE_ctrl 3 | ||
61 | lets the function installed with | ||
62 | .Xr ENGINE_set_ctrl_function 3 | ||
63 | handle all commands except | ||
64 | .Dv ENGINE_CTRL_HAS_CTRL_FUNCTION , | ||
65 | even the builtin commands. | ||
66 | .It Dv ENGINE_FLAGS_NO_REGISTER_ALL | ||
67 | .Xr ENGINE_register_all_complete 3 | ||
68 | skips | ||
69 | .Fa e . | ||
70 | .El | ||
71 | .Sh RETURN VALUES | ||
72 | .Fn ENGINE_set_flags | ||
73 | always returns 1. | ||
74 | .Pp | ||
75 | .Fn ENGINE_get_flags | ||
76 | returns the | ||
77 | .Fa flags | ||
78 | attribute of | ||
79 | .Fa e . | ||
diff --git a/src/lib/libcrypto/man/ENGINE_unregister_RSA.3 b/src/lib/libcrypto/man/ENGINE_unregister_RSA.3 index c596554e86..698bfe105d 100644 --- a/src/lib/libcrypto/man/ENGINE_unregister_RSA.3 +++ b/src/lib/libcrypto/man/ENGINE_unregister_RSA.3 | |||
@@ -1,4 +1,4 @@ | |||
1 | .\" $OpenBSD: ENGINE_unregister_RSA.3,v 1.1 2018/04/15 01:43:45 schwarze Exp $ | 1 | .\" $OpenBSD: ENGINE_unregister_RSA.3,v 1.2 2018/04/15 17:02:03 schwarze Exp $ |
2 | .\" content checked up to: | 2 | .\" content checked up to: |
3 | .\" OpenSSL ENGINE_add 1f13ad31 Dec 25 17:50:39 2017 +0800 | 3 | .\" OpenSSL ENGINE_add 1f13ad31 Dec 25 17:50:39 2017 +0800 |
4 | .\" | 4 | .\" |
@@ -85,7 +85,7 @@ as described in the | |||
85 | and | 85 | and |
86 | .Fn ENGINE_get_default_RSA 3 | 86 | .Fn ENGINE_get_default_RSA 3 |
87 | manual pages, | 87 | manual pages, |
88 | .Xr ENGINE_finish | 88 | .Xr ENGINE_finish 3 |
89 | is also called. | 89 | is also called. |
90 | .Pp | 90 | .Pp |
91 | .Fn ENGINE_unregister_ciphers | 91 | .Fn ENGINE_unregister_ciphers |
diff --git a/src/lib/libcrypto/man/Makefile b/src/lib/libcrypto/man/Makefile index a83ae5d3ed..695485aeeb 100644 --- a/src/lib/libcrypto/man/Makefile +++ b/src/lib/libcrypto/man/Makefile | |||
@@ -1,4 +1,4 @@ | |||
1 | # $OpenBSD: Makefile,v 1.139 2018/04/15 01:43:45 schwarze Exp $ | 1 | # $OpenBSD: Makefile,v 1.140 2018/04/15 17:02:03 schwarze Exp $ |
2 | 2 | ||
3 | .include <bsd.own.mk> | 3 | .include <bsd.own.mk> |
4 | 4 | ||
@@ -101,9 +101,12 @@ MAN= \ | |||
101 | ENGINE_ctrl.3 \ | 101 | ENGINE_ctrl.3 \ |
102 | ENGINE_get_default_RSA.3 \ | 102 | ENGINE_get_default_RSA.3 \ |
103 | ENGINE_init.3 \ | 103 | ENGINE_init.3 \ |
104 | ENGINE_new.3 \ | ||
104 | ENGINE_register_RSA.3 \ | 105 | ENGINE_register_RSA.3 \ |
105 | ENGINE_register_all_RSA.3 \ | 106 | ENGINE_register_all_RSA.3 \ |
107 | ENGINE_set_RSA.3 \ | ||
106 | ENGINE_set_default.3 \ | 108 | ENGINE_set_default.3 \ |
109 | ENGINE_set_flags.3 \ | ||
107 | ENGINE_unregister_RSA.3 \ | 110 | ENGINE_unregister_RSA.3 \ |
108 | ERR.3 \ | 111 | ERR.3 \ |
109 | ERR_GET_LIB.3 \ | 112 | ERR_GET_LIB.3 \ |
diff --git a/src/lib/libcrypto/man/engine.3 b/src/lib/libcrypto/man/engine.3 index fac4fa13e1..ebcc95f310 100644 --- a/src/lib/libcrypto/man/engine.3 +++ b/src/lib/libcrypto/man/engine.3 | |||
@@ -1,4 +1,4 @@ | |||
1 | .\" $OpenBSD: engine.3,v 1.15 2018/04/15 01:43:45 schwarze Exp $ | 1 | .\" $OpenBSD: engine.3,v 1.16 2018/04/15 17:02:03 schwarze Exp $ |
2 | .\" full merge up to: OpenSSL crypto/engine e6390aca Jul 21 10:06:03 2015 -0400 | 2 | .\" full merge up to: OpenSSL crypto/engine e6390aca Jul 21 10:06:03 2015 -0400 |
3 | .\" selective merge up to: man3/ENGINE_add 1f13ad31 Dec 25 17:50:39 2017 +0800 | 3 | .\" selective merge up to: man3/ENGINE_add 1f13ad31 Dec 25 17:50:39 2017 +0800 |
4 | .\" | 4 | .\" |
@@ -55,227 +55,8 @@ | |||
55 | .Dt ENGINE 3 | 55 | .Dt ENGINE 3 |
56 | .Os | 56 | .Os |
57 | .Sh NAME | 57 | .Sh NAME |
58 | .Nm ENGINE_load_openssl , | 58 | .Nm engine |
59 | .Nm ENGINE_load_dynamic , | ||
60 | .Nm ENGINE_load_builtin_engines , | ||
61 | .Nm ENGINE_cleanup , | ||
62 | .Nm ENGINE_new , | ||
63 | .Nm ENGINE_free , | ||
64 | .Nm ENGINE_up_ref , | ||
65 | .Nm ENGINE_set_id , | ||
66 | .Nm ENGINE_set_name , | ||
67 | .Nm ENGINE_set_RSA , | ||
68 | .Nm ENGINE_set_DSA , | ||
69 | .Nm ENGINE_set_ECDH , | ||
70 | .Nm ENGINE_set_ECDSA , | ||
71 | .Nm ENGINE_set_DH , | ||
72 | .Nm ENGINE_set_RAND , | ||
73 | .Nm ENGINE_set_STORE , | ||
74 | .Nm ENGINE_set_destroy_function , | ||
75 | .Nm ENGINE_set_load_privkey_function , | ||
76 | .Nm ENGINE_set_load_pubkey_function , | ||
77 | .Nm ENGINE_set_ciphers , | ||
78 | .Nm ENGINE_set_digests , | ||
79 | .Nm ENGINE_set_flags , | ||
80 | .Nm ENGINE_get_id , | ||
81 | .Nm ENGINE_get_name , | ||
82 | .Nm ENGINE_get_RSA , | ||
83 | .Nm ENGINE_get_DSA , | ||
84 | .Nm ENGINE_get_ECDH , | ||
85 | .Nm ENGINE_get_ECDSA , | ||
86 | .Nm ENGINE_get_DH , | ||
87 | .Nm ENGINE_get_RAND , | ||
88 | .Nm ENGINE_get_STORE , | ||
89 | .Nm ENGINE_get_destroy_function , | ||
90 | .Nm ENGINE_get_load_privkey_function , | ||
91 | .Nm ENGINE_get_load_pubkey_function , | ||
92 | .Nm ENGINE_get_ciphers , | ||
93 | .Nm ENGINE_get_digests , | ||
94 | .Nm ENGINE_get_cipher , | ||
95 | .Nm ENGINE_get_digest , | ||
96 | .Nm ENGINE_get_flags , | ||
97 | .Nm ENGINE_load_private_key , | ||
98 | .Nm ENGINE_load_public_key | ||
99 | .Nd ENGINE cryptographic module support | 59 | .Nd ENGINE cryptographic module support |
100 | .Sh SYNOPSIS | ||
101 | .In openssl/engine.h | ||
102 | .Ft void | ||
103 | .Fn ENGINE_load_openssl void | ||
104 | .Ft void | ||
105 | .Fn ENGINE_load_dynamic void | ||
106 | .Ft void | ||
107 | .Fn ENGINE_load_builtin_engines void | ||
108 | .Ft void | ||
109 | .Fn ENGINE_cleanup void | ||
110 | .Ft ENGINE * | ||
111 | .Fn ENGINE_new void | ||
112 | .Ft int | ||
113 | .Fo ENGINE_free | ||
114 | .Fa "ENGINE *e" | ||
115 | .Fc | ||
116 | .Ft int | ||
117 | .Fo ENGINE_up_ref | ||
118 | .Fa "ENGINE *e" | ||
119 | .Fc | ||
120 | .Ft int | ||
121 | .Fo ENGINE_set_id | ||
122 | .Fa "ENGINE *e" | ||
123 | .Fa "const char *id" | ||
124 | .Fc | ||
125 | .Ft int | ||
126 | .Fo ENGINE_set_name | ||
127 | .Fa "ENGINE *e" | ||
128 | .Fa "const char *name" | ||
129 | .Fc | ||
130 | .Ft int | ||
131 | .Fo ENGINE_set_RSA | ||
132 | .Fa "ENGINE *e" | ||
133 | .Fa "const RSA_METHOD *rsa_meth" | ||
134 | .Fc | ||
135 | .Ft int | ||
136 | .Fo ENGINE_set_DSA | ||
137 | .Fa "ENGINE *e" | ||
138 | .Fa "const DSA_METHOD *dsa_meth" | ||
139 | .Fc | ||
140 | .Ft int | ||
141 | .Fo ENGINE_set_ECDH | ||
142 | .Fa "ENGINE *e" | ||
143 | .Fa "const ECDH_METHOD *dh_meth" | ||
144 | .Fc | ||
145 | .Ft int | ||
146 | .Fo ENGINE_set_ECDSA | ||
147 | .Fa "ENGINE *e" | ||
148 | .Fa "const ECDSA_METHOD *dh_meth" | ||
149 | .Fc | ||
150 | .Ft int | ||
151 | .Fo ENGINE_set_DH | ||
152 | .Fa "ENGINE *e" | ||
153 | .Fa "const DH_METHOD *dh_meth" | ||
154 | .Fc | ||
155 | .Ft int | ||
156 | .Fo ENGINE_set_RAND | ||
157 | .Fa "ENGINE *e" | ||
158 | .Fa "const RAND_METHOD *rand_meth" | ||
159 | .Fc | ||
160 | .Ft int | ||
161 | .Fo ENGINE_set_STORE | ||
162 | .Fa "ENGINE *e" | ||
163 | .Fa "const STORE_METHOD *rand_meth" | ||
164 | .Fc | ||
165 | .Ft int | ||
166 | .Fo ENGINE_set_destroy_function | ||
167 | .Fa "ENGINE *e" | ||
168 | .Fa "ENGINE_GEN_INT_FUNC_PTR destroy_f" | ||
169 | .Fc | ||
170 | .Ft int | ||
171 | .Fo ENGINE_set_load_privkey_function | ||
172 | .Fa "ENGINE *e" | ||
173 | .Fa "ENGINE_LOAD_KEY_PTR loadpriv_f" | ||
174 | .Fc | ||
175 | .Ft int | ||
176 | .Fo ENGINE_set_load_pubkey_function | ||
177 | .Fa "ENGINE *e" | ||
178 | .Fa "ENGINE_LOAD_KEY_PTR loadpub_f" | ||
179 | .Fc | ||
180 | .Ft int | ||
181 | .Fo ENGINE_set_ciphers | ||
182 | .Fa "ENGINE *e" | ||
183 | .Fa "ENGINE_CIPHERS_PTR f" | ||
184 | .Fc | ||
185 | .Ft int | ||
186 | .Fo ENGINE_set_digests | ||
187 | .Fa "ENGINE *e" | ||
188 | .Fa "ENGINE_DIGESTS_PTR f" | ||
189 | .Fc | ||
190 | .Ft int | ||
191 | .Fo ENGINE_set_flags | ||
192 | .Fa "ENGINE *e" | ||
193 | .Fa "int flags" | ||
194 | .Fc | ||
195 | .Ft const char * | ||
196 | .Fo ENGINE_get_id | ||
197 | .Fa "const ENGINE *e" | ||
198 | .Fc | ||
199 | .Ft const char * | ||
200 | .Fo ENGINE_get_name | ||
201 | .Fa "const ENGINE *e" | ||
202 | .Fc | ||
203 | .Ft const RSA_METHOD * | ||
204 | .Fo ENGINE_get_RSA | ||
205 | .Fa "const ENGINE *e" | ||
206 | .Fc | ||
207 | .Ft const DSA_METHOD * | ||
208 | .Fo ENGINE_get_DSA | ||
209 | .Fa "const ENGINE *e" | ||
210 | .Fc | ||
211 | .Ft const ECDH_METHOD * | ||
212 | .Fo ENGINE_get_ECDH | ||
213 | .Fa "const ENGINE *e" | ||
214 | .Fc | ||
215 | .Ft const ECDSA_METHOD * | ||
216 | .Fo ENGINE_get_ECDSA | ||
217 | .Fa "const ENGINE *e" | ||
218 | .Fc | ||
219 | .Ft const DH_METHOD * | ||
220 | .Fo ENGINE_get_DH | ||
221 | .Fa "const ENGINE *e" | ||
222 | .Fc | ||
223 | .Ft const RAND_METHOD * | ||
224 | .Fo ENGINE_get_RAND | ||
225 | .Fa "const ENGINE *e" | ||
226 | .Fc | ||
227 | .Ft const STORE_METHOD * | ||
228 | .Fo ENGINE_get_STORE | ||
229 | .Fa "const ENGINE *e" | ||
230 | .Fc | ||
231 | .Ft ENGINE_GEN_INT_FUNC_PTR | ||
232 | .Fo ENGINE_get_destroy_function | ||
233 | .Fa "const ENGINE *e" | ||
234 | .Fc | ||
235 | .Ft ENGINE_LOAD_KEY_PTR | ||
236 | .Fo ENGINE_get_load_privkey_function | ||
237 | .Fa "const ENGINE *e" | ||
238 | .Fc | ||
239 | .Ft ENGINE_LOAD_KEY_PTR | ||
240 | .Fo ENGINE_get_load_pubkey_function | ||
241 | .Fa "const ENGINE *e" | ||
242 | .Fc | ||
243 | .Ft ENGINE_CIPHERS_PTR | ||
244 | .Fo ENGINE_get_ciphers | ||
245 | .Fa "const ENGINE *e" | ||
246 | .Fc | ||
247 | .Ft ENGINE_DIGESTS_PTR | ||
248 | .Fo ENGINE_get_digests | ||
249 | .Fa "const ENGINE *e" | ||
250 | .Fc | ||
251 | .Ft const EVP_CIPHER * | ||
252 | .Fo ENGINE_get_cipher | ||
253 | .Fa "ENGINE *e" | ||
254 | .Fa "int nid" | ||
255 | .Fc | ||
256 | .Ft const EVP_MD * | ||
257 | .Fo ENGINE_get_digest | ||
258 | .Fa "ENGINE *e" | ||
259 | .Fa "int nid" | ||
260 | .Fc | ||
261 | .Ft int | ||
262 | .Fo ENGINE_get_flags | ||
263 | .Fa "const ENGINE *e" | ||
264 | .Fc | ||
265 | .Ft EVP_PKEY * | ||
266 | .Fo ENGINE_load_private_key | ||
267 | .Fa "ENGINE *e" | ||
268 | .Fa "const char *key_id" | ||
269 | .Fa "UI_METHOD *ui_method" | ||
270 | .Fa "void *callback_data" | ||
271 | .Fc | ||
272 | .Ft EVP_PKEY * | ||
273 | .Fo ENGINE_load_public_key | ||
274 | .Fa "ENGINE *e" | ||
275 | .Fa "const char *key_id" | ||
276 | .Fa "UI_METHOD *ui_method" | ||
277 | .Fa "void *callback_data" | ||
278 | .Fc | ||
279 | .Sh DESCRIPTION | 60 | .Sh DESCRIPTION |
280 | These functions create, manipulate, and use cryptographic modules | 61 | These functions create, manipulate, and use cryptographic modules |
281 | in the form of | 62 | in the form of |
@@ -369,64 +150,6 @@ Essentially a structural reference is sufficient if you only need to | |||
369 | query or manipulate the data of an | 150 | query or manipulate the data of an |
370 | .Vt ENGINE | 151 | .Vt ENGINE |
371 | implementation rather than use its functionality. | 152 | implementation rather than use its functionality. |
372 | .Pp | ||
373 | .Fn ENGINE_new | ||
374 | allocates and initializes an empty | ||
375 | .Vt ENGINE | ||
376 | object and sets its structural reference count to 1 | ||
377 | and its functional reference count to 0. | ||
378 | Many functions increment the structural reference count by 1 | ||
379 | when successful. | ||
380 | Some of them, including | ||
381 | .Xr ENGINE_by_id 3 , | ||
382 | .Xr ENGINE_get_first 3 , | ||
383 | .Xr ENGINE_get_last 3 , | ||
384 | .Xr ENGINE_get_next 3 , | ||
385 | and | ||
386 | .Xr ENGINE_get_prev 3 , | ||
387 | do so because they return a structural reference to the user. | ||
388 | Other functions, including | ||
389 | .Xr ENGINE_add 3 , | ||
390 | .Xr ENGINE_init 3 , | ||
391 | .Xr ENGINE_get_cipher_engine 3 , | ||
392 | .Xr ENGINE_get_digest_engine 3 , | ||
393 | and the | ||
394 | .Xr ENGINE_get_default_RSA 3 | ||
395 | and | ||
396 | .Xr ENGINE_set_default 3 | ||
397 | families of functions | ||
398 | do so because they store a structural refence internally. | ||
399 | .Fn ENGINE_up_ref | ||
400 | explicitly increment the structural reference count by 1. | ||
401 | .Pp | ||
402 | .Fn ENGINE_free | ||
403 | decrements the structural reference count by 1, | ||
404 | and if it reaches 0, the cleanup function associated with | ||
405 | .Fa e | ||
406 | is called, and both the memory used internally by | ||
407 | .Fa e | ||
408 | and | ||
409 | .Fa e | ||
410 | itself are freed. | ||
411 | If | ||
412 | .Fa e | ||
413 | is a | ||
414 | .Dv NULL | ||
415 | pointer, no action occurs. | ||
416 | Many functions internally call the equivalent of | ||
417 | .Fn ENGINE_free . | ||
418 | Some of them, including | ||
419 | .Xr ENGINE_get_next 3 | ||
420 | and | ||
421 | .Xr ENGINE_get_prev 3 , | ||
422 | thus invalidate the structural reference passed in by the user. | ||
423 | Other functions, including | ||
424 | .Xr ENGINE_finish 3 , | ||
425 | .Xr ENGINE_remove 3 , | ||
426 | and the | ||
427 | .Xr ENGINE_set_default 3 | ||
428 | family of functions | ||
429 | do so when an internally stored structural reference is no longer needed. | ||
430 | .Ss Application requirements | 153 | .Ss Application requirements |
431 | This section will explain the basic things an application programmer | 154 | This section will explain the basic things an application programmer |
432 | should support to make the most useful elements of the | 155 | should support to make the most useful elements of the |
@@ -450,15 +173,6 @@ code at all. | |||
450 | So the first consideration is whether any/all available | 173 | So the first consideration is whether any/all available |
451 | .Vt ENGINE | 174 | .Vt ENGINE |
452 | implementations should be made visible to OpenSSL. | 175 | implementations should be made visible to OpenSSL. |
453 | This is controlled by calling the various "load" functions, e.g. | ||
454 | .Fn ENGINE_load_builtin_engines | ||
455 | to make all | ||
456 | .Vt ENGINE | ||
457 | implementations bundled with OpenSSL available. | ||
458 | .Pp | ||
459 | Note that | ||
460 | .Fn ENGINE_load_dynamic | ||
461 | is a placeholder and does not enable dynamic engine loading support. | ||
462 | .Pp | 176 | .Pp |
463 | Having called any of these functions, | 177 | Having called any of these functions, |
464 | .Vt ENGINE | 178 | .Vt ENGINE |
@@ -466,33 +180,6 @@ objects would have been dynamically allocated and populated with | |||
466 | these implementations and linked into OpenSSL's internal linked | 180 | these implementations and linked into OpenSSL's internal linked |
467 | list. | 181 | list. |
468 | .Pp | 182 | .Pp |
469 | If no | ||
470 | .Nm engine | ||
471 | API functions are called at all in an application, then there are | ||
472 | no inherent memory leaks to worry about from the | ||
473 | .Nm engine | ||
474 | functionality, however if any | ||
475 | .Vt ENGINE Ns s | ||
476 | are loaded, even if they are never registered or used, it is necessary | ||
477 | to use the | ||
478 | .Fn ENGINE_cleanup | ||
479 | function to correspondingly cleanup before program exit, if the caller | ||
480 | wishes to avoid memory leaks. | ||
481 | This mechanism uses an internal callback registration table so that any | ||
482 | .Nm engine | ||
483 | API functionality that knows it requires cleanup can register its | ||
484 | cleanup details to be called during | ||
485 | .Fn ENGINE_cleanup . | ||
486 | This approach allows | ||
487 | .Fn ENGINE_cleanup | ||
488 | to clean up after any | ||
489 | .Nm engine | ||
490 | functionality at all that your program uses, yet doesn't automatically | ||
491 | create linker dependencies to all possible | ||
492 | .Nm engine | ||
493 | functionality - only the cleanup callbacks required by the functionality | ||
494 | you do use will be required by the linker. | ||
495 | .Pp | ||
496 | The fact that | 183 | The fact that |
497 | .Vt ENGINE Ns s | 184 | .Vt ENGINE Ns s |
498 | are made visible to OpenSSL (and thus are linked into the program | 185 | are made visible to OpenSSL (and thus are linked into the program |
@@ -836,74 +523,6 @@ to see if they implement "FOO_GET_VENDOR_LOGO_GIF" - and | |||
836 | .Vt ENGINE | 523 | .Vt ENGINE |
837 | could therefore decide whether or not to support this "foo"-specific | 524 | could therefore decide whether or not to support this "foo"-specific |
838 | extension). | 525 | extension). |
839 | .Sh RETURN VALUES | ||
840 | .Fn ENGINE_get_cipher_engine , | ||
841 | .Fn ENGINE_get_digest_engine , | ||
842 | and | ||
843 | .Fn ENGINE_new | ||
844 | return a valid | ||
845 | .Vt ENGINE | ||
846 | structure or | ||
847 | .Dv NULL | ||
848 | if an error occurred. | ||
849 | .Pp | ||
850 | .Fn ENGINE_free , | ||
851 | .Fn ENGINE_up_ref , | ||
852 | and all | ||
853 | .Fn ENGINE_set_* | ||
854 | functions return 1 on success or 0 on error. | ||
855 | .Pp | ||
856 | .Fn ENGINE_get_id | ||
857 | and | ||
858 | .Fn ENGINE_get_name | ||
859 | return a pointer to an internal string representing the identifier | ||
860 | and the name of | ||
861 | .Fa e , | ||
862 | respectively. | ||
863 | .Pp | ||
864 | .Fn ENGINE_get_RSA , | ||
865 | .Fn ENGINE_get_DSA , | ||
866 | .Fn ENGINE_get_DH , | ||
867 | .Fn ENGINE_get_RAND , | ||
868 | and | ||
869 | .Fn ENGINE_get_STORE | ||
870 | return a method structure for the respective algorithm. | ||
871 | .Pp | ||
872 | .Fn ENGINE_get_destroy_function , | ||
873 | .Fn ENGINE_get_load_privkey_function , | ||
874 | .Fn ENGINE_get_load_pubkey_function , | ||
875 | .Fn ENGINE_get_ciphers , | ||
876 | and | ||
877 | .Fn ENGINE_get_digests | ||
878 | return a function pointer to the respective callback. | ||
879 | .Pp | ||
880 | .Fn ENGINE_get_cipher | ||
881 | returns a valid | ||
882 | .Vt EVP_CIPHER | ||
883 | structure on success or | ||
884 | .Dv NULL | ||
885 | if an error occurred. | ||
886 | .Pp | ||
887 | .Fn ENGINE_get_digest | ||
888 | returns a valid | ||
889 | .Vt EVP_MD | ||
890 | structure on success or | ||
891 | .Dv NULL | ||
892 | if an error occurred. | ||
893 | .Pp | ||
894 | .Fn ENGINE_get_flags | ||
895 | returns an integer representing the flags | ||
896 | which are used to control various behaviours of an | ||
897 | .Vt ENGINE . | ||
898 | .Pp | ||
899 | .Fn ENGINE_load_private_key | ||
900 | and | ||
901 | .Fn ENGINE_load_public_key | ||
902 | return a valid | ||
903 | .Vt EVP_PKEY | ||
904 | structure on success or | ||
905 | .Dv NULL | ||
906 | if an error occurred. | ||
907 | .Sh SEE ALSO | 526 | .Sh SEE ALSO |
908 | .Xr DH_new 3 , | 527 | .Xr DH_new 3 , |
909 | .Xr DSA_new 3 , | 528 | .Xr DSA_new 3 , |