[Pkg-gnupg-commit] [gnupg2] 82/118: g10: Make sure some functions are passed a primary key.

Daniel Kahn Gillmor dkg at fifthhorseman.net
Thu Sep 15 18:25:13 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 13ddc17ddb266d74033d5739fec932034fa85c72
Author: Neal H. Walfield <neal at g10code.com>
Date:   Tue Sep 6 22:40:59 2016 +0200

    g10: Make sure some functions are passed a primary key.
    
    * g10/tofu.c (get_trust): Make sure the caller provides a primary key.
    (tofu_register_signature): Likewise.
    
    --
    Signed-off-by: Neal H. Walfield <neal at g10code.com>
---
 g10/tofu.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/g10/tofu.c b/g10/tofu.c
index 0fda536..9e07d21 100644
--- a/g10/tofu.c
+++ b/g10/tofu.c
@@ -2011,6 +2011,8 @@ get_trust (ctrl_t ctrl, PKT_public_key *pk,
   if (opt.batch)
     may_ask = 0;
 
+  log_assert (keyid_cmp (pk_keyid (pk), pk->main_keyid) == 0);
+
   /* Make sure _tofu_GET_TRUST_ERROR isn't equal to any of the trust
      levels.  */
   log_assert (_tofu_GET_TRUST_ERROR != TRUST_UNKNOWN
@@ -2778,6 +2780,8 @@ tofu_register_signature (ctrl_t ctrl,
   if (rc)
     return rc;
 
+  log_assert (keyid_cmp (pk_keyid (pk), pk->main_keyid) == 0);
+
   sig_digest = make_radix64_string (sig_digest_bin, sig_digest_bin_len);
   fingerprint = hexfingerprint (pk, NULL, 0);
 

-- 
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