diff options
author | Jussi Kivilinna <[email protected]> | 2018-12-01 11:43:10 +0000 |
---|---|---|
committer | Werner Koch <[email protected]> | 2018-12-05 07:26:09 +0000 |
commit | 6008410e512cb74a4a2ad3f6e3fce4669e4f7e2c (patch) | |
tree | a321b04d12eb9d60697e81bd056ad21e0bccd2c7 | |
parent | common/iobuf: fix memory wiping in iobuf_copy (diff) | |
download | gnupg-6008410e512cb74a4a2ad3f6e3fce4669e4f7e2c.tar.gz gnupg-6008410e512cb74a4a2ad3f6e3fce4669e4f7e2c.zip |
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 <[email protected]>
(cherry picked from commit 73e74de0e33bbb76300f96a4174024779047df06)
-rw-r--r-- | g10/mainproc.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/g10/mainproc.c b/g10/mainproc.c index f4e3db6c7..a0ec2e901 100644 --- a/g10/mainproc.c +++ b/g10/mainproc.c @@ -799,7 +799,10 @@ proc_plaintext( CTX c, PACKET *pkt ) /* The onepass signature case. */ 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; } } @@ -817,7 +820,8 @@ proc_plaintext( CTX c, PACKET *pkt ) * documents. */ clearsig = (*data == 0x01); 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; break; /* Stop here as one-pass signature packets are not expected. */ @@ -825,7 +829,8 @@ proc_plaintext( CTX c, PACKET *pkt ) else if (n->pkt->pkttype == PKT_SIGNATURE) { /* 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; } } |