DSA_SIG_NEW(3ossl)

πŸ’– DSA_SIG_NEW πŸ’–

okay bestie, so this is the OpenSSL manual page for DSA_SIG_NEW(3ossl) and it's literally all about DSA signature objects β€” how to make them, how to yeet them, how to peek inside, and how to fill them up. it's giving "small API, big feelings." let's get into it πŸŽ€


✨ NAME ✨

DSA_SIG_get0, DSA_SIG_set0, DSA_SIG_new, DSA_SIG_free β€” allocate and free DSA signature objects πŸ¦‹


✨ SYNOPSIS ✨

#include <openssl/dsa.h>

DSA_SIG *DSA_SIG_new(void);
void DSA_SIG_free(DSA_SIG *a);
void DSA_SIG_get0(const DSA_SIG *sig, const BIGNUM **pr, const BIGNUM **ps);
int DSA_SIG_set0(DSA_SIG *sig, BIGNUM *r, BIGNUM *s);

✨ DESCRIPTION ✨

DSA_SIG_new() allocates an empty DSA_SIG structure. that's it. that's the whole job. an empty lil container, freshly allocated, waiting for its moment πŸ’…

DSA_SIG_free() frees the DSA_SIG structure and its components. and not in a lazy way either β€” the values get erased before the memory is handed back to the system, so nothing secret is left lying around. queen behavior fr fr πŸ”₯

and if the argument is NULL? nothing happens. it just politely does nothing. no crash, no drama 🫢

DSA_SIG_get0() returns internal pointers to the r and s values contained in sig. so you're not getting copies, bestie β€” you're getting pointers into the actual internals. lowkey important, highkey iconic πŸ‘‘

the r and s values can be set by calling DSA_SIG_set0() and passing the new values for r and s as parameters to the function. but listen, this is the part you cannot skip:

calling this function transfers the memory management of the values to the DSA_SIG object. so the values you passed in should not be freed directly after this function has been called. not "probably shouldn't" β€” should not. if you free them yourself afterwards you're double-freeing and that's a whole mess you do not want πŸ’€ the DSA_SIG owns them now. periodt.

✨ RETURN VALUES ✨

  • DSA_SIG_new() β€” if the allocation fails, it returns NULL and sets an error code that you can grab with ERR_get_error(3). otherwise it returns a pointer to the newly allocated structure ✨
  • DSA_SIG_free() β€” returns no value. it's a void girlie, she just does her thing and leaves 🌸
  • DSA_SIG_set0() β€” returns 1 on success or 0 on failure. classic binary outcome, no in-between, very much giving vibe check πŸŽ€

✨ SEE ALSO ✨


Copyright 2000-2024 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>.


okay that's the whole page bestie, you ate it, you understood it, you're basically a DSA signature object whisperer now 🌈⭐ and for the cute sign-off: this was OpenSSL 3.5.9, dated 2026-09-29, DSA_SIG_NEW(3ossl). mwah πŸ’‹ go manage your memory responsibly πŸ§šπŸ’–

πŸ“¦ where this page comes from