summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/doc/DH_set_method.pod
diff options
context:
space:
mode:
authormarkus <>2002-09-14 11:18:04 +0000
committermarkus <>2002-09-14 11:18:04 +0000
commit3a3a489a756f2852d798376f20cc0d4ab609c866 (patch)
tree2a4277fc9b7635e82c33faa3bae9f9380bc639e8 /src/lib/libcrypto/doc/DH_set_method.pod
parent82d2611e1bb67683df1bb201dcc2afbff4c76980 (diff)
downloadopenbsd-3a3a489a756f2852d798376f20cc0d4ab609c866.tar.gz
openbsd-3a3a489a756f2852d798376f20cc0d4ab609c866.tar.bz2
openbsd-3a3a489a756f2852d798376f20cc0d4ab609c866.zip
merge with openssl-0.9.7-stable-SNAP-20020911,
new minor for libcrypto (_X509_REQ_print_ex) tested by miod@, pb@
Diffstat (limited to 'src/lib/libcrypto/doc/DH_set_method.pod')
-rw-r--r--src/lib/libcrypto/doc/DH_set_method.pod102
1 files changed, 60 insertions, 42 deletions
diff --git a/src/lib/libcrypto/doc/DH_set_method.pod b/src/lib/libcrypto/doc/DH_set_method.pod
index d990bf8786..73261fc467 100644
--- a/src/lib/libcrypto/doc/DH_set_method.pod
+++ b/src/lib/libcrypto/doc/DH_set_method.pod
@@ -2,7 +2,7 @@
2 2
3=head1 NAME 3=head1 NAME
4 4
5DH_set_default_openssl_method, DH_get_default_openssl_method, 5DH_set_default_method, DH_get_default_method,
6DH_set_method, DH_new_method, DH_OpenSSL - select DH method 6DH_set_method, DH_new_method, DH_OpenSSL - select DH method
7 7
8=head1 SYNOPSIS 8=head1 SYNOPSIS
@@ -10,45 +10,47 @@ DH_set_method, DH_new_method, DH_OpenSSL - select DH method
10 #include <openssl/dh.h> 10 #include <openssl/dh.h>
11 #include <openssl/engine.h> 11 #include <openssl/engine.h>
12 12
13 void DH_set_default_openssl_method(DH_METHOD *meth); 13 void DH_set_default_method(const DH_METHOD *meth);
14 14
15 DH_METHOD *DH_get_default_openssl_method(void); 15 const DH_METHOD *DH_get_default_method(void);
16 16
17 int DH_set_method(DH *dh, ENGINE *engine); 17 int DH_set_method(DH *dh, const DH_METHOD *meth);
18 18
19 DH *DH_new_method(ENGINE *engine); 19 DH *DH_new_method(ENGINE *engine);
20 20
21 DH_METHOD *DH_OpenSSL(void); 21 const DH_METHOD *DH_OpenSSL(void);
22 22
23=head1 DESCRIPTION 23=head1 DESCRIPTION
24 24
25A B<DH_METHOD> specifies the functions that OpenSSL uses for Diffie-Hellman 25A B<DH_METHOD> specifies the functions that OpenSSL uses for Diffie-Hellman
26operations. By modifying the method, alternative implementations 26operations. By modifying the method, alternative implementations
27such as hardware accelerators may be used. 27such as hardware accelerators may be used. IMPORTANT: See the NOTES section for
28 28important information about how these DH API functions are affected by the use
29Initially, the default is to use the OpenSSL internal implementation. 29of B<ENGINE> API calls.
30DH_OpenSSL() returns a pointer to that method. 30
31 31Initially, the default DH_METHOD is the OpenSSL internal implementation, as
32DH_set_default_openssl_method() makes B<meth> the default method for all DH 32returned by DH_OpenSSL().
33structures created later. B<NB:> This is true only whilst the default engine 33
34for Diffie-Hellman operations remains as "openssl". ENGINEs provide an 34DH_set_default_method() makes B<meth> the default method for all DH
35encapsulation for implementations of one or more algorithms, and all the DH 35structures created later. B<NB>: This is true only whilst no ENGINE has been set
36functions mentioned here operate within the scope of the default 36as a default for DH, so this function is no longer recommended.
37"openssl" engine. 37
38 38DH_get_default_method() returns a pointer to the current default DH_METHOD.
39DH_get_default_openssl_method() returns a pointer to the current default 39However, the meaningfulness of this result is dependant on whether the ENGINE
40method for the "openssl" engine. 40API is being used, so this function is no longer recommended.
41 41
42DH_set_method() selects B<engine> as the engine that will be responsible for 42DH_set_method() selects B<meth> to perform all operations using the key B<dh>.
43all operations using the structure B<dh>. If this function completes successfully, 43This will replace the DH_METHOD used by the DH key and if the previous method
44then the B<dh> structure will have its own functional reference of B<engine>, so 44was supplied by an ENGINE, the handle to that ENGINE will be released during the
45the caller should remember to free their own reference to B<engine> when they are 45change. It is possible to have DH keys that only work with certain DH_METHOD
46finished with it. NB: An ENGINE's DH_METHOD can be retrieved (or set) by 46implementations (eg. from an ENGINE module that supports embedded
47ENGINE_get_DH() or ENGINE_set_DH(). 47hardware-protected keys), and in such cases attempting to change the DH_METHOD
48 48for the key can have unexpected results.
49DH_new_method() allocates and initializes a DH structure so that 49
50B<engine> will be used for the DH operations. If B<engine> is NULL, 50DH_new_method() allocates and initializes a DH structure so that B<engine> will
51the default engine for Diffie-Hellman opertaions is used. 51be used for the DH operations. If B<engine> is NULL, the default ENGINE for DH
52operations is used, and if no default ENGINE is set, the DH_METHOD controlled by
53DH_set_default_method() is used.
52 54
53=head1 THE DH_METHOD STRUCTURE 55=head1 THE DH_METHOD STRUCTURE
54 56
@@ -82,17 +84,28 @@ the default engine for Diffie-Hellman opertaions is used.
82 84
83=head1 RETURN VALUES 85=head1 RETURN VALUES
84 86
85DH_OpenSSL() and DH_get_default_openssl_method() return pointers to the 87DH_OpenSSL() and DH_get_default_method() return pointers to the respective
86respective B<DH_METHOD>s. 88B<DH_METHOD>s.
89
90DH_set_default_method() returns no value.
91
92DH_set_method() returns non-zero if the provided B<meth> was successfully set as
93the method for B<dh> (including unloading the ENGINE handle if the previous
94method was supplied by an ENGINE).
87 95
88DH_set_default_openssl_method() returns no value. 96DH_new_method() returns NULL and sets an error code that can be obtained by
97L<ERR_get_error(3)|ERR_get_error(3)> if the allocation fails. Otherwise it
98returns a pointer to the newly allocated structure.
89 99
90DH_set_method() returns non-zero if the ENGINE associated with B<dh> 100=head1 NOTES
91was successfully changed to B<engine>.
92 101
93DH_new_method() returns NULL and sets an error code that can be 102As of version 0.9.7, DH_METHOD implementations are grouped together with other
94obtained by L<ERR_get_error(3)|ERR_get_error(3)> if the allocation fails. 103algorithmic APIs (eg. RSA_METHOD, EVP_CIPHER, etc) in B<ENGINE> modules. If a
95Otherwise it returns a pointer to the newly allocated structure. 104default ENGINE is specified for DH functionality using an ENGINE API function,
105that will override any DH defaults set using the DH API (ie.
106DH_set_default_method()). For this reason, the ENGINE API is the recommended way
107to control default implementations for use in DH and other cryptographic
108algorithms.
96 109
97=head1 SEE ALSO 110=head1 SEE ALSO
98 111
@@ -103,9 +116,14 @@ L<dh(3)|dh(3)>, L<DH_new(3)|DH_new(3)>
103DH_set_default_method(), DH_get_default_method(), DH_set_method(), 116DH_set_default_method(), DH_get_default_method(), DH_set_method(),
104DH_new_method() and DH_OpenSSL() were added in OpenSSL 0.9.4. 117DH_new_method() and DH_OpenSSL() were added in OpenSSL 0.9.4.
105 118
106DH_set_default_openssl_method() and DH_get_default_openssl_method() 119DH_set_default_openssl_method() and DH_get_default_openssl_method() replaced
107replaced DH_set_default_method() and DH_get_default_method() respectively, 120DH_set_default_method() and DH_get_default_method() respectively, and
108and DH_set_method() and DH_new_method() were altered to use B<ENGINE>s 121DH_set_method() and DH_new_method() were altered to use B<ENGINE>s rather than
109rather than B<DH_METHOD>s during development of OpenSSL 0.9.6. 122B<DH_METHOD>s during development of the engine version of OpenSSL 0.9.6. For
1230.9.7, the handling of defaults in the ENGINE API was restructured so that this
124change was reversed, and behaviour of the other functions resembled more closely
125the previous behaviour. The behaviour of defaults in the ENGINE API now
126transparently overrides the behaviour of defaults in the DH API without
127requiring changing these function prototypes.
110 128
111=cut 129=cut