aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorWerner Koch <[email protected]>2009-07-07 14:33:10 +0000
committerWerner Koch <[email protected]>2009-07-07 14:33:10 +0000
commitb996b0540a0d78f3a3580da7814f0d86264da511 (patch)
tree92a30f74200b6e816113262c57da188a44624d10 /tests
parentMove gpg test programs to the top test directory. (diff)
downloadgpgme-b996b0540a0d78f3a3580da7814f0d86264da511.tar.gz
gpgme-b996b0540a0d78f3a3580da7814f0d86264da511.zip
Inmplement import from keys for GPGSM.
Add option --cms to run-keylist test program.
Diffstat (limited to '')
-rw-r--r--tests/ChangeLog2
-rw-r--r--tests/run-keylist.c18
2 files changed, 18 insertions, 2 deletions
diff --git a/tests/ChangeLog b/tests/ChangeLog
index 9e68d51d..926771ab 100644
--- a/tests/ChangeLog
+++ b/tests/ChangeLog
@@ -1,5 +1,7 @@
2009-07-07 Werner Koch <[email protected]>
+ * run-keylist.c (main): Add options --cms and --openpgp.
+
* gpg/pgp-keylist.c: Rename to ...
* run-keylist.c: ... this.
* gpg/pgp-import.c: Rename to ...
diff --git a/tests/run-keylist.c b/tests/run-keylist.c
index 07fc8941..8dd28b8f 100644
--- a/tests/run-keylist.c
+++ b/tests/run-keylist.c
@@ -43,6 +43,8 @@ show_usage (int ex)
fputs ("usage: " PGM " [options] [USERID]\n\n"
"Options:\n"
" --verbose run in verbose mode\n"
+ " --openpgp use the OpenPGP protocol (default)\n"
+ " --cms use the CMS protocol\n"
" --local use GPGME_KEYLIST_MODE_LOCAL\n"
" --extern use GPGME_KEYLIST_MODE_EXTERN\n"
" --sigs use GPGME_KEYLIST_MODE_SIGS\n"
@@ -54,6 +56,7 @@ show_usage (int ex)
exit (ex);
}
+
int
main (int argc, char **argv)
{
@@ -66,6 +69,7 @@ main (int argc, char **argv)
int import = 0;
gpgme_key_t keyarray[100];
int keyidx = 0;
+ gpgme_protocol_t protocol = GPGME_PROTOCOL_OpenPGP;
if (argc)
{ argc--; argv++; }
@@ -85,6 +89,16 @@ main (int argc, char **argv)
verbose = 1;
argc--; argv++;
}
+ else if (!strcmp (*argv, "--openpgp"))
+ {
+ protocol = GPGME_PROTOCOL_OpenPGP;
+ argc--; argv++;
+ }
+ else if (!strcmp (*argv, "--cms"))
+ {
+ protocol = GPGME_PROTOCOL_CMS;
+ argc--; argv++;
+ }
else if (!strcmp (*argv, "--local"))
{
mode |= GPGME_KEYLIST_MODE_LOCAL;
@@ -128,11 +142,11 @@ main (int argc, char **argv)
if (argc > 1)
show_usage (1);
- init_gpgme (GPGME_PROTOCOL_OpenPGP);
+ init_gpgme (protocol);
err = gpgme_new (&ctx);
fail_if_err (err);
- gpgme_set_protocol (ctx, GPGME_PROTOCOL_OpenPGP);
+ gpgme_set_protocol (ctx, protocol);
gpgme_set_keylist_mode (ctx, mode);