1 1.1 christos =pod 2 1.1 christos 3 1.1 christos =head1 NAME 4 1.1 christos 5 1.1 christos DSA_sign, DSA_sign_setup, DSA_verify - DSA signatures 6 1.1 christos 7 1.1 christos =head1 SYNOPSIS 8 1.1 christos 9 1.1 christos #include <openssl/dsa.h> 10 1.1 christos 11 1.1.1.3 christos The following functions have been deprecated since OpenSSL 3.0, and can be 12 1.1.1.3 christos hidden entirely by defining B<OPENSSL_API_COMPAT> with a suitable version value, 13 1.1.1.3 christos see L<openssl_user_macros(7)>: 14 1.1.1.3 christos 15 1.1 christos int DSA_sign(int type, const unsigned char *dgst, int len, 16 1.1 christos unsigned char *sigret, unsigned int *siglen, DSA *dsa); 17 1.1 christos 18 1.1 christos int DSA_sign_setup(DSA *dsa, BN_CTX *ctx, BIGNUM **kinvp, BIGNUM **rp); 19 1.1 christos 20 1.1 christos int DSA_verify(int type, const unsigned char *dgst, int len, 21 1.1 christos unsigned char *sigbuf, int siglen, DSA *dsa); 22 1.1 christos 23 1.1 christos =head1 DESCRIPTION 24 1.1 christos 25 1.1.1.3 christos All of the functions described on this page are deprecated. 26 1.1.1.3 christos Applications should instead use L<EVP_PKEY_sign_init(3)>, L<EVP_PKEY_sign(3)>, 27 1.1.1.3 christos L<EVP_PKEY_verify_init(3)> and L<EVP_PKEY_verify(3)>. 28 1.1.1.3 christos 29 1.1 christos DSA_sign() computes a digital signature on the B<len> byte message 30 1.1 christos digest B<dgst> using the private key B<dsa> and places its ASN.1 DER 31 1.1 christos encoding at B<sigret>. The length of the signature is places in 32 1.1 christos *B<siglen>. B<sigret> must point to DSA_size(B<dsa>) bytes of memory. 33 1.1 christos 34 1.1 christos DSA_sign_setup() is defined only for backward binary compatibility and 35 1.1 christos should not be used. 36 1.1 christos Since OpenSSL 1.1.0 the DSA type is opaque and the output of 37 1.1 christos DSA_sign_setup() cannot be used anyway: calling this function will only 38 1.1 christos cause overhead, and does not affect the actual signature 39 1.1 christos (pre-)computation. 40 1.1 christos 41 1.1 christos DSA_verify() verifies that the signature B<sigbuf> of size B<siglen> 42 1.1 christos matches a given message digest B<dgst> of size B<len>. 43 1.1 christos B<dsa> is the signer's public key. 44 1.1 christos 45 1.1 christos The B<type> parameter is ignored. 46 1.1 christos 47 1.1.1.2 christos The random generator must be seeded when DSA_sign() (or DSA_sign_setup()) 48 1.1 christos is called. 49 1.1.1.2 christos If the automatic seeding or reseeding of the OpenSSL CSPRNG fails due to 50 1.1.1.2 christos external circumstances (see L<RAND(7)>), the operation will fail. 51 1.1 christos 52 1.1 christos =head1 RETURN VALUES 53 1.1 christos 54 1.1 christos DSA_sign() and DSA_sign_setup() return 1 on success, 0 on error. 55 1.1 christos DSA_verify() returns 1 for a valid signature, 0 for an incorrect 56 1.1 christos signature and -1 on error. The error codes can be obtained by 57 1.1 christos L<ERR_get_error(3)>. 58 1.1 christos 59 1.1 christos =head1 CONFORMING TO 60 1.1 christos 61 1.1.1.3 christos US Federal Information Processing Standard FIPS186-4 (Digital Signature 62 1.1 christos Standard, DSS), ANSI X9.30 63 1.1 christos 64 1.1 christos =head1 SEE ALSO 65 1.1 christos 66 1.1 christos L<DSA_new(3)>, L<ERR_get_error(3)>, L<RAND_bytes(3)>, 67 1.1.1.2 christos L<DSA_do_sign(3)>, 68 1.1.1.2 christos L<RAND(7)> 69 1.1 christos 70 1.1.1.3 christos =head1 HISTORY 71 1.1.1.3 christos 72 1.1.1.3 christos All of these functions were deprecated in OpenSSL 3.0. 73 1.1.1.3 christos 74 1.1 christos =head1 COPYRIGHT 75 1.1 christos 76 1.1.1.3 christos Copyright 2000-2022 The OpenSSL Project Authors. All Rights Reserved. 77 1.1 christos 78 1.1.1.3 christos Licensed under the Apache License 2.0 (the "License"). You may not use 79 1.1 christos this file except in compliance with the License. You can obtain a copy 80 1.1 christos in the file LICENSE in the source distribution or at 81 1.1 christos L<https://www.openssl.org/source/license.html>. 82 1.1 christos 83 1.1 christos =cut 84