summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/man/EVP_DigestVerifyInit.3
diff options
context:
space:
mode:
authorschwarze <>2016-11-03 09:35:34 +0000
committerschwarze <>2016-11-03 09:35:34 +0000
commit4d607f17ea3eb38ed9f7703afd423f6055c686d4 (patch)
tree58d82d0d7f6aeee380eaadbcfaa231ecbe6b90a0 /src/lib/libcrypto/man/EVP_DigestVerifyInit.3
parentcf67afe5881727d740e9f6c772aa478123f7d698 (diff)
downloadopenbsd-4d607f17ea3eb38ed9f7703afd423f6055c686d4.tar.gz
openbsd-4d607f17ea3eb38ed9f7703afd423f6055c686d4.tar.bz2
openbsd-4d607f17ea3eb38ed9f7703afd423f6055c686d4.zip
convert EVP manuals from pod to mdoc
Diffstat (limited to 'src/lib/libcrypto/man/EVP_DigestVerifyInit.3')
-rw-r--r--src/lib/libcrypto/man/EVP_DigestVerifyInit.3132
1 files changed, 132 insertions, 0 deletions
diff --git a/src/lib/libcrypto/man/EVP_DigestVerifyInit.3 b/src/lib/libcrypto/man/EVP_DigestVerifyInit.3
new file mode 100644
index 0000000000..0b26eb617e
--- /dev/null
+++ b/src/lib/libcrypto/man/EVP_DigestVerifyInit.3
@@ -0,0 +1,132 @@
1.Dd $Mdocdate: November 3 2016 $
2.Dt EVP_DIGESTVERIFYINIT 3
3.Os
4.Sh NAME
5.Nm EVP_DigestVerifyInit ,
6.Nm EVP_DigestVerifyUpdate ,
7.Nm EVP_DigestVerifyFinal
8.Nd EVP signature verification functions
9.Sh SYNOPSIS
10.In openssl/evp.h
11.Ft int
12.Fo EVP_DigestVerifyInit
13.Fa "EVP_MD_CTX *ctx"
14.Fa "EVP_PKEY_CTX **pctx"
15.Fa "const EVP_MD *type"
16.Fa "ENGINE *e"
17.Fa "EVP_PKEY *pkey"
18.Fc
19.Ft int
20.Fo EVP_DigestVerifyUpdate
21.Fa "EVP_MD_CTX *ctx"
22.Fa "const void *d"
23.Fa "unsigned int cnt"
24.Fc
25.Ft int
26.Fo EVP_DigestVerifyFinal
27.Fa "EVP_MD_CTX *ctx"
28.Fa "unsigned char *sig"
29.Fa "size_t siglen"
30.Fc
31.Sh DESCRIPTION
32The EVP signature routines are a high level interface to digital
33signatures.
34.Pp
35.Fn EVP_DigestVerifyInit
36sets up verification context
37.Fa ctx
38to use digest
39.Fa type
40from
41.Vt ENGINE
42.Fa e
43and public key
44.Fa pkey .
45.Fa ctx
46must be initialized with
47.Xr EVP_MD_CTX_init 3
48before calling this function.
49If
50.Fa pctx
51is not
52.Dv NULL ,
53the
54.Vt EVP_PKEY_CTX
55of the verification operation will be written to
56.Pf * Fa pctx :
57this can be used to set alternative verification options.
58.Pp
59.Fn EVP_DigestVerifyUpdate
60hashes
61.Fa cnt
62bytes of data at
63.Fa d
64into the verification context
65.Fa ctx .
66This function can be called several times on the same
67.Fa ctx
68to include additional data.
69This function is currently implemented using a macro.
70.Pp
71.Fn EVP_DigestVerifyFinal
72verifies the data in
73.Fa ctx
74against the signature in
75.Fa sig
76of length
77.Fa siglen .
78.Pp
79The EVP interface to digital signatures should almost always be
80used in preference to the low level interfaces.
81This is because the code then becomes transparent to the algorithm used
82and much more flexible.
83.Pp
84In previous versions of OpenSSL, there was a link between message digest
85types and public key algorithms.
86This meant that "clone" digests such as
87.Xr EVP_dss1 3
88needed to be used to sign using SHA1 and DSA.
89This is no longer necessary and the use of clone digest is now
90discouraged.
91.Pp
92The call to
93.Fn EVP_DigestVerifyFinal
94internally finalizes a copy of the digest context.
95This means that calls to
96.Xr EVP_VerifyUpdate 3
97and
98.Xr EVP_VerifyFinal 3
99can be called later to digest and verify additional data.
100.Pp
101Since only a copy of the digest context is ever finalized, the context
102must be cleaned up after use by calling
103.Xr EVP_MD_CTX_cleanup 3
104or a memory leak will occur.
105.Sh RETURN VALUES
106.Fn EVP_DigestVerifyInit
107and
108.Fn EVP_DigestVerifyUpdate
109return 1 for success and 0 or a negative value for failure.
110In particular a return value of -2 indicates the operation is not
111supported by the public key algorithm.
112.Pp
113Unlike other functions, the return value 0 from
114.Fn EVP_DigestVerifyFinal
115only indicates that the signature did not verify successfully.
116That is it did not match the original data or the signature was of
117invalid form.
118It is not an indication of a more serious error.
119.Pp
120The error codes can be obtained from
121.Xr ERR_get_error 3 .
122.Sh SEE ALSO
123.Xr ERR 3 ,
124.Xr evp 3 ,
125.Xr EVP_DigestInit 3 ,
126.Xr EVP_DigestSignInit 3
127.Sh HISTORY
128.Fn EVP_DigestVerifyInit ,
129.Fn EVP_DigestVerifyUpdate ,
130and
131.Fn EVP_DigestVerifyFinal
132were first added to OpenSSL 1.0.0.