aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorWerner Koch <[email protected]>2002-06-12 14:34:15 +0000
committerWerner Koch <[email protected]>2002-06-12 14:34:15 +0000
commit61c97e9fa9c939a76c6fc6be0dc4462cb62f01c5 (patch)
treee39375b5864f94c29544deb4f4ccdc74da22fdfe /tests
parentAdd Plugin configuration option to allow for sending of *opaque* signed messa... (diff)
downloadgpgme-61c97e9fa9c939a76c6fc6be0dc4462cb62f01c5.tar.gz
gpgme-61c97e9fa9c939a76c6fc6be0dc4462cb62f01c5.zip
tests/
* gpgsm/t-keylist.c (doit): Print operation info if available. gpgme/ * keylist.c (struct keylist_result_s): New. (_gpgme_release_keylist_result): Release it here (keylist_status_handler): Handle truncated. (append_xml_keylistinfo): New. * gpgme.c (_gpgme_release_result): and use it here. * types.h: Declare the new type here. * context.h (struct gpgme_context_s): Use it here.
Diffstat (limited to 'tests')
-rw-r--r--tests/ChangeLog4
-rw-r--r--tests/gpgsm/t-keylist.c13
-rw-r--r--tests/gpgsm/t-verify.c73
3 files changed, 69 insertions, 21 deletions
diff --git a/tests/ChangeLog b/tests/ChangeLog
index 5ab20b21..aea23e59 100644
--- a/tests/ChangeLog
+++ b/tests/ChangeLog
@@ -1,3 +1,7 @@
+2002-06-12 Werner Koch <[email protected]>
+
+ * gpgsm/t-keylist.c (doit): Print operation info if available.
+
2002-06-10 Werner Koch <[email protected]>
* gpgsm/t-verify.c (print_sig_stat): Print the error token.
diff --git a/tests/gpgsm/t-keylist.c b/tests/gpgsm/t-keylist.c
index 21fca7c2..bb14ee8d 100644
--- a/tests/gpgsm/t-keylist.c
+++ b/tests/gpgsm/t-keylist.c
@@ -91,6 +91,19 @@ doit ( GpgmeCtx ctx, const char *pattern )
}
if ( err != GPGME_EOF )
fail_if_err (err);
+
+ {
+ char *p;
+
+ p = gpgme_get_op_info (ctx, 0);
+ if (p)
+ {
+ fputs ("<!-- begin operation info -->\n", stdout);
+ fputs (p, stdout);
+ fputs ("<!-- end operation info -->\n", stdout);
+ free (p);
+ }
+ }
}
diff --git a/tests/gpgsm/t-verify.c b/tests/gpgsm/t-verify.c
index 9ce6678e..f65a83b6 100644
--- a/tests/gpgsm/t-verify.c
+++ b/tests/gpgsm/t-verify.c
@@ -106,29 +106,60 @@ validity_string (GpgmeValidity val)
static void
print_sig_stat ( GpgmeCtx ctx, GpgmeSigStat status )
{
- const char *s;
- time_t created;
- int idx;
- GpgmeKey key;
-
- printf ("Verification Status: %s\n", status_string (status));
+ const char *s;
+ time_t created;
+ int idx;
+ GpgmeKey key;
+
+ printf ("Verification Status: %s\n", status_string (status));
- for(idx=0; (s=gpgme_get_sig_status (ctx, idx, &status, &created)); idx++ ) {
- printf ("sig %d: created: %lu expires: %lu status: %s\n",
- idx, (unsigned long)created,
- gpgme_get_sig_ulong_attr (ctx, idx, GPGME_ATTR_EXPIRE, 0),
- status_string(status) );
- printf ("sig %d: fpr/keyid: `%s' exterr: `%s' validity: %s\n",
- idx, s,
+ for (idx=0; (s=gpgme_get_sig_status (ctx, idx, &status, &created)); idx++ )
+ {
+ unsigned long sum;
+
+ printf ("sig %d: created: %lu expires: %lu status: %s\n",
+ idx, (unsigned long)created,
+ gpgme_get_sig_ulong_attr (ctx, idx, GPGME_ATTR_EXPIRE, 0),
+ status_string(status) );
+ printf ("sig %d: fpr/keyid: `%s' exterr: `%s' validity: %s\n",
+ idx, s,
gpgme_get_sig_string_attr (ctx, idx, GPGME_ATTR_ERRTOK, 0),
- validity_string (gpgme_get_sig_ulong_attr
- (ctx, idx, GPGME_ATTR_VALIDITY, 0)) );
- if ( !gpgme_get_sig_key (ctx, idx, &key) ) {
- char *p = gpgme_key_get_as_xml ( key );
- printf ("sig %d: key object:\n%s\n", idx, p );
- free (p);
- gpgme_key_release (key);
- }
+ validity_string (gpgme_get_sig_ulong_attr
+ (ctx, idx, GPGME_ATTR_VALIDITY, 0)) );
+
+ sum = gpgme_get_sig_ulong_attr (ctx, idx, GPGME_ATTR_SIG_SUMMARY, 0);
+ fputs ("summary:", stdout);
+ if ((sum & GPGME_SIGSUM_VALID))
+ fputs (" valid", stdout);
+ if ((sum & GPGME_SIGSUM_GREEN))
+ fputs (" green", stdout);
+ if ((sum & GPGME_SIGSUM_RED))
+ fputs (" red", stdout);
+ if ((sum & GPGME_SIGSUM_KEY_REVOKED))
+ fputs (" keyRevoked", stdout);
+ if ((sum & GPGME_SIGSUM_KEY_EXPIRED))
+ fputs (" keyExpired", stdout);
+ if ((sum & GPGME_SIGSUM_SIG_EXPIRED))
+ fputs (" sigExpired", stdout);
+ if ((sum & GPGME_SIGSUM_KEY_MISSING))
+ fputs (" keyMissing", stdout);
+ if ((sum & GPGME_SIGSUM_CRL_MISSING))
+ fputs (" crlMissing", stdout);
+ if ((sum & GPGME_SIGSUM_CRL_TOO_OLD))
+ fputs (" crlTooOld", stdout);
+ if ((sum & GPGME_SIGSUM_BAD_POLICY))
+ fputs (" badPolicy", stdout);
+ if ((sum & GPGME_SIGSUM_SYS_ERROR))
+ fputs (" sysError", stdout);
+ putchar ('\n');
+
+ if ( !gpgme_get_sig_key (ctx, idx, &key) )
+ {
+ char *p = gpgme_key_get_as_xml ( key );
+ printf ("sig %d: key object:\n%s\n", idx, p );
+ free (p);
+ gpgme_key_release (key);
+ }
}
}