summaryrefslogtreecommitdiff
path: root/src/lib
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/libcrypto/man/ENGINE_new.3249
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
56objects can be used to provide alternative implementations of 87objects used to provide alternative implementations of
57cryptographic algorithms, to support additional algorithms, to 88cryptographic algorithms, for example using specialized hardware.
58support cryptographic hardware, and to switch among alternative 89LibreSSL no longer supports this feature.
59implementations of algorithms at run time.
60LibreSSL generally avoids engines and prefers providing
61cryptographic functionality in the crypto library itself.
62.Pp
63.Fn ENGINE_new
64allocates and initializes an empty
65.Vt ENGINE
66object and sets its structural reference count to 1
67and its functional reference count to 0.
68For more information about the functional reference count, see the
69.Xr ENGINE_init 3
70manual page.
71.Pp
72Many functions increment the structural reference count by 1
73when successful.
74Some 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 ,
79and
80.Xr ENGINE_by_id 3 ,
81do so because they return a structural reference to the user.
82Other 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 ,
87and the
88.Xr ENGINE_get_default_RSA 3
89and
90.Xr ENGINE_set_default 3
91families of functions
92do so when they store a structural reference internally.
93.Pp
94.Fn ENGINE_up_ref
95explicitly increment the structural reference count by 1.
96.Pp
97.Fn ENGINE_free
98decrements the structural reference count by 1,
99and if it reaches 0, the optional
100.Fa destroy_f
101previously installed with
102.Fn ENGINE_set_destroy_function
103is called, if one is installed, and both the memory used internally by
104.Fa e
105and
106.Fa e
107itself are freed.
108If
109.Fa e
110is a
111.Dv NULL
112pointer, no action occurs.
113.Pp 90.Pp
114Many functions internally call the equivalent of 91All functions in this manual ignore all their arguments and
115.Fn ENGINE_free . 92do nothing except return failure if possible.
116Some of them, including 93They are provided only to avoid patching software that expects
117.Xr ENGINE_get_next 3 94ENGINE 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 ,
118and 100and
119.Xr ENGINE_get_prev 3 , 101.Fn ENGINE_load_public_key ,
120thus invalidate the structural reference passed in by the user. 102always return
121Other functions, including 103.Dv NULL .
122.Xr ENGINE_finish 3 ,
123.Xr ENGINE_remove 3 ,
124and the
125.Xr ENGINE_set_default 3
126family of functions
127do so when an internally stored structural reference is no longer needed.
128.Pp 104.Pp
129.Fn ENGINE_set_destroy_function
130installs a callback function that will be called by
131.Fn ENGINE_free , 105.Fn ENGINE_free ,
132but only when 106.Fn ENGINE_init ,
133.Fa e 107.Fn ENGINE_finish ,
134actually gets destroyed, 108.Fn ENGINE_set_default ,
135not when only its reference count gets decremented. 109.Fn ENGINE_set_default_RSA ,
136The value returned from the
137.Fa destroy_f
138will be ignored.
139.Sh RETURN VALUES
140.Fn ENGINE_new
141returns a structural reference to the new
142.Vt ENGINE
143object or
144.Dv NULL
145if an error occurs.
146.Pp
147.Fn ENGINE_up_ref
148returns 0 if
149.Fa e
150is
151.Dv NULL
152and 1 otherwise.
153.Pp
154.Fn ENGINE_free
155and 110and
156.Fn ENGINE_set_destroy_function 111.Fn ENGINE_register_all_complete
157always return 1. 112always return 0.
158.Pp 113.Pp
159.Fn ENGINE_get_destroy_function 114.Fn ENGINE_get_id
160returns a function pointer to the callback, or 115and
161.Dv NULL 116.Fn ENGINE_get_name
162if none is installed. 117always 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 ,
177and 132and
178.Fn ENGINE_free 133.Fn ENGINE_load_public_key
179first appeared in OpenSSL 0.9.7 and have been available since 134first appeared in OpenSSL 0.9.7
180.Ox 2.9 . 135and 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 ,
183and 140and
184.Fn ENGINE_get_destroy_function 141.Fn ENGINE_register_all_complete
185first appeared in OpenSSL 0.9.7 and have been available since 142first appeared in OpenSSL 0.9.7
186.Ox 3.2 . 143and have been available since
187.Pp
188.Fn ENGINE_up_ref
189first appeared in OpenSSL 0.9.7 and has been available since
190.Ox 3.4 . 144.Ox 3.4 .
145.Pp
146All these functions were turned into stubs in
147.Ox 7.4 .