DSA_SIG_NEW(3)

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

✨ DSA_SIG_NEW(3) ✨

okay so bestie, this is a page from the Library Functions Manual β€” yes the actual DSA_SIG_NEW(3) one β€” and it's all about DSA signature objects and how to wrangle them. buckle up, it's giving very much "small API, big feelings" πŸ’…


🌸 NAME 🌸

DSA_SIG_new, DSA_SIG_free, DSA_SIG_get0, DSA_SIG_set0 β€” literally the four functions you need to manipulate DSA signature objects ✨


πŸ¦‹ SYNOPSIS πŸ¦‹

the library is libcrypto, and you get at it like this:

#include <openssl/dsa.h>

then the functions themselves:

DSA_SIG *
DSA_SIG_new(void);

void
DSA_SIG_free(DSA_SIG *sig);

void
DSA_SIG_get0(const DSA_SIG *sig, const BIGNUM **r, const BIGNUM **s);

int
DSA_SIG_set0(DSA_SIG *sig, BIGNUM *r, BIGNUM *s);

πŸ’– DESCRIPTION πŸ’–

  • DSA_SIG_new() β€” allocates an empty DSA_SIG structure. a fresh lil baby struct, no thoughts, head empty 🐣
  • DSA_SIG_free() β€” frees the DSA_SIG structure and its components. and no cap, the values get erased before the memory goes back to the system, so nothing lingers. if sig is a NULL pointer, nothing happens at all β€” no action occurs, we simply do not perceive it πŸ™ˆ
  • DSA_SIG_get0() β€” retrieves internal pointers to the r and s values contained in sig. it's giving "peek behind the curtain" πŸ”
  • DSA_SIG_set0() β€” this is how you actually set the r and s values. but listen, this part matters: calling this function transfers the memory management of the values to sig, so the caller should not free them. not you, bestie, that's sig's job now 🫢

πŸŽ€ RETURN VALUES πŸŽ€

if the allocation fails, DSA_SIG_new() returns NULL and sets an error code that you can go grab with ERR_get_error(3). otherwise? it returns a pointer to the newly allocated structure. slay ✨

DSA_SIG_set0() returns 1 on success or 0 on failure. simple as that, no notes πŸ’€


πŸ‘‘ SEE ALSO πŸ‘‘

DSA_do_sign(3), DSA_new(3)


🌈 HISTORY 🌈

DSA_SIG_new() and DSA_SIG_free() first appeared in OpenSSL 0.9.3 and have been available since OpenBSD 2.6. iconic longevity honestly ⭐

DSA_SIG_get0() and DSA_SIG_set0() first appeared in OpenSSL 1.1.0 and have been available since OpenBSD 6.3. the newer girlies of the group 🧚


fr fr, that's the whole page β€” every flag, every pointer, every return value, all of it. nothing skipped, nothing invented. πŸ’œ

and that's a wrap, bestie! this one's from Debian, dated June 8, 2025, and the page itself is DSA_SIG_NEW(3) in the Library Functions Manual β€” go be a main character with your DSA signatures now πŸ¦‹πŸ’…πŸ“

πŸ“¦ where this page comes from