DH_set_method.pod 3.4 KB

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