DSA_SET_METHOD(3ossl)

πŸ“¦
version 15.1 Β· 3 versions
, in freebsd 15.1

πŸ’… DSA_SET_METHOD β€” the OpenSSL 3ossl glow-up

ok so bestie, welcome to DSA_SET_METHOD(3ossl), aka the page where OpenSSL lets you swap out how DSA actually does its thing. We're talking DSA_set_default_method, DSA_get_default_method, DSA_set_method, DSA_new_method, and DSA_OpenSSL β€” the whole "select DSA method" friend group. Let's get into it πŸ’–


✨ NAME ✨

DSA_set_default_method, DSA_get_default_method, DSA_set_method, DSA_new_method, DSA_OpenSSL β€” select DSA method. that's the whole vibe πŸŽ€


πŸ¦‹ SYNOPSIS πŸ¦‹

#include <openssl/dsa.h>
⚠️ okay so listen β€” the following functions have been deprecated since OpenSSL 3.0, and you can hide them entirely by defining OPENSSL_API_COMPAT with a suitable version value. see openssl_user_macros(7) for the deets 🫢
void DSA_set_default_method(const DSA_METHOD *meth);

const DSA_METHOD *DSA_get_default_method(void);

int DSA_set_method(DSA *dsa, const DSA_METHOD *meth);

DSA *DSA_new_method(ENGINE *engine);

const DSA_METHOD *DSA_OpenSSL(void);

🌸 DESCRIPTION 🌸

okay first things first, no cap: all of the functions described on this page are deprecated. Applications should use providers instead of method overrides. that's the assignment, bestie πŸ’€

A DSA_METHOD specifies the functions that OpenSSL uses for DSA operations. By modifying the method, alternative implementations such as hardware accelerators may be used. IMPORTANT: see the NOTES section (yes, it's mentioned β€” go look) for important information about how these DSA API functions are affected by the use of ENGINE API calls. iykyk πŸ‘‘

Initially, the default DSA_METHOD is the OpenSSL internal implementation, as returned by DSA_OpenSSL(). the OG, the blueprint, the main character ✨

DSA_set_default_method() makes meth the default method for all DSA structures created later. NB: this is true only whilst no ENGINE has been set as a default for DSA, so this function is no longer recommended. also β€” and this is the important part β€” this function is not thread-safe and should not be called at the same time as other OpenSSL functions. like, do not multitask her, she will not survive it 😭

DSA_get_default_method() returns a pointer to the current default DSA_METHOD. However, the meaningfulness of this result is dependent on whether the ENGINE API is being used, so this function is no longer recommended. it's giving "it depends" energy 🫠

DSA_set_method() selects meth to perform all operations using the key rsa. This will replace the DSA_METHOD used by the DSA key and if the previous method was supplied by an ENGINE, the handle to that ENGINE will be released during the change. It is possible to have DSA keys that only work with certain DSA_METHOD implementations (e.g. from an ENGINE module that supports embedded hardware-protected keys), and in such cases attempting to change the DSA_METHOD for the key can have unexpected results. see DSA_meth_new(3) for information on constructing custom DSA_METHOD objects; πŸ’…

DSA_new_method() allocates and initializes a DSA structure so that engine will be used for the DSA operations. If engine is NULL, the default engine for DSA operations is used, and if no default ENGINE is set, the DSA_METHOD controlled by DSA_set_default_method() is used. she's got backups for her backups 🧚


πŸŽ€ RETURN VALUES πŸŽ€

  • DSA_OpenSSL() and DSA_get_default_method() β€” return pointers to the respective DSA_METHODs. cute little pointers, handing them right over 🫢
  • DSA_set_default_method() β€” returns no value. nothing. nada. she gives nothing and that's her right πŸ’…
  • DSA_set_method() β€” returns nonzero if the provided meth was successfully set as the method for dsa (including unloading the ENGINE handle if the previous method was supplied by an ENGINE). slay βœ…
  • DSA_new_method() β€” returns NULL and sets an error code that can be obtained by ERR_get_error(3) if the allocation fails. Otherwise it returns a pointer to the newly allocated structure. very much "you get a pointer or you get a problem" energy 😭

πŸ”₯ SEE ALSO πŸ”₯

(yes, DSA_new(3) is listed twice. no, i'm not fixing it. she said it twice, it's iconic, it stays 🌈)


⭐ HISTORY ⭐

All of these functions were deprecated in OpenSSL 3.0. they're retired but they're still serving looks πŸ’€βœ¨


Copyright 2000-2021 The OpenSSL Project Authors. All Rights Reserved.

Licensed under the Apache License 2.0 (the "License"). You may not use this file except in compliance with the License. You can obtain a copy in the file LICENSE in the source distribution or at <https://www.openssl.org/source/license.html>.


and that's the page bestie! πŸ“ this whole thing is from OpenSSL 3.5.6, dated 2026-04-07, and the manual is DSA_SET_METHOD(3ossl) β€” go forth and maybe don't use these deprecated functions, mwah πŸ’œπŸ¦‹πŸŒΈ

πŸ“¦ where this page comes from