mirror of
git://git.gnupg.org/gnupg.git
synced 2025-03-26 22:29:58 +01:00
g10/mainproc: disable hash contexts when --skip-verify is used
* g10/mainproc.c (proc_plaintext): Do not enable hash contexts when opt.skip_verify is set. -- Signed-off-by: Jussi Kivilinna <jussi.kivilinna@iki.fi> (cherry picked from commit 73e74de0e33bbb76300f96a4174024779047df06)
This commit is contained in:
parent
ebd434a45e
commit
6008410e51
@ -799,7 +799,10 @@ proc_plaintext( CTX c, PACKET *pkt )
|
|||||||
/* The onepass signature case. */
|
/* The onepass signature case. */
|
||||||
if (n->pkt->pkt.onepass_sig->digest_algo)
|
if (n->pkt->pkt.onepass_sig->digest_algo)
|
||||||
{
|
{
|
||||||
gcry_md_enable (c->mfx.md, n->pkt->pkt.onepass_sig->digest_algo);
|
if (!opt.skip_verify)
|
||||||
|
gcry_md_enable (c->mfx.md,
|
||||||
|
n->pkt->pkt.onepass_sig->digest_algo);
|
||||||
|
|
||||||
any = 1;
|
any = 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -817,7 +820,8 @@ proc_plaintext( CTX c, PACKET *pkt )
|
|||||||
* documents. */
|
* documents. */
|
||||||
clearsig = (*data == 0x01);
|
clearsig = (*data == 0x01);
|
||||||
for (data++, datalen--; datalen; datalen--, data++)
|
for (data++, datalen--; datalen; datalen--, data++)
|
||||||
gcry_md_enable (c->mfx.md, *data);
|
if (!opt.skip_verify)
|
||||||
|
gcry_md_enable (c->mfx.md, *data);
|
||||||
any = 1;
|
any = 1;
|
||||||
break; /* Stop here as one-pass signature packets are not
|
break; /* Stop here as one-pass signature packets are not
|
||||||
expected. */
|
expected. */
|
||||||
@ -825,7 +829,8 @@ proc_plaintext( CTX c, PACKET *pkt )
|
|||||||
else if (n->pkt->pkttype == PKT_SIGNATURE)
|
else if (n->pkt->pkttype == PKT_SIGNATURE)
|
||||||
{
|
{
|
||||||
/* The SIG+LITERAL case that PGP used to use. */
|
/* The SIG+LITERAL case that PGP used to use. */
|
||||||
gcry_md_enable ( c->mfx.md, n->pkt->pkt.signature->digest_algo );
|
if (!opt.skip_verify)
|
||||||
|
gcry_md_enable (c->mfx.md, n->pkt->pkt.signature->digest_algo);
|
||||||
any = 1;
|
any = 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user