Debian Codegraph @

upstream/debian-unstable/man3/DH_set_method.3ssl

raw
1 .\" -*- mode: troff; coding: utf-8 -*-
2 .\" Automatically generated by Pod::Man 5.0102 (Pod::Simple 3.45)
3 .\"
4 .\" Standard preamble:
5 .\" ========================================================================
6 .de Sp \" Vertical space (when we can't use .PP)
7 .if t .sp .5v
8 .if n .sp
9 ..
10 .de Vb \" Begin verbatim text
11 .ft CW
12 .nf
13 .ne \\$1
14 ..
15 .de Ve \" End verbatim text
16 .ft R
17 .fi
18 ..
19 .\" \*(C` and \*(C' are quotes in nroff, nothing in troff, for use with C<>.
20 .ie n \{\
21 . ds C` ""
22 . ds C' ""
23 'br\}
24 .el\{\
25 . ds C`
26 . ds C'
27 'br\}
28 .\"
29 .\" Escape single quotes in literal strings from groff's Unicode transform.
30 .ie \n(.g .ds Aq \(aq
31 .el .ds Aq '
32 .\"
33 .\" If the F register is >0, we'll generate index entries on stderr for
34 .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index
35 .\" entries marked with X<> in POD. Of course, you'll have to process the
36 .\" output yourself in some meaningful fashion.
37 .\"
38 .\" Avoid warning from groff about undefined register 'F'.
39 .de IX
40 ..
41 .nr rF 0
42 .if \n(.g .if rF .nr rF 1
43 .if (\n(rF:(\n(.g==0)) \{\
44 . if \nF \{\
45 . de IX
46 . tm Index:\\$1\t\\n%\t"\\$2"
47 ..
48 . if !\nF==2 \{\
49 . nr % 0
50 . nr F 2
51 . \}
52 . \}
53 .\}
54 .rr rF
55 .\" ========================================================================
56 .\"
57 .IX Title "DH_SET_METHOD 3SSL"
58 .TH DH_SET_METHOD 3SSL 2026-04-07 3.6.2 OpenSSL
59 .\" For nroff, turn off justification. Always turn off hyphenation; it makes
60 .\" way too many mistakes in technical documents.
61 .if n .ad l
62 .nh
63 .SH NAME
64 DH_set_default_method, DH_get_default_method,
65 DH_set_method, DH_new_method, DH_OpenSSL \- select DH method
66 .SH SYNOPSIS
67 .IX Header "SYNOPSIS"
68 .Vb 1
69 \& #include <openssl/dh.h>
70 .Ve
71 .PP
72 The following functions have been deprecated since OpenSSL 3.0, and can be
73 hidden entirely by defining \fBOPENSSL_API_COMPAT\fR with a suitable version value,
74 see \fBopenssl_user_macros\fR\|(7):
75 .PP
76 .Vb 1
77 \& void DH_set_default_method(const DH_METHOD *meth);
78 \&
79 \& const DH_METHOD *DH_get_default_method(void);
80 \&
81 \& int DH_set_method(DH *dh, const DH_METHOD *meth);
82 \&
83 \& DH *DH_new_method(ENGINE *engine);
84 \&
85 \& const DH_METHOD *DH_OpenSSL(void);
86 .Ve
87 .SH DESCRIPTION
88 .IX Header "DESCRIPTION"
89 All of the functions described on this page are deprecated.
90 Applications should instead use the provider APIs.
91 .PP
92 A \fBDH_METHOD\fR specifies the functions that OpenSSL uses for Diffie-Hellman
93 operations. By modifying the method, alternative implementations
94 such as hardware accelerators may be used. IMPORTANT: See the NOTES section for
95 important information about how these DH API functions are affected by the use
96 of \fBENGINE\fR API calls.
97 .PP
98 Initially, the default DH_METHOD is the OpenSSL internal implementation, as
99 returned by \fBDH_OpenSSL()\fR.
100 .PP
101 \&\fBDH_set_default_method()\fR makes \fBmeth\fR the default method for all DH
102 structures created later.
103 \&\fBNB\fR: This is true only whilst no ENGINE has been set
104 as a default for DH, so this function is no longer recommended.
105 This function is not thread-safe and should not be called at the same time
106 as other OpenSSL functions.
107 .PP
108 \&\fBDH_get_default_method()\fR returns a pointer to the current default DH_METHOD.
109 However, the meaningfulness of this result is dependent on whether the ENGINE
110 API is being used, so this function is no longer recommended.
111 .PP
112 \&\fBDH_set_method()\fR selects \fBmeth\fR to perform all operations using the key \fBdh\fR.
113 This will replace the DH_METHOD used by the DH key and if the previous method
114 was supplied by an ENGINE, the handle to that ENGINE will be released during the
115 change. It is possible to have DH keys that only work with certain DH_METHOD
116 implementations (e.g. from an ENGINE module that supports embedded
117 hardware-protected keys), and in such cases attempting to change the DH_METHOD
118 for the key can have unexpected results.
119 .PP
120 \&\fBDH_new_method()\fR allocates and initializes a DH structure so that \fBengine\fR will
121 be used for the DH operations. If \fBengine\fR is NULL, the default ENGINE for DH
122 operations is used, and if no default ENGINE is set, the DH_METHOD controlled by
123 \&\fBDH_set_default_method()\fR is used.
124 .PP
125 A new DH_METHOD object may be constructed using \fBDH_meth_new()\fR (see
126 \&\fBDH_meth_new\fR\|(3)).
127 .SH "RETURN VALUES"
128 .IX Header "RETURN VALUES"
129 \&\fBDH_OpenSSL()\fR and \fBDH_get_default_method()\fR return pointers to the respective
130 \&\fBDH_METHOD\fRs.
131 .PP
132 \&\fBDH_set_default_method()\fR returns no value.
133 .PP
134 \&\fBDH_set_method()\fR returns nonzero if the provided \fBmeth\fR was successfully set as
135 the method for \fBdh\fR (including unloading the ENGINE handle if the previous
136 method was supplied by an ENGINE).
137 .PP
138 \&\fBDH_new_method()\fR returns NULL and sets an error code that can be obtained by
139 \&\fBERR_get_error\fR\|(3) if the allocation fails. Otherwise it
140 returns a pointer to the newly allocated structure.
141 .SH "SEE ALSO"
142 .IX Header "SEE ALSO"
143 \&\fBDH_new\fR\|(3), \fBDH_new\fR\|(3), \fBDH_meth_new\fR\|(3)
144 .SH HISTORY
145 .IX Header "HISTORY"
146 All of these functions were deprecated in OpenSSL 3.0.
147 .SH COPYRIGHT
148 .IX Header "COPYRIGHT"
149 Copyright 2000\-2020 The OpenSSL Project Authors. All Rights Reserved.
150 .PP
151 Licensed under the Apache License 2.0 (the "License"). You may not use
152 this file except in compliance with the License. You can obtain a copy
153 in the file LICENSE in the source distribution or at
154 <https://www.openssl.org/source/license.html>.