aboutsummaryrefslogtreecommitdiffstats
path: root/tests/run-verify.c
diff options
context:
space:
mode:
Diffstat (limited to 'tests/run-verify.c')
-rw-r--r--tests/run-verify.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/tests/run-verify.c b/tests/run-verify.c
index ebc20d97..22242c00 100644
--- a/tests/run-verify.c
+++ b/tests/run-verify.c
@@ -221,6 +221,7 @@ show_usage (int ex)
" --status print status lines from the backend\n"
" --openpgp use the OpenPGP protocol (default)\n"
" --cms use the CMS protocol\n"
+ " --sender MBOX use MBOX as sender address\n"
, stderr);
exit (ex);
}
@@ -239,6 +240,7 @@ main (int argc, char **argv)
gpgme_data_t msg = NULL;
gpgme_verify_result_t result;
int print_status = 0;
+ const char *sender = NULL;
if (argc)
{ argc--; argv++; }
@@ -273,6 +275,14 @@ main (int argc, char **argv)
protocol = GPGME_PROTOCOL_CMS;
argc--; argv++;
}
+ else if (!strcmp (*argv, "--sender"))
+ {
+ argc--; argv++;
+ if (!argc)
+ show_usage (1);
+ sender = *argv;
+ argc--; argv++;
+ }
else if (!strncmp (*argv, "--", 2))
show_usage (1);
@@ -313,6 +323,12 @@ main (int argc, char **argv)
}
/* gpgme_set_ctx_flag (ctx, "raw-description", "1"); */
+ if (sender)
+ {
+ err = gpgme_set_sender (ctx, sender);
+ fail_if_err (err);
+ }
+
err = gpgme_data_new_from_stream (&sig, fp_sig);
if (err)
{