Using version 1.1.1.
This commit is contained in:
@@ -34,8 +34,8 @@
|
||||
</p>
|
||||
<hr />
|
||||
<h1><a name="name">NAME</a></h1>
|
||||
<p>EVP_DigestVerifyInit_ex, EVP_DigestVerifyInit, EVP_DigestVerifyUpdate,
|
||||
EVP_DigestVerifyFinal, EVP_DigestVerify - EVP signature verification functions</p>
|
||||
<p>EVP_DigestVerifyInit, EVP_DigestVerifyUpdate, EVP_DigestVerifyFinal,
|
||||
EVP_DigestVerify - EVP signature verification functions</p>
|
||||
<p>
|
||||
</p>
|
||||
<hr />
|
||||
@@ -43,9 +43,6 @@ EVP_DigestVerifyFinal, EVP_DigestVerify - EVP signature verification functions</
|
||||
<pre>
|
||||
#include <openssl/evp.h></pre>
|
||||
<pre>
|
||||
int EVP_DigestVerifyInit_ex(EVP_MD_CTX *ctx, EVP_PKEY_CTX **pctx,
|
||||
const char *mdname, const char *props,
|
||||
EVP_PKEY *pkey, EVP_SIGNATURE *signature);
|
||||
int EVP_DigestVerifyInit(EVP_MD_CTX *ctx, EVP_PKEY_CTX **pctx,
|
||||
const EVP_MD *type, ENGINE *e, EVP_PKEY *pkey);
|
||||
int EVP_DigestVerifyUpdate(EVP_MD_CTX *ctx, const void *d, size_t cnt);
|
||||
@@ -57,89 +54,23 @@ EVP_DigestVerifyFinal, EVP_DigestVerify - EVP signature verification functions</
|
||||
</p>
|
||||
<hr />
|
||||
<h1><a name="description">DESCRIPTION</a></h1>
|
||||
<p>The EVP signature routines are a high level interface to digital signatures.
|
||||
Input data is digested first before the signature verification takes place.</p>
|
||||
<p><code>EVP_DigestVerifyInit_ex()</code> sets up verification context <strong>ctx</strong> to use a digest
|
||||
with the name <strong>mdname</strong> and public key <strong>pkey</strong>. The signature algorithm
|
||||
<strong>signature</strong> will be used for the actual signature verification which must be
|
||||
compatible with the public key. The name of the digest to be used is passed to
|
||||
the provider of the signature algorithm in use. How that provider interprets the
|
||||
digest name is provider specific. The provider may implement that digest
|
||||
directly itself or it may (optionally) choose to fetch it (which could result in
|
||||
a digest from a different provider being selected). If the provider supports
|
||||
fetching the digest then it may use the <strong>props</strong> argument for the properties to
|
||||
be used during the fetch.</p>
|
||||
<p>The <strong>signature</strong> parameter may be NULL in which case a suitable signature
|
||||
algorithm implementation will be implicitly fetched based on the type of key in
|
||||
use. See <em>provider(7)</em> for further information about providers and fetching
|
||||
algorithms.</p>
|
||||
<p>The OpenSSL default and legacy providers support fetching digests and can fetch
|
||||
those digests from any available provider. The OpenSSL fips provider also
|
||||
supports fetching digests but will only fetch digests that are themselves
|
||||
implemented inside the fips provider.</p>
|
||||
<p><strong>ctx</strong> must be created with <code>EVP_MD_CTX_new()</code> before calling this function. If
|
||||
<strong>pctx</strong> is not NULL, the EVP_PKEY_CTX of the verification operation will be
|
||||
written to <strong>*pctx</strong>: this can be used to set alternative verification options.
|
||||
Note that any existing value in <strong>*pctx</strong> is overwritten. The EVP_PKEY_CTX value
|
||||
returned must not be freed directly by the application if <strong>ctx</strong> is not assigned
|
||||
an EVP_PKEY_CTX value before being passed to <code>EVP_DigestVerifyInit_ex()</code> (which
|
||||
means the EVP_PKEY_CTX is created inside <code>EVP_DigestVerifyInit_ex()</code> and it will
|
||||
be freed automatically when the EVP_MD_CTX is freed).</p>
|
||||
<p>No <strong>EVP_PKEY_CTX</strong> will be created by <code>EVP_DigestSignInit_ex()</code> if the passed
|
||||
<strong>ctx</strong> has already been assigned one via <em>EVP_MD_CTX_set_pkey_ctx(3)</em>. See also
|
||||
<em>SM2(7)</em>.</p>
|
||||
<p>Not all digests can be used for all key types. The following combinations apply.</p>
|
||||
<dl>
|
||||
<dt><strong><a name="dsa" class="item">DSA</a></strong></dt>
|
||||
|
||||
<dd>
|
||||
<p>Supports SHA1, SHA224, SHA256, SHA384 and SHA512</p>
|
||||
</dd>
|
||||
<dt><strong><a name="ecdsa" class="item">ECDSA</a></strong></dt>
|
||||
|
||||
<dd>
|
||||
<p>Supports SHA1, SHA224, SHA256, SHA384, SHA512 and SM3</p>
|
||||
</dd>
|
||||
<dt><strong><a name="rsa_with_no_padding" class="item">RSA with no padding</a></strong></dt>
|
||||
|
||||
<dd>
|
||||
<p>Supports no digests (the digest <strong>type</strong> must be NULL)</p>
|
||||
</dd>
|
||||
<dt><strong><a name="rsa_with_x931_padding" class="item">RSA with X931 padding</a></strong></dt>
|
||||
|
||||
<dd>
|
||||
<p>Supports SHA1, SHA256, SHA384 and SHA512</p>
|
||||
</dd>
|
||||
<dt><strong><a name="all_other_rsa_padding_types" class="item">All other RSA padding types</a></strong></dt>
|
||||
|
||||
<dd>
|
||||
<p>Support SHA1, SHA224, SHA256, SHA384, SHA512, MD5, MD5_SHA1, MD2, MD4, MDC2,
|
||||
SHA3-224, SHA3-256, SHA3-384, SHA3-512</p>
|
||||
</dd>
|
||||
<dt><strong><a name="ed25519_and_ed448" class="item">Ed25519 and Ed448</a></strong></dt>
|
||||
|
||||
<dd>
|
||||
<p>Support no digests (the digest <strong>type</strong> must be NULL)</p>
|
||||
</dd>
|
||||
<dt><strong><a name="hmac" class="item">HMAC</a></strong></dt>
|
||||
|
||||
<dd>
|
||||
<p>Supports any digest</p>
|
||||
</dd>
|
||||
<dt><strong><a name="cmac_poly1305_and_siphash" class="item">CMAC, Poly1305 and SipHash</a></strong></dt>
|
||||
|
||||
<dd>
|
||||
<p>Will ignore any digest provided.</p>
|
||||
</dd>
|
||||
</dl>
|
||||
<p>If RSA-PSS is used and restrictions apply then the digest must match.</p>
|
||||
<p><code>EVP_DigestVerifyInit()</code> works in the same way as <code>EVP_DigestVerifyInit_ex()</code> except
|
||||
that the <strong>mdname</strong> parameter will be inferred from the supplied digest <strong>type</strong>,
|
||||
and <strong>props</strong> will be NULL. Where supplied the ENGINE <strong>e</strong> will be used for the
|
||||
signature verification and digest algorithm implementations. <strong>e</strong> may be NULL.</p>
|
||||
<p>The EVP signature routines are a high level interface to digital signatures.</p>
|
||||
<p><code>EVP_DigestVerifyInit()</code> sets up verification context <strong>ctx</strong> to use digest
|
||||
<strong>type</strong> from ENGINE <strong>e</strong> and public key <strong>pkey</strong>. <strong>ctx</strong> must be created
|
||||
with <code>EVP_MD_CTX_new()</code> before calling this function. If <strong>pctx</strong> is not NULL, the
|
||||
EVP_PKEY_CTX of the verification operation will be written to <strong>*pctx</strong>: this
|
||||
can be used to set alternative verification options. Note that any existing
|
||||
value in <strong>*pctx</strong> is overwritten. The EVP_PKEY_CTX value returned must not be freed
|
||||
directly by the application if <strong>ctx</strong> is not assigned an EVP_PKEY_CTX value before
|
||||
being passed to <code>EVP_DigestVerifyInit()</code> (which means the EVP_PKEY_CTX is created
|
||||
inside <code>EVP_DigestVerifyInit()</code> and it will be freed automatically when the
|
||||
EVP_MD_CTX is freed).</p>
|
||||
<p>No <strong>EVP_PKEY_CTX</strong> will be created by <code>EVP_DigestSignInit()</code> if the passed <strong>ctx</strong>
|
||||
has already been assigned one via <em>EVP_MD_CTX_set_pkey_ctx(3)</em>. See also <em>SM2(7)</em>.</p>
|
||||
<p><code>EVP_DigestVerifyUpdate()</code> hashes <strong>cnt</strong> bytes of data at <strong>d</strong> into the
|
||||
verification context <strong>ctx</strong>. This function can be called several times on the
|
||||
same <strong>ctx</strong> to include additional data.</p>
|
||||
same <strong>ctx</strong> to include additional data. This function is currently implemented
|
||||
using a macro.</p>
|
||||
<p><code>EVP_DigestVerifyFinal()</code> verifies the data in <strong>ctx</strong> against the signature in
|
||||
<strong>sig</strong> of length <strong>siglen</strong>.</p>
|
||||
<p><code>EVP_DigestVerify()</code> verifies <strong>tbslen</strong> bytes at <strong>tbs</strong> against the signature
|
||||
@@ -187,9 +118,9 @@ will occur.</p>
|
||||
<h1><a name="see_also">SEE ALSO</a></h1>
|
||||
<p><em>EVP_DigestSignInit(3)</em>,
|
||||
<em>EVP_DigestInit(3)</em>,
|
||||
<em>evp(7)</em>, <a href="#hmac">HMAC(3)</a>, <em>MD2(3)</em>,
|
||||
<em>evp(7)</em>, <em>HMAC(3)</em>, <em>MD2(3)</em>,
|
||||
<em>MD5(3)</em>, <em>MDC2(3)</em>, <em>RIPEMD160(3)</em>,
|
||||
<em>SHA1(3)</em>, <em>openssl-dgst(1)</em>,
|
||||
<em>SHA1(3)</em>, <em>dgst(1)</em>,
|
||||
<em>RAND(7)</em></p>
|
||||
<p>
|
||||
</p>
|
||||
@@ -197,15 +128,12 @@ will occur.</p>
|
||||
<h1><a name="history">HISTORY</a></h1>
|
||||
<p><code>EVP_DigestVerifyInit()</code>, <code>EVP_DigestVerifyUpdate()</code> and <code>EVP_DigestVerifyFinal()</code>
|
||||
were added in OpenSSL 1.0.0.</p>
|
||||
<p><code>EVP_DigestVerifyInit_ex()</code> was added in OpenSSL 3.0.</p>
|
||||
<p><code>EVP_DigestVerifyUpdate()</code> was converted from a macro to a function in OpenSSL
|
||||
3.0.</p>
|
||||
<p>
|
||||
</p>
|
||||
<hr />
|
||||
<h1><a name="copyright">COPYRIGHT</a></h1>
|
||||
<p>Copyright 2006-2018 The OpenSSL Project Authors. All Rights Reserved.</p>
|
||||
<p>Licensed under the Apache License 2.0 (the "License"). You may not use
|
||||
<p>Copyright 2006-2019 The OpenSSL Project Authors. All Rights Reserved.</p>
|
||||
<p>Licensed under the OpenSSL license (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
|
||||
<a href="https://www.openssl.org/source/license.html">https://www.openssl.org/source/license.html</a>.</p>
|
||||
|
||||
Reference in New Issue
Block a user