[Pkg-gnupg-commit] [gnupg2] 38/118: gpg: Copy the correct digest for use by TOFU.

Daniel Kahn Gillmor dkg at fifthhorseman.net
Thu Sep 15 18:25:04 UTC 2016


This is an automated email from the git hooks/post-receive script.

dkg pushed a commit to branch encoding-and-speling
in repository gnupg2.

commit 3e67b50490aef087b5769bb35145d23f6657780f
Author: Werner Koch <wk at gnupg.org>
Date:   Thu Sep 1 12:41:27 2016 +0200

    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 at gnupg.org>
---
 g10/mainproc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/g10/mainproc.c b/g10/mainproc.c
index 2626189..f861a3e 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);
     }

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-gnupg/gnupg2.git



More information about the Pkg-gnupg-commit mailing list