DSA_DO_SIGN(3SSL)

πŸ’– DSA_DO_SIGN πŸ’–

okay bestie, welcome to the DSA_DO_SIGN(3SSL) page β€” that's the OpenSSL manual, section 3SSL, and today we're talking about the raw DSA signature operations. which is a lot of words for "sign stuff, check stuff, but do it the manual way". let's get into it ✨


🌸 NAME 🌸

DSA_do_sign, DSA_do_verify β€” raw DSA signature operations. yes that's literally it, no more no less, it's giving "what it says on the tin" πŸ’…


πŸŽ€ SYNOPSIS πŸŽ€

first things first, you gotta include the header:

#include <openssl/dsa.h>
🚨 okay so real talk: these functions have been deprecated since OpenSSL 3.0, and you can make them vanish entirely by defining OPENSSL_API_COMPAT with a suitable version value. more on that in openssl_user_macros(7). don't say I didn't warn you 😭

here are the signatures, copy 'em exactly bestie:

DSA_SIG *DSA_do_sign(const unsigned char *dgst, int dlen, DSA *dsa);

int DSA_do_verify(const unsigned char *dgst, int dgst_len,
                  DSA_SIG *sig, DSA *dsa);

πŸ¦‹ DESCRIPTION πŸ¦‹

every single function on this page is deprecated. all of them. not one survivor. so like, if you're writing new code, please please please use these instead:

that's the glow-up route ✨


so what does DSA_do_sign() actually do? it computes a digital signature on the len byte message digest dgst using the private key dsa, and hands it back to you in a newly allocated DSA_SIG structure. brand new, fresh out the box, it's yours to free 🎁

oh and pro tip: DSA_sign_setup(3) can be used to precompute part of the signing operation, which is the move if signature generation is time-critical and you're in your speed era ⚑

then DSA_do_verify() checks whether the signature sig matches a given message digest dgst of size len. and dsa here? that's the signer's public key, bestie. public. do not mix those up I am begging πŸ™ˆ


πŸ’€ RETURN VALUES πŸ’€

  • DSA_do_sign() β€” returns the signature, or NULL on error. no signature, no vibes πŸ˜”
  • DSA_do_verify() β€” returns 1 for a valid signature βœ…, 0 for an incorrect signature ❌, and -1 on error πŸ’€

and if you got an error, you can grab the error codes with ERR_get_error(3). iykyk


🌈 SEE ALSO 🌈

go read these too, they're all part of the friend group:


πŸ“œ HISTORY πŸ“œ

all of these functions were deprecated in OpenSSL 3.0. that's the whole history lesson, periodt πŸ‘‘


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 that's the page bestie!! this iconic little manual moment is from OpenSSL 4.0.3, dated 2026-09-29 β€” DSA_DO_SIGN(3SSL), forever in our hearts πŸ«ΆπŸ’–βœ¨

πŸ“¦ where this page comes from