diff options
author | tb <> | 2023-11-19 10:19:54 +0000 |
---|---|---|
committer | tb <> | 2023-11-19 10:19:54 +0000 |
commit | e0497875926432eb64ab11574a6476e11ae5b79b (patch) | |
tree | 0b0a05f47a343e7e85d15f4f14a751f8a411339e /src | |
parent | e2b5859f42f2307d5547ecb61fa029f1a5f3be9a (diff) | |
download | openbsd-e0497875926432eb64ab11574a6476e11ae5b79b.tar.gz openbsd-e0497875926432eb64ab11574a6476e11ae5b79b.tar.bz2 openbsd-e0497875926432eb64ab11574a6476e11ae5b79b.zip |
Document the remaining ENGINE stubs in a single manual
Diffstat (limited to 'src')
-rw-r--r-- | src/lib/libcrypto/man/ENGINE_new.3 | 249 |
1 files changed, 103 insertions, 146 deletions
diff --git a/src/lib/libcrypto/man/ENGINE_new.3 b/src/lib/libcrypto/man/ENGINE_new.3 index eaab08d1f9..0081b8a0aa 100644 --- a/src/lib/libcrypto/man/ENGINE_new.3 +++ b/src/lib/libcrypto/man/ENGINE_new.3 | |||
@@ -1,7 +1,6 @@ | |||
1 | .\" $OpenBSD: ENGINE_new.3,v 1.5 2021/03/12 05:18:00 jsg Exp $ | 1 | .\" $OpenBSD: ENGINE_new.3,v 1.6 2023/11/19 10:19:54 tb Exp $ |
2 | .\" content checked up to: | ||
3 | .\" OpenSSL ENGINE_add 1f13ad31 Dec 25 17:50:39 2017 +0800 | ||
4 | .\" | 2 | .\" |
3 | .\" Copyright (c) 2023 Theo Buehler <tb@openbsd.org> | ||
5 | .\" Copyright (c) 2018 Ingo Schwarze <schwarze@openbsd.org> | 4 | .\" Copyright (c) 2018 Ingo Schwarze <schwarze@openbsd.org> |
6 | .\" | 5 | .\" |
7 | .\" Permission to use, copy, modify, and distribute this software for any | 6 | .\" Permission to use, copy, modify, and distribute this software for any |
@@ -16,175 +15,133 @@ | |||
16 | .\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF | 15 | .\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF |
17 | .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. | 16 | .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. |
18 | .\" | 17 | .\" |
19 | .Dd $Mdocdate: March 12 2021 $ | 18 | .Dd $Mdocdate: November 19 2023 $ |
20 | .Dt ENGINE_NEW 3 | 19 | .Dt ENGINE_NEW 3 |
21 | .Os | 20 | .Os |
22 | .Sh NAME | 21 | .Sh NAME |
23 | .Nm ENGINE_new , | 22 | .Nm ENGINE_new , |
24 | .Nm ENGINE_up_ref , | ||
25 | .Nm ENGINE_free , | 23 | .Nm ENGINE_free , |
26 | .Nm ENGINE_set_destroy_function , | 24 | .Nm ENGINE_init , |
27 | .Nm ENGINE_get_destroy_function | 25 | .Nm ENGINE_finish , |
28 | .Nd create and destroy ENGINE objects | 26 | .Nm ENGINE_by_id , |
27 | .Nm ENGINE_get_id , | ||
28 | .Nm ENGINE_get_name , | ||
29 | .Nm ENGINE_set_default , | ||
30 | .Nm ENGINE_get_default_RSA , | ||
31 | .Nm ENGINE_set_default_RSA , | ||
32 | .Nm ENGINE_load_private_key , | ||
33 | .Nm ENGINE_load_public_key , | ||
34 | .Nm ENGINE_load_builtin_engines , | ||
35 | .Nm ENGINE_load_dynamic , | ||
36 | .Nm ENGINE_load_openssl , | ||
37 | .Nm ENGINE_register_all_complete | ||
38 | .Nd ENGINE stub functions | ||
29 | .Sh SYNOPSIS | 39 | .Sh SYNOPSIS |
30 | .In openssl/engine.h | 40 | .In openssl/engine.h |
31 | .Ft ENGINE * | 41 | .Ft ENGINE * |
32 | .Fn ENGINE_new void | 42 | .Fn ENGINE_new void |
33 | .Ft int | 43 | .Ft int |
34 | .Fo ENGINE_up_ref | ||
35 | .Fa "ENGINE *e" | ||
36 | .Fc | ||
37 | .Ft int | ||
38 | .Fo ENGINE_free | 44 | .Fo ENGINE_free |
39 | .Fa "ENGINE *e" | 45 | .Fa "ENGINE *engine" |
40 | .Fc | ||
41 | .Ft typedef int | ||
42 | .Fo (*ENGINE_GEN_INT_FUNC_PTR) | ||
43 | .Fa "ENGINE *e" | ||
44 | .Fc | 46 | .Fc |
45 | .Ft int | 47 | .Ft int |
46 | .Fo ENGINE_set_destroy_function | 48 | .Fn ENGINE_init "ENGINE *engine" |
47 | .Fa "ENGINE *e" | 49 | .Ft int |
48 | .Fa "ENGINE_GEN_INT_FUNC_PTR destroy_f" | 50 | .Fn ENGINE_finish "ENGINE *engine" |
51 | .Ft ENGINE * | ||
52 | .Fn ENGINE_by_id "const char *id" | ||
53 | .Ft const char * | ||
54 | .Fn ENGINE_get_id "const ENGINE *engine" | ||
55 | .Ft const char * | ||
56 | .Fn ENGINE_get_name "const ENGINE *engine" | ||
57 | .Ft int | ||
58 | .Fn ENGINE_set_default "ENGINE *engine" "unsigned int flags" | ||
59 | .Ft ENGINE * | ||
60 | .Fn ENGINE_get_default_RSA "ENGINE *engine" | ||
61 | .Ft int | ||
62 | .Fn ENGINE_set_default_RSA "ENGINE *engine" | ||
63 | .Ft EVP_PKEY * | ||
64 | .Fo ENGINE_load_private_key | ||
65 | .Fa "ENGINE *engine" | ||
66 | .Fa "const char *key_id" | ||
67 | .Fa "UI_METHOD *ui_method" | ||
68 | .Fa "void *callback_data" | ||
49 | .Fc | 69 | .Fc |
50 | .Ft ENGINE_GEN_INT_FUNC_PTR | 70 | .Ft EVP_PKEY * |
51 | .Fo ENGINE_get_destroy_function | 71 | .Fo ENGINE_load_public_key |
52 | .Fa "const ENGINE *e" | 72 | .Fa "ENGINE *engine" |
73 | .Fa "const char *key_id" | ||
74 | .Fa "UI_METHOD *ui_method" | ||
75 | .Fa "void *callback_data" | ||
53 | .Fc | 76 | .Fc |
77 | .Ft void | ||
78 | .Fn ENGINE_load_builtin_engines "void" | ||
79 | .Ft void | ||
80 | .Fn ENGINE_load_dynamic "void" | ||
81 | .Ft void | ||
82 | .Fn ENGINE_load_openssl "void" | ||
83 | .Ft int | ||
84 | .Fn ENGINE_register_all_complete "void" | ||
54 | .Sh DESCRIPTION | 85 | .Sh DESCRIPTION |
55 | .Vt ENGINE | 86 | .Vt ENGINE |
56 | objects can be used to provide alternative implementations of | 87 | objects used to provide alternative implementations of |
57 | cryptographic algorithms, to support additional algorithms, to | 88 | cryptographic algorithms, for example using specialized hardware. |
58 | support cryptographic hardware, and to switch among alternative | 89 | LibreSSL no longer supports this feature. |
59 | implementations of algorithms at run time. | ||
60 | LibreSSL generally avoids engines and prefers providing | ||
61 | cryptographic functionality in the crypto library itself. | ||
62 | .Pp | ||
63 | .Fn ENGINE_new | ||
64 | allocates and initializes an empty | ||
65 | .Vt ENGINE | ||
66 | object and sets its structural reference count to 1 | ||
67 | and its functional reference count to 0. | ||
68 | For more information about the functional reference count, see the | ||
69 | .Xr ENGINE_init 3 | ||
70 | manual page. | ||
71 | .Pp | ||
72 | Many functions increment the structural reference count by 1 | ||
73 | when successful. | ||
74 | Some of them, including | ||
75 | .Xr ENGINE_get_first 3 , | ||
76 | .Xr ENGINE_get_last 3 , | ||
77 | .Xr ENGINE_get_next 3 , | ||
78 | .Xr ENGINE_get_prev 3 , | ||
79 | and | ||
80 | .Xr ENGINE_by_id 3 , | ||
81 | do so because they return a structural reference to the user. | ||
82 | Other functions, including | ||
83 | .Xr ENGINE_add 3 , | ||
84 | .Xr ENGINE_init 3 , | ||
85 | .Xr ENGINE_get_cipher_engine 3 , | ||
86 | .Xr ENGINE_get_digest_engine 3 , | ||
87 | and the | ||
88 | .Xr ENGINE_get_default_RSA 3 | ||
89 | and | ||
90 | .Xr ENGINE_set_default 3 | ||
91 | families of functions | ||
92 | do so when they store a structural reference internally. | ||
93 | .Pp | ||
94 | .Fn ENGINE_up_ref | ||
95 | explicitly increment the structural reference count by 1. | ||
96 | .Pp | ||
97 | .Fn ENGINE_free | ||
98 | decrements the structural reference count by 1, | ||
99 | and if it reaches 0, the optional | ||
100 | .Fa destroy_f | ||
101 | previously installed with | ||
102 | .Fn ENGINE_set_destroy_function | ||
103 | is called, if one is installed, and both the memory used internally by | ||
104 | .Fa e | ||
105 | and | ||
106 | .Fa e | ||
107 | itself are freed. | ||
108 | If | ||
109 | .Fa e | ||
110 | is a | ||
111 | .Dv NULL | ||
112 | pointer, no action occurs. | ||
113 | .Pp | 90 | .Pp |
114 | Many functions internally call the equivalent of | 91 | All functions in this manual ignore all their arguments and |
115 | .Fn ENGINE_free . | 92 | do nothing except return failure if possible. |
116 | Some of them, including | 93 | They are provided only to avoid patching software that expects |
117 | .Xr ENGINE_get_next 3 | 94 | ENGINE support to be available. |
95 | .Sh RETURN VALUES | ||
96 | .Fn ENGINE_new , | ||
97 | .Fn ENGINE_by_id , | ||
98 | .Fn ENGINE_get_default_RSA , | ||
99 | .Fn ENGINE_load_private_key , | ||
118 | and | 100 | and |
119 | .Xr ENGINE_get_prev 3 , | 101 | .Fn ENGINE_load_public_key , |
120 | thus invalidate the structural reference passed in by the user. | 102 | always return |
121 | Other functions, including | 103 | .Dv NULL . |
122 | .Xr ENGINE_finish 3 , | ||
123 | .Xr ENGINE_remove 3 , | ||
124 | and the | ||
125 | .Xr ENGINE_set_default 3 | ||
126 | family of functions | ||
127 | do so when an internally stored structural reference is no longer needed. | ||
128 | .Pp | 104 | .Pp |
129 | .Fn ENGINE_set_destroy_function | ||
130 | installs a callback function that will be called by | ||
131 | .Fn ENGINE_free , | 105 | .Fn ENGINE_free , |
132 | but only when | 106 | .Fn ENGINE_init , |
133 | .Fa e | 107 | .Fn ENGINE_finish , |
134 | actually gets destroyed, | 108 | .Fn ENGINE_set_default , |
135 | not when only its reference count gets decremented. | 109 | .Fn ENGINE_set_default_RSA , |
136 | The value returned from the | ||
137 | .Fa destroy_f | ||
138 | will be ignored. | ||
139 | .Sh RETURN VALUES | ||
140 | .Fn ENGINE_new | ||
141 | returns a structural reference to the new | ||
142 | .Vt ENGINE | ||
143 | object or | ||
144 | .Dv NULL | ||
145 | if an error occurs. | ||
146 | .Pp | ||
147 | .Fn ENGINE_up_ref | ||
148 | returns 0 if | ||
149 | .Fa e | ||
150 | is | ||
151 | .Dv NULL | ||
152 | and 1 otherwise. | ||
153 | .Pp | ||
154 | .Fn ENGINE_free | ||
155 | and | 110 | and |
156 | .Fn ENGINE_set_destroy_function | 111 | .Fn ENGINE_register_all_complete |
157 | always return 1. | 112 | always return 0. |
158 | .Pp | 113 | .Pp |
159 | .Fn ENGINE_get_destroy_function | 114 | .Fn ENGINE_get_id |
160 | returns a function pointer to the callback, or | 115 | and |
161 | .Dv NULL | 116 | .Fn ENGINE_get_name |
162 | if none is installed. | 117 | always return the constant empty string. |
163 | .Sh SEE ALSO | 118 | .Sh SEE ALSO |
164 | .Xr crypto 3 , | 119 | .Xr crypto 3 |
165 | .Xr ENGINE_add 3 , | ||
166 | .Xr ENGINE_ctrl 3 , | ||
167 | .Xr ENGINE_get_default_RSA 3 , | ||
168 | .Xr ENGINE_init 3 , | ||
169 | .Xr ENGINE_register_all_RSA 3 , | ||
170 | .Xr ENGINE_register_RSA 3 , | ||
171 | .Xr ENGINE_set_default 3 , | ||
172 | .Xr ENGINE_set_flags 3 , | ||
173 | .Xr ENGINE_set_RSA 3 , | ||
174 | .Xr ENGINE_unregister_RSA 3 | ||
175 | .Sh HISTORY | 120 | .Sh HISTORY |
176 | .Fn ENGINE_new | 121 | .Fn ENGINE_new , |
122 | .Fn ENGINE_free , | ||
123 | .Fn ENGINE_init , | ||
124 | .Fn ENGINE_finish , | ||
125 | .Fn ENGINE_by_id , | ||
126 | .Fn ENGINE_get_id , | ||
127 | .Fn ENGINE_get_name , | ||
128 | .Fn ENGINE_set_default , | ||
129 | .Fn ENGINE_get_default_RSA , | ||
130 | .Fn ENGINE_set_default_RSA , | ||
131 | .Fn ENGINE_load_private_key , | ||
177 | and | 132 | and |
178 | .Fn ENGINE_free | 133 | .Fn ENGINE_load_public_key |
179 | first appeared in OpenSSL 0.9.7 and have been available since | 134 | first appeared in OpenSSL 0.9.7 |
180 | .Ox 2.9 . | 135 | and have been available since |
136 | .Ox 2.9 | ||
181 | .Pp | 137 | .Pp |
182 | .Fn ENGINE_set_destroy_function | 138 | .Fn ENGINE_load_builtin_engines , |
139 | .Fn ENGINE_load_openssl , | ||
183 | and | 140 | and |
184 | .Fn ENGINE_get_destroy_function | 141 | .Fn ENGINE_register_all_complete |
185 | first appeared in OpenSSL 0.9.7 and have been available since | 142 | first appeared in OpenSSL 0.9.7 |
186 | .Ox 3.2 . | 143 | and have been available since |
187 | .Pp | ||
188 | .Fn ENGINE_up_ref | ||
189 | first appeared in OpenSSL 0.9.7 and has been available since | ||
190 | .Ox 3.4 . | 144 | .Ox 3.4 . |
145 | .Pp | ||
146 | All these functions were turned into stubs in | ||
147 | .Ox 7.4 . | ||