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.
This commit is contained in:
parent
73e46b3465
commit
76351c4877
@ -231,6 +231,7 @@ show_usage (int ex)
|
|||||||
" --status print status lines from the backend\n"
|
" --status print status lines from the backend\n"
|
||||||
" --openpgp use the OpenPGP protocol (default)\n"
|
" --openpgp use the OpenPGP protocol (default)\n"
|
||||||
" --cms use the CMS protocol\n"
|
" --cms use the CMS protocol\n"
|
||||||
|
" --binary assume binary signature\n"
|
||||||
" --sender MBOX use MBOX as sender address\n"
|
" --sender MBOX use MBOX as sender address\n"
|
||||||
" --repeat N repeat the operation N times\n"
|
" --repeat N repeat the operation N times\n"
|
||||||
" --auto-key-retrieve\n"
|
" --auto-key-retrieve\n"
|
||||||
@ -255,6 +256,7 @@ main (int argc, char **argv)
|
|||||||
const char *directory = NULL;
|
const char *directory = NULL;
|
||||||
int auto_key_retrieve = 0;
|
int auto_key_retrieve = 0;
|
||||||
int auto_key_import = 0;
|
int auto_key_import = 0;
|
||||||
|
gpgme_data_encoding_t encoding = GPGME_DATA_ENCODING_NONE;
|
||||||
int diagnostics = 0;
|
int diagnostics = 0;
|
||||||
int repeats = 1;
|
int repeats = 1;
|
||||||
int i;
|
int i;
|
||||||
@ -292,6 +294,11 @@ main (int argc, char **argv)
|
|||||||
protocol = GPGME_PROTOCOL_CMS;
|
protocol = GPGME_PROTOCOL_CMS;
|
||||||
argc--; argv++;
|
argc--; argv++;
|
||||||
}
|
}
|
||||||
|
else if (!strcmp (*argv, "--binary"))
|
||||||
|
{
|
||||||
|
encoding = GPGME_DATA_ENCODING_BINARY;
|
||||||
|
argc--; argv++;
|
||||||
|
}
|
||||||
else if (!strcmp (*argv, "--sender"))
|
else if (!strcmp (*argv, "--sender"))
|
||||||
{
|
{
|
||||||
argc--; argv++;
|
argc--; argv++;
|
||||||
@ -429,6 +436,7 @@ main (int argc, char **argv)
|
|||||||
gpgme_strerror (err));
|
gpgme_strerror (err));
|
||||||
exit (1);
|
exit (1);
|
||||||
}
|
}
|
||||||
|
gpgme_data_set_encoding (sig, encoding);
|
||||||
if (fp_msg)
|
if (fp_msg)
|
||||||
{
|
{
|
||||||
err = gpgme_data_new_from_stream (&msg, fp_msg);
|
err = gpgme_data_new_from_stream (&msg, fp_msg);
|
||||||
|
Loading…
Reference in New Issue
Block a user