aboutsummaryrefslogtreecommitdiffstats
path: root/g10/keyedit.c
diff options
context:
space:
mode:
authorNeal H. Walfield <[email protected]>2016-02-19 14:13:22 +0000
committerNeal H. Walfield <[email protected]>2016-02-19 15:13:03 +0000
commit5fbd80579aea0f75ca1d2700515c5b8747a75c7d (patch)
tree938be93644304c5a8dd2377f23ea19c3c7aa82c5 /g10/keyedit.c
parentgpg: Split the function check_signature_end. (diff)
downloadgnupg-5fbd80579aea0f75ca1d2700515c5b8747a75c7d.tar.gz
gnupg-5fbd80579aea0f75ca1d2700515c5b8747a75c7d.zip
gpg: Split print_and_check_one_sig.
* g10/keyedit.c (print_and_check_one_sig): Split the print functionality into... (print_one_sig): ... this new function. -- Signed-off-by: Neal H. Walfield <[email protected]>
Diffstat (limited to 'g10/keyedit.c')
-rw-r--r--g10/keyedit.c31
1 files changed, 20 insertions, 11 deletions
diff --git a/g10/keyedit.c b/g10/keyedit.c
index f2ef6134e..8cec66adb 100644
--- a/g10/keyedit.c
+++ b/g10/keyedit.c
@@ -1,7 +1,7 @@
/* keyedit.c - Edit properties of a key
* Copyright (C) 1998-2010 Free Software Foundation, Inc.
* Copyright (C) 1998-2015 Werner Koch
- * Copyright (C) 2015 g10 Code GmbH
+ * Copyright (C) 2015, 2016 g10 Code GmbH
*
* This file is part of GnuPG.
*
@@ -189,24 +189,23 @@ print_and_check_one_sig_colon (KBNODE keyblock, KBNODE node,
/*
- * Print information about a signature, check it and return true if
- * the signature is okay. NODE must be a signature packet. With
- * EXTENDED set all possible signature list options will always be
- * printed.
+ * Print information about a signature (rc is its status), check it
+ * and return true if the signature is okay. NODE must be a signature
+ * packet. With EXTENDED set all possible signature list options will
+ * always be printed.
*/
static int
-print_and_check_one_sig (KBNODE keyblock, KBNODE node,
- int *inv_sigs, int *no_key, int *oth_err,
- int *is_selfsig, int print_without_key, int extended)
+print_one_sig (int rc, KBNODE keyblock, KBNODE node,
+ int *inv_sigs, int *no_key, int *oth_err,
+ int is_selfsig, int print_without_key, int extended)
{
PKT_signature *sig = node->pkt->pkt.signature;
- int rc, sigrc;
+ int sigrc;
int is_rev = sig->sig_class == 0x30;
/* TODO: Make sure a cached sig record here still has the pk that
issued it. See also keylist.c:list_keyblock_print */
- rc = check_key_signature (keyblock, node, is_selfsig);
switch (gpg_err_code (rc))
{
case 0:
@@ -257,7 +256,7 @@ print_and_check_one_sig (KBNODE keyblock, KBNODE node,
tty_printf ("[%s] ", gpg_strerror (rc));
else if (sigrc == '?')
;
- else if (*is_selfsig)
+ else if (is_selfsig)
{
tty_printf (is_rev ? _("[revocation]") : _("[self-signature]"));
if (extended && sig->flags.chosen_selfsig)
@@ -311,6 +310,16 @@ print_and_check_one_sig (KBNODE keyblock, KBNODE node,
return (sigrc == '!');
}
+static int
+print_and_check_one_sig (KBNODE keyblock, KBNODE node,
+ int *inv_sigs, int *no_key, int *oth_err,
+ int *is_selfsig, int print_without_key, int extended)
+{
+ return print_one_sig (check_key_signature (keyblock, node, is_selfsig),
+ keyblock, node, inv_sigs, no_key, oth_err,
+ *is_selfsig, print_without_key, extended);
+}
+
/*