Blame doc/man3/EVP_VerifyInit.pod

Packit c4476c
=pod
Packit c4476c
Packit c4476c
=head1 NAME
Packit c4476c
Packit c4476c
EVP_VerifyInit_ex,
Packit c4476c
EVP_VerifyInit, EVP_VerifyUpdate, EVP_VerifyFinal
Packit c4476c
- EVP signature verification functions
Packit c4476c
Packit c4476c
=head1 SYNOPSIS
Packit c4476c
Packit c4476c
 #include <openssl/evp.h>
Packit c4476c
Packit c4476c
 int EVP_VerifyInit_ex(EVP_MD_CTX *ctx, const EVP_MD *type, ENGINE *impl);
Packit c4476c
 int EVP_VerifyUpdate(EVP_MD_CTX *ctx, const void *d, unsigned int cnt);
Packit c4476c
 int EVP_VerifyFinal(EVP_MD_CTX *ctx, unsigned char *sigbuf, unsigned int siglen,
Packit c4476c
                     EVP_PKEY *pkey);
Packit c4476c
Packit c4476c
 int EVP_VerifyInit(EVP_MD_CTX *ctx, const EVP_MD *type);
Packit c4476c
Packit c4476c
=head1 DESCRIPTION
Packit c4476c
Packit c4476c
The EVP signature verification routines are a high level interface to digital
Packit c4476c
signatures.
Packit c4476c
Packit c4476c
EVP_VerifyInit_ex() sets up verification context B<ctx> to use digest
Packit c4476c
B<type> from ENGINE B<impl>. B<ctx> must be created by calling
Packit c4476c
EVP_MD_CTX_new() before calling this function.
Packit c4476c
Packit c4476c
EVP_VerifyUpdate() hashes B<cnt> bytes of data at B<d> into the
Packit c4476c
verification context B<ctx>. This function can be called several times on the
Packit c4476c
same B<ctx> to include additional data.
Packit c4476c
Packit c4476c
EVP_VerifyFinal() verifies the data in B<ctx> using the public key B<pkey>
Packit c4476c
and against the B<siglen> bytes at B<sigbuf>.
Packit c4476c
Packit c4476c
EVP_VerifyInit() initializes verification context B<ctx> to use the default
Packit c4476c
implementation of digest B<type>.
Packit c4476c
Packit c4476c
=head1 RETURN VALUES
Packit c4476c
Packit c4476c
EVP_VerifyInit_ex() and EVP_VerifyUpdate() return 1 for success and 0 for
Packit c4476c
failure.
Packit c4476c
Packit c4476c
EVP_VerifyFinal() returns 1 for a correct signature, 0 for failure and -1 if some
Packit c4476c
other error occurred.
Packit c4476c
Packit c4476c
The error codes can be obtained by L<ERR_get_error(3)>.
Packit c4476c
Packit c4476c
=head1 NOTES
Packit c4476c
Packit c4476c
The B<EVP> interface to digital signatures should almost always be used in
Packit c4476c
preference to the low level interfaces. This is because the code then becomes
Packit c4476c
transparent to the algorithm used and much more flexible.
Packit c4476c
Packit c4476c
The call to EVP_VerifyFinal() internally finalizes a copy of the digest context.
Packit c4476c
This means that calls to EVP_VerifyUpdate() and EVP_VerifyFinal() can be called
Packit c4476c
later to digest and verify additional data.
Packit c4476c
Packit c4476c
Since only a copy of the digest context is ever finalized the context must
Packit c4476c
be cleaned up after use by calling EVP_MD_CTX_free() or a memory leak
Packit c4476c
will occur.
Packit c4476c
Packit c4476c
=head1 BUGS
Packit c4476c
Packit c4476c
Older versions of this documentation wrongly stated that calls to
Packit c4476c
EVP_VerifyUpdate() could not be made after calling EVP_VerifyFinal().
Packit c4476c
Packit c4476c
Since the public key is passed in the call to EVP_SignFinal() any error
Packit c4476c
relating to the private key (for example an unsuitable key and digest
Packit c4476c
combination) will not be indicated until after potentially large amounts of
Packit c4476c
data have been passed through EVP_SignUpdate().
Packit c4476c
Packit c4476c
It is not possible to change the signing parameters using these function.
Packit c4476c
Packit c4476c
The previous two bugs are fixed in the newer EVP_DigestVerify*() function.
Packit c4476c
Packit c4476c
=head1 SEE ALSO
Packit c4476c
Packit c4476c
L<evp(7)>,
Packit c4476c
L<EVP_SignInit(3)>,
Packit c4476c
L<EVP_DigestInit(3)>,
Packit c4476c
L<evp(7)>, L<HMAC(3)>, L<MD2(3)>,
Packit c4476c
L<MD5(3)>, L<MDC2(3)>, L<RIPEMD160(3)>,
Packit c4476c
L<SHA1(3)>, L<dgst(1)>
Packit c4476c
Packit c4476c
=head1 COPYRIGHT
Packit c4476c
Packit c4476c
Copyright 2000-2019 The OpenSSL Project Authors. All Rights Reserved.
Packit c4476c
Packit c4476c
Licensed under the OpenSSL license (the "License").  You may not use
Packit c4476c
this file except in compliance with the License.  You can obtain a copy
Packit c4476c
in the file LICENSE in the source distribution or at
Packit c4476c
L<https://www.openssl.org/source/license.html>.
Packit c4476c
Packit c4476c
=cut