diff options
author | Werner Koch <[email protected]> | 2023-03-08 09:50:15 +0000 |
---|---|---|
committer | Werner Koch <[email protected]> | 2023-03-08 09:50:15 +0000 |
commit | 76351c4877d60799a35afccd87037d5dd0871262 (patch) | |
tree | 61ecd4ff7fd262c9a47a716b0b8b6fe7549c5688 /tests/run-verify.c | |
parent | qt: Add signals for file-based and data-based progress (diff) | |
download | gpgme-76351c4877d60799a35afccd87037d5dd0871262.tar.gz gpgme-76351c4877d60799a35afccd87037d5dd0871262.zip |
tests: Add option --binary to run-verify
* tests/run-verify.c (main): Set encoding.
--
gpgsm usually used autodetection of the input format. But sometimes
it is required to tell gpgsm that the input is binary encoded. In
particular, this allows to strip trailing zeroes from a detached
signature.
Diffstat (limited to '')
-rw-r--r-- | tests/run-verify.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/tests/run-verify.c b/tests/run-verify.c index 831c4614..8a400589 100644 --- a/tests/run-verify.c +++ b/tests/run-verify.c @@ -231,6 +231,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" + " --binary assume binary signature\n" " --sender MBOX use MBOX as sender address\n" " --repeat N repeat the operation N times\n" " --auto-key-retrieve\n" @@ -255,6 +256,7 @@ main (int argc, char **argv) const char *directory = NULL; int auto_key_retrieve = 0; int auto_key_import = 0; + gpgme_data_encoding_t encoding = GPGME_DATA_ENCODING_NONE; int diagnostics = 0; int repeats = 1; int i; @@ -292,6 +294,11 @@ main (int argc, char **argv) protocol = GPGME_PROTOCOL_CMS; argc--; argv++; } + else if (!strcmp (*argv, "--binary")) + { + encoding = GPGME_DATA_ENCODING_BINARY; + argc--; argv++; + } else if (!strcmp (*argv, "--sender")) { argc--; argv++; @@ -429,6 +436,7 @@ main (int argc, char **argv) gpgme_strerror (err)); exit (1); } + gpgme_data_set_encoding (sig, encoding); if (fp_msg) { err = gpgme_data_new_from_stream (&msg, fp_msg); |