DSA_NEW(3)

πŸ“¦ version 4.4.0, in alpine 3.24, arch rolling

πŸ’– DSA_NEW(3) πŸ’–

okay so this one is from the Library Functions Manual, and it's all about the DSA object allocation/freeing girlies. The DSA functions implement the Digital Signature Algorithm β€” yes, that DSA, bestie.


🌸 NAME 🌸

DSA_new, DSA_up_ref, DSA_free β€” allocate and free DSA objects, periodt.


✨ SYNOPSIS ✨

okay so first up, the exact synopsis, no cap:

library β€œlibcrypto” #include <openssl/dsa.h>

DSA*
DSA_new(void);

int
DSA_up_ref(DSA *dsa);

void
DSA_free(DSA *dsa);

πŸ¦‹ DESCRIPTION πŸ¦‹

The DSA functions implement the Digital Signature Algorithm. iconic crypto behavior, honestly.

  • DSA_new() β€” allocates and initializes a DSA structure, and sets the reference count to 1. It is equivalent to calling DSA_new_method(3) with a NULL argument. cute, efficient, to the point.
  • DSA_up_ref() β€” increments the reference count by 1. just a lil +1, slay.
  • DSA_free() β€” decrements the reference count by 1. If it reaches 0, it frees the DSA structure and its components. The values are erased before the memory is returned to the system. If dsa is a NULL pointer, no action occurs. very demure, very mindful about cleanup.
bestie listen: DSA_free() only actually frees stuff when the reference count hits 0. and if dsa is NULL, it literally does nothing. no drama.

🌈 RETURN VALUES 🌈

  • If the allocation fails, DSA_new() returns NULL and sets an error code that can be obtained by ERR_get_error(3). Otherwise it returns a pointer to the newly allocated structure.
  • DSA_up_ref() returns 1 for success or 0 for failure.

πŸ‘‘ SEE ALSO πŸ‘‘

go read these next, bestie:


πŸŽ€ STANDARDS πŸŽ€

US Federal Information Processing Standard FIPS 186 (Digital Signature Standard, DSS), ANSI X9.30 β€” standards receipts, fr fr.


🧚 HISTORY 🧚

  • DSA_new() and DSA_free() first appeared in SSLeay 0.6.0 and have been available since OpenBSD 2.4. vintage.
  • DSA_up_ref() first appeared in OpenSSL 0.9.7 and has been available since OpenBSD 3.2. also vintage, just a different era.

xoxo, Debian πŸ’– June 8, 2025 πŸ’– DSA_NEW(3) πŸ’…

πŸ“¦ where this page comes from