DSA_SIGN(3ossl)
π DSA_SIGN β the OpenSSL 3ossl girlie's guide β¨
okay so bestie, welcome to DSA_SIGN(3ossl) β this is the OpenSSL manual page for DSA_sign, DSA_sign_setup, and DSA_verify, aka the DSA signature trifecta. picture me sitting criss-cross on my bed with a strawberry matcha telling you about deprecated crypto APIs. that's the energy. π
π¨ real talk before anything else: all of the functions on this page are deprecated. that's not me being dramatic, that's OpenSSL 3.0. more on that below, but just know going in. π
πΈ SYNOPSIS πΈ
first things first, you gotta pull in the header, no cap:
#include <openssl/dsa.h>
the deprecation situation π«Ά
The following functions have been deprecated since OpenSSL 3.0, and can be hidden entirely by defining OPENSSL_API_COMPAT with a suitable version value, see openssl_user_macros(7):
int DSA_sign(int type, const unsigned char *dgst, int len,
unsigned char *sigret, unsigned int *siglen, DSA *dsa);
int DSA_sign_setup(DSA *dsa, BN_CTX *ctx, BIGNUM **kinvp, BIGNUM **rp);
int DSA_verify(int type, const unsigned char *dgst, int len,
unsigned char *sigbuf, int siglen, DSA *dsa);
copy those exactly if you're working with legacy code, don't come for me. π
β¨ DESCRIPTION β¨
the big disclaimer π
All of the functions described on this page are deprecated. periodt. Applications should instead use EVP_PKEY_sign_init(3), EVP_PKEY_sign(3), EVP_PKEY_verify_init(3) and EVP_PKEY_verify(3). those are the main character APIs now, this page is like the extended universe lore. π
DSA_sign() π₯
DSA_sign() computes a digital signature on the len byte message digest dgst using the private key dsa and places its ASN.1 DER encoding at sigret. the length of the signature is places in *siglen (yes, "places", that's the original's typo, I'm not fixing it, I'm just reporting it π). and heads up: sigret must point to DSA_size(dsa) bytes of memory. not less. don't skimp. allocate. π
DSA_sign_setup() π
DSA_sign_setup() is defined only for backward binary compatibility and should not be used. like, at all. Since OpenSSL 1.1.0 the DSA type is opaque and the output of DSA_sign_setup() cannot be used anyway: calling this function will only cause overhead, and does not affect the actual signature (pre-)computation. so it's giving "decorative". it's giving "why are you here". skip it, bestie. π
DSA_verify() π¦
DSA_verify() verifies that the signature sigbuf of size siglen matches a given message digest dgst of size len. dsa is the signer's public key. that's it, that's the vibe check. π¦
the type parameter π
The type parameter is ignored. literally does nothing. it's the shrug emoji of function parameters. π
the random generator part π
The random generator must be seeded when DSA_sign() (or DSA_sign_setup()) is called. If the automatic seeding or reseeding of the OpenSSL CSPRNG fails due to external circumstances (see RAND(7)), the operation will fail. no seed, no signature. the math does not care about your feelings. π
π RETURN VALUES π
DSA_sign()andDSA_sign_setup()β return1on success,0on error.DSA_verify()β returns1for a valid signature,0for an incorrect signature and-1on error. the three-state queen π.
The error codes can be obtained by ERR_get_error(3). go read the error, it's not gonna read itself. π
β CONFORMING TO β
- US Federal Information Processing Standard FIPS186-4 (Digital Signature Standard, DSS)
- ANSI X9.30
it's certified, it's official, it's got receipts. β
π§ SEE ALSO π§
the whole friend group, fr fr. go say hi. π§
πΈ HISTORY πΈ
okay so the lore: All of these functions were deprecated in OpenSSL 3.0. that's the whole history section. short, sweet, devastating. π
π COPYRIGHT π
Copyright 2000-2021 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 yes bestie, that URL is in angle brackets in the original β that's not me typing html at you, that's the actual license link, iykyk π«Ά)
okay that's the page!! π this whole thing was served to you fresh from OpenSSL 3.5.0, dated 2026-09-25, and it goes by DSA_SIGN(3ossl) β go forth and don't call the deprecated functions, love u, bye!! πβ¨
π¦ where this page comes from
- opensuse-leap 16.0: openssl-3-doc 3.5.0-160000.11.1 Β· Apache-2.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms