Scroll to navigation

DSA_METH_NEW(3) Library Functions Manual DSA_METH_NEW(3)

NAME

DSA_meth_new, DSA_meth_free, DSA_meth_dup, DSA_meth_get0_name, DSA_meth_set1_name, DSA_meth_set_sign, DSA_meth_set_finishbuild up DSA methods

SYNOPSIS

#include <openssl/dsa.h>

DSA_METHOD *
DSA_meth_new(const char *name, int flags);

void
DSA_meth_free(DSA_METHOD *meth);

DSA_METHOD *
DSA_meth_dup(const DSA_METHOD *meth);

const char *
DSA_meth_get0_name(const DSA_METHOD *meth);

int
DSA_meth_set1_name(DSA_METHOD *meth, const char *name);

int
DSA_meth_set_sign(DSA_METHOD *meth, DSA_SIG *(*sign)(const unsigned char *, int, DSA *));

int
DSA_meth_set_finish(DSA_METHOD *meth, int (*finish)(DSA *));

DESCRIPTION

The DSA_METHOD structure holds function pointers for custom DSA implementations.

() creates a new DSA_METHOD structure. A copy of the NUL-terminated name is stored in the new DSA_METHOD object. Any new DSA object constructed from this DSA_METHOD will have the given flags set by default.

() creates a deep copy of meth. This might be useful for creating a new DSA_METHOD based on an existing one, but with some differences.

() destroys meth and frees any memory associated with it.

() returns an internal pointer to the name of meth. () stores a copy of the NUL-terminated name in meth after freeing the previously stored name. Method names are ignored by the default DSA implementation but can be used by alternative implementations and by the application program.

() sets the function used for creating a DSA signature. This function will be called from DSA_do_sign(3) and indirectly from DSA_sign(3). The parameters of sign have the same meaning as for DSA_do_sign(3).

() sets an optional function for destroying a DSA object. Unless finish is NULL, it will be called from DSA_free(3). It takes the same argument and is intended to do DSA implementation specific cleanup. The memory used by the DSA object itself should not be freed by the finish function.

RETURN VALUES

DSA_meth_new() and DSA_meth_dup() return the newly allocated DSA_METHOD object or NULL on failure.

DSA_meth_get0_name() returns an internal pointer which must not be freed by the caller.

DSA_meth_set1_name() and all DSA_meth_set_*() functions return 1 on success or 0 on failure. In the current implementation, only DSA_meth_set1_name() can actually fail.

SEE ALSO

DSA_do_sign(3), DSA_new(3), DSA_set_method(3), DSA_SIG_new(3), DSA_sign(3)

HISTORY

These functions first appeared in OpenSSL 1.1.0.

DSA_meth_new(), DSA_meth_free(), DSA_meth_dup(), DSA_meth_set_sign(), and DSA_meth_set_finish() have been available since OpenBSD 6.3.

DSA_meth_get0_name() and DSA_meth_set1_name() have been available since OpenBSD 7.2.

July 10, 2022 Linux 6.4.0-150600.23.25-default