Blame doc/man3/DH_set_method.pod

Packit Service 084de1
=pod
Packit Service 084de1
Packit Service 084de1
=head1 NAME
Packit Service 084de1
Packit Service 084de1
DH_set_default_method, DH_get_default_method,
Packit Service 084de1
DH_set_method, DH_new_method, DH_OpenSSL - select DH method
Packit Service 084de1
Packit Service 084de1
=head1 SYNOPSIS
Packit Service 084de1
Packit Service 084de1
 #include <openssl/dh.h>
Packit Service 084de1
Packit Service 084de1
 void DH_set_default_method(const DH_METHOD *meth);
Packit Service 084de1
Packit Service 084de1
 const DH_METHOD *DH_get_default_method(void);
Packit Service 084de1
Packit Service 084de1
 int DH_set_method(DH *dh, const DH_METHOD *meth);
Packit Service 084de1
Packit Service 084de1
 DH *DH_new_method(ENGINE *engine);
Packit Service 084de1
Packit Service 084de1
 const DH_METHOD *DH_OpenSSL(void);
Packit Service 084de1
Packit Service 084de1
=head1 DESCRIPTION
Packit Service 084de1
Packit Service 084de1
A B<DH_METHOD> specifies the functions that OpenSSL uses for Diffie-Hellman
Packit Service 084de1
operations. By modifying the method, alternative implementations
Packit Service 084de1
such as hardware accelerators may be used. IMPORTANT: See the NOTES section for
Packit Service 084de1
important information about how these DH API functions are affected by the use
Packit Service 084de1
of B<ENGINE> API calls.
Packit Service 084de1
Packit Service 084de1
Initially, the default DH_METHOD is the OpenSSL internal implementation, as
Packit Service 084de1
returned by DH_OpenSSL().
Packit Service 084de1
Packit Service 084de1
DH_set_default_method() makes B<meth> the default method for all DH
Packit Service 084de1
structures created later.
Packit Service 084de1
B<NB>: This is true only whilst no ENGINE has been set
Packit Service 084de1
as a default for DH, so this function is no longer recommended.
Packit Service 084de1
This function is not thread-safe and should not be called at the same time
Packit Service 084de1
as other OpenSSL functions.
Packit Service 084de1
Packit Service 084de1
DH_get_default_method() returns a pointer to the current default DH_METHOD.
Packit Service 084de1
However, the meaningfulness of this result is dependent on whether the ENGINE
Packit Service 084de1
API is being used, so this function is no longer recommended.
Packit Service 084de1
Packit Service 084de1
DH_set_method() selects B<meth> to perform all operations using the key B<dh>.
Packit Service 084de1
This will replace the DH_METHOD used by the DH key and if the previous method
Packit Service 084de1
was supplied by an ENGINE, the handle to that ENGINE will be released during the
Packit Service 084de1
change. It is possible to have DH keys that only work with certain DH_METHOD
Packit Service 084de1
implementations (eg. from an ENGINE module that supports embedded
Packit Service 084de1
hardware-protected keys), and in such cases attempting to change the DH_METHOD
Packit Service 084de1
for the key can have unexpected results.
Packit Service 084de1
Packit Service 084de1
DH_new_method() allocates and initializes a DH structure so that B<engine> will
Packit Service 084de1
be used for the DH operations. If B<engine> is NULL, the default ENGINE for DH
Packit Service 084de1
operations is used, and if no default ENGINE is set, the DH_METHOD controlled by
Packit Service 084de1
DH_set_default_method() is used.
Packit Service 084de1
Packit Service 084de1
A new DH_METHOD object may be constructed using DH_meth_new() (see
Packit Service 084de1
L<DH_meth_new(3)>).
Packit Service 084de1
Packit Service 084de1
=head1 RETURN VALUES
Packit Service 084de1
Packit Service 084de1
DH_OpenSSL() and DH_get_default_method() return pointers to the respective
Packit Service 084de1
B<DH_METHOD>s.
Packit Service 084de1
Packit Service 084de1
DH_set_default_method() returns no value.
Packit Service 084de1
Packit Service 084de1
DH_set_method() returns non-zero if the provided B<meth> was successfully set as
Packit Service 084de1
the method for B<dh> (including unloading the ENGINE handle if the previous
Packit Service 084de1
method was supplied by an ENGINE).
Packit Service 084de1
Packit Service 084de1
DH_new_method() returns NULL and sets an error code that can be obtained by
Packit Service 084de1
L<ERR_get_error(3)> if the allocation fails. Otherwise it
Packit Service 084de1
returns a pointer to the newly allocated structure.
Packit Service 084de1
Packit Service 084de1
=head1 SEE ALSO
Packit Service 084de1
Packit Service 084de1
L<DH_new(3)>, L<DH_new(3)>, L<DH_meth_new(3)>
Packit Service 084de1
Packit Service 084de1
=head1 COPYRIGHT
Packit Service 084de1
Packit Service 084de1
Copyright 2000-2016 The OpenSSL Project Authors. All Rights Reserved.
Packit Service 084de1
Packit Service 084de1
Licensed under the OpenSSL license (the "License").  You may not use
Packit Service 084de1
this file except in compliance with the License.  You can obtain a copy
Packit Service 084de1
in the file LICENSE in the source distribution or at
Packit Service 084de1
L<https://www.openssl.org/source/license.html>.
Packit Service 084de1
Packit Service 084de1
=cut