diff options
author | Werner Koch <wk@gnupg.org> | 2016-09-01 12:41:27 +0200 |
---|---|---|
committer | Werner Koch <wk@gnupg.org> | 2016-09-01 12:52:21 +0200 |
commit | 3e67b50490aef087b5769bb35145d23f6657780f (patch) | |
tree | 2e8c399ec620e0d0bc41a39fdbe8d9078ce66c2c /g10/mainproc.c | |
parent | g10: Be careful to not be in a transaction during long operations (diff) | |
download | gnupg2-3e67b50490aef087b5769bb35145d23f6657780f.tar.xz gnupg2-3e67b50490aef087b5769bb35145d23f6657780f.zip |
gpg: Copy the correct digest for use by TOFU.
* g10/mainproc.c (do_check_sig): Use the current digest algo.
--
Note that the digest context may have several algos enabled, which is
is case if keys with different hash preferences signed the data.
Signed-off-by: Werner Koch <wk@gnupg.org>
Diffstat (limited to '')
-rw-r--r-- | g10/mainproc.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/g10/mainproc.c b/g10/mainproc.c index 2626189a7..f861a3ea2 100644 --- a/g10/mainproc.c +++ b/g10/mainproc.c @@ -938,7 +938,7 @@ do_check_sig (CTX c, kbnode_t node, int *is_selfsig, if (md_good) { - unsigned char *buffer = gcry_md_read (md_good, 0); + unsigned char *buffer = gcry_md_read (md_good, sig->digest_algo); sig->digest_len = gcry_md_get_algo_dlen (map_md_openpgp_to_gcry (algo)); memcpy (sig->digest, buffer, sig->digest_len); } |