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>
This commit is contained in:
Werner Koch 2016-09-01 12:41:27 +02:00
parent 4cbd2a690c
commit 3e67b50490
No known key found for this signature in database
GPG Key ID: E3FDFF218E45B72B
1 changed files with 1 additions and 1 deletions

View File

@ -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);
}