aboutsummaryrefslogtreecommitdiffstats
path: root/tests/run-sign.c (follow)
Commit message (Collapse)AuthorAgeFilesLines
* core: Support direct signing of file with gpgIngo Klöcker2023-12-191-1/+22
| | | | | | | | | | | | | | | | | | | | | | | * src/gpgme.h.in (GPGME_SIG_MODE_FILE): New signature mode flag. * src/engine-gpg.c (gpg_sign): Separate signature mode from additional flags. Check for incompatible flags. Explicitly set output to stdout if no output file is used. Pass filename instead of fd to gpg when new flag is set. * src/engine-gpgsm.c (gpgsm_sign): Return error if new flag is set. * src/engine-uiserver.c (uiserver_sign): Ditto. * src/sign.c (sign_start): Consider new flag on check for invalid flags. * tests/run-sign.c (show_usage): New options --detach and --direct-file-io. (main): Parse new options. Create a detached signature if --detach is given. Make gpg read the input file itself if --direct-file-io is given. -- With this change the gpgme_op_sign* functions gain the possibility to make gpg read the data to sign directly from a file instead of from an input FD to which it is written by gpgme. GnuPG-bug-id: 6550
* core: Support writing the sign/encrypt output directly to a fileIngo Klöcker2023-06-191-3/+21
| | | | | | | | | | | | | | | | | | | | | | * src/engine-gpg.c (gpg_encrypt): Pass output file name to gpg if output has file name set. (gpg_encrypt_sign): Ditto. (gpg_sign): Ditto. * tests/run-encrypt.c (show_usage): New option --output. (main): Parse new option. Set file name on output if --output is given. Do not print output if --output is given. * tests/run-sign.c (show_usage): New option --output. (main): Parse new option. Set file name on output if --output is given. Do not print output if --output is given. -- This change makes it possible to tell gpg (and gpgtar) to write the output (i.e. the signed/encrypted data or the signature or the created archive) directly to a file with given file name instead of piping the output back to gpgme. GnuPG-bug-id: 6530
* core: Allow setting the base directory when creating an archiveIngo Klöcker2023-01-231-0/+16
| | | | | | | | | | | | | * src/engine-gpg.c (gpg_encrypt, gpg_encrypt_sign, gpg_sign): Pass file name set in data with --directory option to gpgtar. * tests/run-encrypt.c (show_usage): New option --directory. (main): Parse new option. Set file name of input data to option value. * tests/run-sign.c (show_usage): New option --directory. (main): Parse new option. Set file name of input data to option value. -- GnuPG-bug-id: 6342
* core: Support usage of gpgtar for creating a signed archiveIngo Klöcker2023-01-191-5/+48
| | | | | | | | | | | | | | | | | | | | | | | | | * src/gpgme.h.in (GPGME_SIG_MODE_ARCHIVE): New signature mode. * src/engine-gpg.c (append_args_from_sender, append_args_from_sig_notations): Use add_gpg_arg_with_value for gpg-only options with a value. (gpg_sign): Set use_gpgtar engine flag if GPGME_SIG_MODE_ARCHIVE mode is set. Check for new enough gpg. Use add_gpg_arg_with_value for gpg-only options with a value and add_gpg_arg for gpg-only options without a value. Set extra options for gpgtar and pass input data to stdin when using gpgtar. * src/sign.c (sign_start): Add GPGME_SIG_MODE_ARCHIVE as valid mode. * tests/run-sign.c (show_usage): New options --archive and --diagnostics. (main): Parse new options. Sign with gpgtar if --archive is given. Print stderr of gpg/gpgtar if --diagnostics is given. -- With this change the gpgme_op_sign* functions get support for creating a signed archive from files and/or directories passed as NUL-separated list in the "in" data with gpgtar. GnuPG-bug-id: 6342
* tests: Add support for clear text signatures to test runnerIngo Klöcker2022-06-141-0/+6
| | | | | | | | * tests/run-sign.c (show_usage): Add new argument "--clear". (main): Handle new argument "--clear". -- GnuPG-bug-id: 6028
* core: New context flags "include-key-block" and "auto-key-import".Werner Koch2020-03-171-0/+20
| | | | | | | | | | | | | | | | | | | | | | * src/gpgme.c (gpgme_set_ctx_flag): Add flags "include-key-block" and "auto-key-import". (gpgme_get_ctx_flag): Ditto. * src/context.h (struct gpgme_context): Add flags include_key_block and auto_key_import. * src/engine-gpg.c (struct engine_gpg): Likewise. (gpg_set_engine_flags): Set the flags for gpg versions >= 2.2.20. (gpg_decrypt): Set option according to the new flags. (gpg_encrypt): Ditto. (gpg_encrypt_sign): Ditto. (gpg_sign): Ditto. (gpg_verify): Ditto. tests/run-verify: Add option --auto-key-import. tests/run-sign: add option --include-key-block. -- GnuPG-bug-id: 4856 Signed-off-by: Werner Koch <[email protected]>
* Add SPDX identifiers to most source filesWerner Koch2018-11-161-17/+18
| | | | | | -- Signed-off-by: Werner Koch <[email protected]>
* core: Add new context flag "redraw".Werner Koch2017-01-311-0/+4
| | | | | | | | | | * src/context.h (struct gpgme_context): New field 'redraw_suggested'. * src/op-support.c (_gpgme_op_reset): Clear REDRAW_SUGGESTED. * src/progress.c (_gpgme_progress_status_handler): Set REDRAW_SUGGESTED. * src/gpgme.c (gpgme_set_ctx_flag, gpgme_get_ctx_flag): Add "redraw". * tests/run-sign.c (main): Use it. Signed-off-by: Werner Koch <[email protected]>
* doc: Replace http: by https: in core source files.Werner Koch2016-11-161-1/+1
| | | | | | -- Signed-off-by: Werner Koch <[email protected]>
* core: New API functions gpgme_set_sender, gpgme_get_sender.Werner Koch2016-10-251-0/+16
| | | | | | | | | | | | | | | | | | | | | | | * src/context.h (struct gpgme_context): Add field 'sender'. * src/gpgme.c: Include mbox-util.h. (gpgme_release): Free SENDER. (gpgme_set_sender): New. (gpgme_get_sender): New. * src/gpgme.def, src/libgpgme.vers: Add new functions. * src/engine-gpg.c (append_args_from_sender): New. (gpg_encrypt_sign, gpg_sign): Call append_args_from_sender. (gpg_verify): Add arg CTX. Call append_args_from_sender/ * src/engine-gpgsm.c (gpgsm_verify): Add dummy arg CTX. * src/engine-uiserver.c (uiserver_verify): Ditto. * src/engine.c (_gpgme_engine_op_verify): Add arg CTX. * src/verify.c (verify_start): Pass CTX to engine function. * tests/gpg/t-verify.c (main): Add some checks for new functions. * tests/run-sign.c (main): Add option --sender. * tests/run-verify.c (main): Ditto. Signed-off-by: Werner Koch <[email protected]>
* tests: Mark lots of unused vars and fix const mismatches.Werner Koch2016-09-131-0/+2
| | | | Signed-off-by: Werner Koch <[email protected]>
* tests: Allow using run-sign to test loopback pinentry problems.Werner Koch2015-08-251-0/+26
| | | | * tests/run-sign.c: Add options --status and --loopback.
* Remove all trailing whitespace from source filesWerner Koch2012-09-251-11/+11
| | | | | -- Command used: sed -i 's,[ \t]*$,,' FILE
* Prepare for a new protocol.Werner Koch2009-11-031-3/+13
| | | | | Comment clarification.
* Fix detection of invalid signer keys.Werner Koch2009-08-061-0/+187
Support the new INV_SGNR status code.