summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/doc/EVP_VerifyInit.pod
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/libcrypto/doc/EVP_VerifyInit.pod')
-rw-r--r--src/lib/libcrypto/doc/EVP_VerifyInit.pod36
1 files changed, 25 insertions, 11 deletions
diff --git a/src/lib/libcrypto/doc/EVP_VerifyInit.pod b/src/lib/libcrypto/doc/EVP_VerifyInit.pod
index 736a0f4a82..80c656fde8 100644
--- a/src/lib/libcrypto/doc/EVP_VerifyInit.pod
+++ b/src/lib/libcrypto/doc/EVP_VerifyInit.pod
@@ -8,30 +8,35 @@ EVP_VerifyInit, EVP_VerifyUpdate, EVP_VerifyFinal - EVP signature verification f
8 8
9 #include <openssl/evp.h> 9 #include <openssl/evp.h>
10 10
11 void EVP_VerifyInit(EVP_MD_CTX *ctx, const EVP_MD *type); 11 int EVP_VerifyInit_ex(EVP_MD_CTX *ctx, const EVP_MD *type, ENGINE *impl);
12 void EVP_VerifyUpdate(EVP_MD_CTX *ctx, const void *d, unsigned int cnt); 12 int EVP_VerifyUpdate(EVP_MD_CTX *ctx, const void *d, unsigned int cnt);
13 int EVP_VerifyFinal(EVP_MD_CTX *ctx,unsigned char *sigbuf, unsigned int siglen,EVP_PKEY *pkey); 13 int EVP_VerifyFinal(EVP_MD_CTX *ctx,unsigned char *sigbuf, unsigned int siglen,EVP_PKEY *pkey);
14 14
15 int EVP_VerifyInit(EVP_MD_CTX *ctx, const EVP_MD *type);
16
15=head1 DESCRIPTION 17=head1 DESCRIPTION
16 18
17The EVP signature verification routines are a high level interface to digital 19The EVP signature verification routines are a high level interface to digital
18signatures. 20signatures.
19 21
20EVP_VerifyInit() initializes a verification context B<ctx> to using digest 22EVP_VerifyInit_ex() sets up verification context B<ctx> to use digest
21B<type>: this will typically be supplied by a function such as EVP_sha1(). 23B<type> from ENGINE B<impl>. B<ctx> must be initialized by calling
24EVP_MD_CTX_init() before calling this function.
22 25
23EVP_VerifyUpdate() hashes B<cnt> bytes of data at B<d> into the 26EVP_VerifyUpdate() hashes B<cnt> bytes of data at B<d> into the
24verification context B<ctx>. This function can be called several times on the 27verification context B<ctx>. This function can be called several times on the
25same B<ctx> to include additional data. 28same B<ctx> to include additional data.
26 29
27EVP_VerifyFinal() verifies the data in B<ctx> using the public key B<pkey> 30EVP_VerifyFinal() verifies the data in B<ctx> using the public key B<pkey>
28and against the B<siglen> bytes at B<sigbuf>. After calling EVP_VerifyFinal() 31and against the B<siglen> bytes at B<sigbuf>.
29no additional calls to EVP_VerifyUpdate() can be made, but EVP_VerifyInit() 32
30can be called to initialize a new verification operation. 33EVP_VerifyInit() initializes verification context B<ctx> to use the default
34implementation of digest B<type>.
31 35
32=head1 RETURN VALUES 36=head1 RETURN VALUES
33 37
34EVP_VerifyInit() and EVP_VerifyUpdate() do not return values. 38EVP_VerifyInit_ex() and EVP_VerifyUpdate() return 1 for success and 0 for
39failure.
35 40
36EVP_VerifyFinal() returns 1 for a correct signature, 0 for failure and -1 if some 41EVP_VerifyFinal() returns 1 for a correct signature, 0 for failure and -1 if some
37other error occurred. 42other error occurred.
@@ -49,11 +54,18 @@ digest algorithm must be used with the correct public key type. A list of
49algorithms and associated public key algorithms appears in 54algorithms and associated public key algorithms appears in
50L<EVP_DigestInit(3)|EVP_DigestInit(3)>. 55L<EVP_DigestInit(3)|EVP_DigestInit(3)>.
51 56
57The call to EVP_VerifyFinal() internally finalizes a copy of the digest context.
58This means that calls to EVP_VerifyUpdate() and EVP_VerifyFinal() can be called
59later to digest and verify additional data.
60
61Since only a copy of the digest context is ever finalized the context must
62be cleaned up after use by calling EVP_MD_CTX_cleanup() or a memory leak
63will occur.
64
52=head1 BUGS 65=head1 BUGS
53 66
54Several of the functions do not return values: maybe they should. Although the 67Older versions of this documentation wrongly stated that calls to
55internal digest operations will never fail some future hardware based operations 68EVP_VerifyUpdate() could not be made after calling EVP_VerifyFinal().
56might.
57 69
58=head1 SEE ALSO 70=head1 SEE ALSO
59 71
@@ -69,4 +81,6 @@ L<sha(3)|sha(3)>, L<digest(1)|digest(1)>
69EVP_VerifyInit(), EVP_VerifyUpdate() and EVP_VerifyFinal() are 81EVP_VerifyInit(), EVP_VerifyUpdate() and EVP_VerifyFinal() are
70available in all versions of SSLeay and OpenSSL. 82available in all versions of SSLeay and OpenSSL.
71 83
84EVP_VerifyInit_ex() was added in OpenSSL 0.9.7
85
72=cut 86=cut