---
name: "libressl-DSA_SIG_new"
section: "3"
platform: "linux"
package: "libressl"
version: "4.4.0-1"
release: "Arch Linux 2026-11-01"
platforms: ["linux"]
url: "https://new.carta.tech/libressl-DSA_SIG_new"
---

# libressl-DSA\_SIG\_new(3)

manipulate DSA signature objects

## NAME

**DSA\_SIG\_new**, **DSA\_SIG\_free**, **DSA\_SIG\_get0**, **DSA\_SIG\_set0** – manipulate DSA signature objects

## SYNOPSIS

Crypto Library (libcrypto, -lcrypto)

**#include \<openssl/dsa.h\>**

*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.

**DSA\_SIG\_free**() frees the *DSA\_SIG* structure and its components. The values are erased before the memory is returned to the system. If *sig* is a NULL pointer, no action occurs.

**DSA\_SIG\_get0**() retrieves internal pointers to the *r* and *s* values contained in *sig*.

The *r* and *s* values can be set by calling **DSA\_SIG\_set0**(). Calling this function transfers the memory management of the values to *sig*, and therefore they should not be freed by the caller.

## RETURN VALUES

If the allocation fails, **DSA\_SIG\_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\_SIG\_set0**() returns 1 on success or 0 on failure.

## 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.

**DSA\_SIG\_get0**() and **DSA\_SIG\_set0**() first appeared in OpenSSL 1.1.0 and have been available since OpenBSD 6.3.
