]>
Commit | Line | Data |
---|---|---|
4486d0cd UM |
1 | =pod |
2 | ||
3 | =head1 NAME | |
4 | ||
5bf73873 | 5 | DH_set_default_method, DH_get_default_method, |
5270e702 | 6 | DH_set_method, DH_new_method, DH_OpenSSL - select DH method |
4486d0cd UM |
7 | |
8 | =head1 SYNOPSIS | |
9 | ||
10 | #include <openssl/dh.h> | |
11 | ||
ada66e78 P |
12 | Deprecated since OpenSSL 3.0, can be hidden entirely by defining |
13 | B<OPENSSL_API_COMPAT> with a suitable version value, see | |
14 | L<openssl_user_macros(7)>: | |
15 | ||
5bf73873 | 16 | void DH_set_default_method(const DH_METHOD *meth); |
4486d0cd | 17 | |
5bf73873 | 18 | const DH_METHOD *DH_get_default_method(void); |
4486d0cd | 19 | |
5bf73873 | 20 | int DH_set_method(DH *dh, const DH_METHOD *meth); |
4486d0cd | 21 | |
6aba658c | 22 | DH *DH_new_method(ENGINE *engine); |
4486d0cd | 23 | |
5bf73873 | 24 | const DH_METHOD *DH_OpenSSL(void); |
4486d0cd UM |
25 | |
26 | =head1 DESCRIPTION | |
27 | ||
ada66e78 P |
28 | All of the functions described on this page are deprecated. |
29 | Applications should instead use the provider APIs. | |
30 | ||
4486d0cd UM |
31 | A B<DH_METHOD> specifies the functions that OpenSSL uses for Diffie-Hellman |
32 | operations. By modifying the method, alternative implementations | |
5bf73873 GT |
33 | such as hardware accelerators may be used. IMPORTANT: See the NOTES section for |
34 | important information about how these DH API functions are affected by the use | |
35 | of B<ENGINE> API calls. | |
36 | ||
37 | Initially, the default DH_METHOD is the OpenSSL internal implementation, as | |
38 | returned by DH_OpenSSL(). | |
39 | ||
40 | DH_set_default_method() makes B<meth> the default method for all DH | |
076fc555 RS |
41 | structures created later. |
42 | B<NB>: This is true only whilst no ENGINE has been set | |
5bf73873 | 43 | as a default for DH, so this function is no longer recommended. |
076fc555 RS |
44 | This function is not thread-safe and should not be called at the same time |
45 | as other OpenSSL functions. | |
5bf73873 GT |
46 | |
47 | DH_get_default_method() returns a pointer to the current default DH_METHOD. | |
b6a338cb | 48 | However, the meaningfulness of this result is dependent on whether the ENGINE |
5bf73873 GT |
49 | API is being used, so this function is no longer recommended. |
50 | ||
51 | DH_set_method() selects B<meth> to perform all operations using the key B<dh>. | |
52 | This will replace the DH_METHOD used by the DH key and if the previous method | |
53 | was supplied by an ENGINE, the handle to that ENGINE will be released during the | |
54 | change. It is possible to have DH keys that only work with certain DH_METHOD | |
55 | implementations (eg. from an ENGINE module that supports embedded | |
56 | hardware-protected keys), and in such cases attempting to change the DH_METHOD | |
57 | for the key can have unexpected results. | |
58 | ||
59 | DH_new_method() allocates and initializes a DH structure so that B<engine> will | |
60 | be used for the DH operations. If B<engine> is NULL, the default ENGINE for DH | |
61 | operations is used, and if no default ENGINE is set, the DH_METHOD controlled by | |
62 | DH_set_default_method() is used. | |
4486d0cd | 63 | |
0263b992 MC |
64 | A new DH_METHOD object may be constructed using DH_meth_new() (see |
65 | L<DH_meth_new(3)>). | |
4486d0cd UM |
66 | |
67 | =head1 RETURN VALUES | |
68 | ||
5bf73873 GT |
69 | DH_OpenSSL() and DH_get_default_method() return pointers to the respective |
70 | B<DH_METHOD>s. | |
71 | ||
72 | DH_set_default_method() returns no value. | |
73 | ||
9c0586d5 | 74 | DH_set_method() returns nonzero if the provided B<meth> was successfully set as |
5bf73873 GT |
75 | the method for B<dh> (including unloading the ENGINE handle if the previous |
76 | method was supplied by an ENGINE). | |
4486d0cd | 77 | |
5bf73873 | 78 | DH_new_method() returns NULL and sets an error code that can be obtained by |
9b86974e | 79 | L<ERR_get_error(3)> if the allocation fails. Otherwise it |
5bf73873 | 80 | returns a pointer to the newly allocated structure. |
4486d0cd | 81 | |
4486d0cd UM |
82 | =head1 SEE ALSO |
83 | ||
b97fdb57 | 84 | L<DH_new(3)>, L<DH_new(3)>, L<DH_meth_new(3)> |
4486d0cd | 85 | |
ada66e78 P |
86 | =head1 HISTORY |
87 | ||
88 | All of these functions were deprecated in OpenSSL 3.0. | |
89 | ||
e2f92610 RS |
90 | =head1 COPYRIGHT |
91 | ||
92 | Copyright 2000-2016 The OpenSSL Project Authors. All Rights Reserved. | |
93 | ||
4746f25a | 94 | Licensed under the Apache License 2.0 (the "License"). You may not use |
e2f92610 RS |
95 | this file except in compliance with the License. You can obtain a copy |
96 | in the file LICENSE in the source distribution or at | |
97 | L<https://www.openssl.org/source/license.html>. | |
98 | ||
99 | =cut |