summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/man/DH_set_method.3
diff options
context:
space:
mode:
authorschwarze <>2018-04-18 01:09:01 +0000
committerschwarze <>2018-04-18 01:09:01 +0000
commitbf38af2d204a66db252db88697e129c75810d022 (patch)
tree2c4dc10a970df762b139b100fe0cb4b1255f91d6 /src/lib/libcrypto/man/DH_set_method.3
parent3853161947bef78ac2c0d8634299a75cea982c4c (diff)
downloadopenbsd-bf38af2d204a66db252db88697e129c75810d022.tar.gz
openbsd-bf38af2d204a66db252db88697e129c75810d022.tar.bz2
openbsd-bf38af2d204a66db252db88697e129c75810d022.zip
* Make the description of method selection simpler, more precise,
and more concise. * Correct the description of the return values of DH_set_method(3) and DSA_set_method(3). * Stop referencing engine(3).
Diffstat (limited to 'src/lib/libcrypto/man/DH_set_method.3')
-rw-r--r--src/lib/libcrypto/man/DH_set_method.399
1 files changed, 34 insertions, 65 deletions
diff --git a/src/lib/libcrypto/man/DH_set_method.3 b/src/lib/libcrypto/man/DH_set_method.3
index 77d1616445..9863cbaca9 100644
--- a/src/lib/libcrypto/man/DH_set_method.3
+++ b/src/lib/libcrypto/man/DH_set_method.3
@@ -1,4 +1,4 @@
1.\" $OpenBSD: DH_set_method.3,v 1.6 2018/03/22 16:06:33 schwarze Exp $ 1.\" $OpenBSD: DH_set_method.3,v 1.7 2018/04/18 01:09:01 schwarze Exp $
2.\" OpenSSL b97fdb57 Nov 11 09:33:09 2016 +0100 2.\" OpenSSL b97fdb57 Nov 11 09:33:09 2016 +0100
3.\" 3.\"
4.\" This file was written by Ulf Moeller <ulf@openssl.org>. 4.\" This file was written by Ulf Moeller <ulf@openssl.org>.
@@ -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: March 22 2018 $ 51.Dd $Mdocdate: April 18 2018 $
52.Dt DH_SET_METHOD 3 52.Dt DH_SET_METHOD 3
53.Os 53.Os
54.Sh NAME 54.Sh NAME
@@ -84,53 +84,44 @@
84.Sh DESCRIPTION 84.Sh DESCRIPTION
85A 85A
86.Vt DH_METHOD 86.Vt DH_METHOD
87specifies the functions that OpenSSL uses for Diffie-Hellman operations. 87object contains pointers to the functions
88By modifying the method, alternative implementations such as hardware 88used for Diffie-Hellman operations.
89accelerators may be used. 89By default, the internal implementation returned by
90See the 90.Fn DH_OpenSSL
91.Sx CAVEATS 91is used.
92section for how these DH API functions are affected by the use of 92By selecting another method, alternative implementations
93.Xr engine 3 93such as hardware accelerators may be used.
94API calls.
95.Pp
96Initially, the default
97.Vt DH_METHOD
98is the OpenSSL internal implementation as returned by
99.Fn DH_OpenSSL .
100.Pp 94.Pp
101.Fn DH_set_default_method 95.Fn DH_set_default_method
102makes 96selects
103.Fa meth 97.Fa meth
104the default method for all 98as the default method for all
105.Vt DH 99.Vt DH
106structures created later. 100structures created later.
107.Sy NB : 101If any
108This is true only whilst no
109.Vt ENGINE 102.Vt ENGINE
110has been set as a default for DH, so this function is no longer 103was registered with
111recommended. 104.Xr ENGINE_register_DH 3
105that can be successfully initialized, it overrides the default.
112.Pp 106.Pp
113.Fn DH_get_default_method 107.Fn DH_get_default_method
114returns a pointer to the current default 108returns a pointer to the current default method,
115.Vt DH_METHOD . 109even if it is actually overridded by an
116However, the meaningfulness of this result is dependent on whether the 110.Vt ENGINE .
117.Xr engine 3
118API is being used, so this function is no longer recommended.
119.Pp 111.Pp
120.Fn DH_set_method 112.Fn DH_set_method
121selects 113selects
122.Fa meth 114.Fa meth
123to perform all operations using the key 115to perform all operations using the key
124.Fa dh . 116.Fa dh .
125This will replace the 117This replaces the
126.Vt DH_METHOD 118.Vt DH_METHOD
127used by the 119used by the
128.Fa dh 120.Fa dh
129key and if the previous method was supplied by an 121key and if the previous method was supplied by an
130.Vt ENGINE , 122.Vt ENGINE ,
131the handle to that 123.Xr ENGINE_finish 3
132.Vt ENGINE 124is called on it.
133will be released during the change.
134It is possible to have 125It is possible to have
135.Vt DH 126.Vt DH
136keys that only work with certain 127keys that only work with certain
@@ -147,18 +138,16 @@ allocates and initializes a
147.Vt DH 138.Vt DH
148structure so that 139structure so that
149.Fa engine 140.Fa engine
150will be used for the DH operations. 141is used for the DH operations.
151If 142If
152.Fa engine 143.Fa engine
153is 144is
154.Dv NULL , 145.Dv NULL ,
155the default 146.Xr ENGINE_get_default_DH 3
156.Vt ENGINE 147is used.
157for DH operations is used and, if no default 148If that returns
158.Vt ENGINE 149.Dv NULL ,
159is set, the 150the default method controlled by
160.Vt DH_METHOD
161controlled by
162.Fn DH_set_default_method 151.Fn DH_set_default_method
163is used. 152is used.
164.Pp 153.Pp
@@ -199,17 +188,11 @@ typedef struct dh_meth_st
199and 188and
200.Fn DH_get_default_method 189.Fn DH_get_default_method
201return pointers to the respective 190return pointers to the respective
202.Sy DH_METHOD Ns s. 191.Vt DH_METHOD .
203.Pp 192.Pp
204.Fn DH_set_method 193.Fn DH_set_method
205returns non-zero if the provided 194returns 1 on success or 0 on failure.
206.Fa meth 195Currently, it cannot fail.
207was successfully set as the method for
208.Fa dh
209(including unloading the
210.Vt ENGINE
211handle if the previous method was supplied by an
212.Vt ENGINE ) .
213.Pp 196.Pp
214.Fn DH_new_method 197.Fn DH_new_method
215returns 198returns
@@ -219,7 +202,10 @@ and sets an error code that can be obtained by
219if the allocation fails. 202if the allocation fails.
220Otherwise it returns a pointer to the newly allocated structure. 203Otherwise it returns a pointer to the newly allocated structure.
221.Sh SEE ALSO 204.Sh SEE ALSO
222.Xr DH_new 3 205.Xr DH_new 3 ,
206.Xr ENGINE_get_default_DH 3 ,
207.Xr ENGINE_register_DH 3 ,
208.Xr ENGINE_set_default_DH 3
223.Sh HISTORY 209.Sh HISTORY
224.Fn DH_set_default_method , 210.Fn DH_set_default_method ,
225.Fn DH_get_default_method , 211.Fn DH_get_default_method ,
@@ -229,20 +215,3 @@ and
229.Fn DH_OpenSSL 215.Fn DH_OpenSSL
230first appeared in OpenSSL 0.9.5 and have been available since 216first appeared in OpenSSL 0.9.5 and have been available since
231.Ox 2.7 . 217.Ox 2.7 .
232.Sh CAVEATS
233As of version 0.9.7,
234.Vt DH_METHOD
235implementations are grouped together with other algorithmic APIs
236(e.g. RSA_METHOD, EVP_CIPHER) in
237.Vt ENGINE
238modules.
239If a default
240.Vt ENGINE
241is specified for DH functionality using an
242.Xr engine 3
243API function, that will override any DH defaults set using the DH API
244.Pq i.e. Fn DH_set_default_method .
245For this reason, the
246.Xr engine 3
247API is the recommended way to control default implementations
248for use in DH and other cryptographic algorithms.