aboutsummaryrefslogtreecommitdiffstats
path: root/tests/run-verify.c
diff options
context:
space:
mode:
authorWerner Koch <[email protected]>2016-08-23 13:22:28 +0000
committerWerner Koch <[email protected]>2016-08-23 13:24:10 +0000
commitbe4ff75d7d5ac6ed15feb245ef3cec59b4bad561 (patch)
tree67dffdf32235e3e459aa52cd1b248420a6dc480f /tests/run-verify.c
parentcore: Extend gpgme_user_id_t with 'address'. (diff)
downloadgpgme-be4ff75d7d5ac6ed15feb245ef3cec59b4bad561.tar.gz
gpgme-be4ff75d7d5ac6ed15feb245ef3cec59b4bad561.zip
core: Change the way TOFU information are represented.
* src/gpgme.h.in (struct _gpgme_signature): Remove field 'tofu'. Add field 'key'. (struct _gpgme_key): Add field 'fpr'. (struct _gpgme_user_id): Add field 'tofu'. (struct _gpgme_tofu_info): Remove fields 'address' and 'fpr'. * src/key.c (gpgme_key_unref): Release TOFU and FPR. * src/keylist.c (keylist_colon_handler): Store the fingerprint of the first subkey also in KEY. * src/verify.c (release_tofu_info): Remove. (release_op_data): Release KEY. (parse_tofu_user): Rewrite for new data structure. (parse_tofu_stats): Ditto. (parse_tofu_stats_long): Ditto. * tests/run-verify.c (print_result): Ditto. * tests/run-keylist.c (main): Print more fields. -- TOFU information are now associated with the user ID and not with a separate object. Note that this breaks code relying on the former non-released TOFU feature. The C++ bindings won't work right now. Signed-off-by: Werner Koch <[email protected]>
Diffstat (limited to 'tests/run-verify.c')
-rw-r--r--tests/run-verify.c50
1 files changed, 28 insertions, 22 deletions
diff --git a/tests/run-verify.c b/tests/run-verify.c
index b1745163..ef4dd32e 100644
--- a/tests/run-verify.c
+++ b/tests/run-verify.c
@@ -111,6 +111,7 @@ print_result (gpgme_verify_result_t result)
{
gpgme_signature_t sig;
gpgme_sig_notation_t nt;
+ gpgme_user_id_t uid;
gpgme_tofu_info_t ti;
int count = 0;
@@ -153,29 +154,34 @@ print_result (gpgme_verify_result_t result)
if ((nt->value?strlen (nt->value):0) != nt->value_len)
printf (" warning : value larger (%d)\n", nt->value_len);
}
- for (ti = sig->tofu; ti; ti = ti->next)
+ if (sig->key)
{
- printf (" tofu addr .: %s\n", ti->address);
- if (!sig->fpr || strcmp (sig->fpr, ti->fpr))
- printf (" WARNING .: fpr mismatch (%s)\n", ti->fpr);
- printf (" validity : %u (%s)\n", ti->validity,
- ti->validity == 0? "conflict" :
- ti->validity == 1? "no history" :
- ti->validity == 2? "little history" :
- ti->validity == 3? "enough history" :
- ti->validity == 4? "lot of history" : "?");
- printf (" policy ..: %u (%s)\n", ti->policy,
- ti->policy == GPGME_TOFU_POLICY_NONE? "none" :
- ti->policy == GPGME_TOFU_POLICY_AUTO? "auto" :
- ti->policy == GPGME_TOFU_POLICY_GOOD? "good" :
- ti->policy == GPGME_TOFU_POLICY_UNKNOWN? "unknown" :
- ti->policy == GPGME_TOFU_POLICY_BAD? "bad" :
- ti->policy == GPGME_TOFU_POLICY_ASK? "ask" : "?");
- printf (" sigcount : %hu\n", ti->signcount);
- printf (" firstseen: %u\n", ti->firstseen);
- printf (" lastseen : %u\n", ti->lastseen);
- printf (" desc ....: ");
- print_description (nonnull (ti->description), 15);
+ printf (" primary fpr: %s\n", nonnull (sig->key->fpr));
+ for (uid = sig->key->uids; uid; uid = uid->next)
+ {
+ printf (" tofu addr .: %s\n", nonnull (uid->address));
+ ti = uid->tofu;
+ if (!ti)
+ continue;
+ printf (" validity : %u (%s)\n", ti->validity,
+ ti->validity == 0? "conflict" :
+ ti->validity == 1? "no history" :
+ ti->validity == 2? "little history" :
+ ti->validity == 3? "enough history" :
+ ti->validity == 4? "lot of history" : "?");
+ printf (" policy ..: %u (%s)\n", ti->policy,
+ ti->policy == GPGME_TOFU_POLICY_NONE? "none" :
+ ti->policy == GPGME_TOFU_POLICY_AUTO? "auto" :
+ ti->policy == GPGME_TOFU_POLICY_GOOD? "good" :
+ ti->policy == GPGME_TOFU_POLICY_UNKNOWN? "unknown" :
+ ti->policy == GPGME_TOFU_POLICY_BAD? "bad" :
+ ti->policy == GPGME_TOFU_POLICY_ASK? "ask" : "?");
+ printf (" sigcount : %hu\n", ti->signcount);
+ printf (" firstseen: %u\n", ti->firstseen);
+ printf (" lastseen : %u\n", ti->lastseen);
+ printf (" desc ....: ");
+ print_description (nonnull (ti->description), 15);
+ }
}
}
}