DSA_SIG_NEW(3ossl)
π NAME π
okay so this page is the whole squad for DSA signature objects, bestie: DSA_SIG_get0, DSA_SIG_set0, DSA_SIG_new, and DSA_SIG_free β all about allocating and freeing those little guys. this is page DSA_SIG_NEW(3ossl) from the OpenSSL manuals, and yes we're getting into the math-flavored part, but I got you π«Ά
β¨ SYNOPSIS β¨
like, the whole vibe in code form, no cap:
#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. it's giving blank canvas, main character energy β nothing in it yet, just potential π
DSA_SIG_free() frees the DSA_SIG structure and its components. and listen β the values get erased before the memory is handed back to the system, so nothing juicy is left lying around. also super chill about NULL: if the argument is NULL, nothing is done. no drama, no crash, we love that π
DSA_SIG_get0() returns internal pointers to the r and s values contained in sig. internal, bestie β like it's handing you a peek at the real thing, not a copy.
and the r and s values can be set by calling DSA_SIG_set0(), passing the new values for r and s as parameters to the function.
β οΈ okay this part is important so read it twice: callingDSA_SIG_set0()transfers the memory management of the values to theDSA_SIGobject. so the values you passed in should not be freed directly after this function has been called. that's literally double-free territory and it will not slay π
π RETURN VALUES π
- if the allocation fails,
DSA_SIG_new()returnsNULLand sets an error code that you can grab withERR_get_error(3). otherwise it returns a pointer to the newly allocated structure. lowkey a glow-up on success, error code on failure π DSA_SIG_free()returns no value. it just does its thing and dips.DSA_SIG_set0()returns1on success or0on failure. classic.
π SEE ALSO π
the friend group, fr fr:
π COPYRIGHT π
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>.
β and that's the whole page, bestie β written from OpenSSL version 3.5.6, dated 2026-04-07, page DSA_SIG_NEW(3ossl). go forth and manage your memory correctly, periodt π§π
π¦ where this page comes from
- freebsd 15.1: base 15.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms