gpgme/tests
Werner Koch 6ac1f2cded
core: New flags GPGME_DECRYPT_UNWRAP and GPGME_ENCRYPT_WRAP.
* src/gpgme.h.in (GPGME_ENCRYPT_WRAP): New const.
(gpgme_decrypt_flags_t): New enum.
(GPGME_DECRYPT_VERIFY): New const
(GPGME_DECRYPT_UNWRAP): New const
(gpgme_op_decrypt_ext_start): New func.
(gpgme_op_decrypt_ext): New func.
* src/decrypt-verify.c (gpgme_op_decrypt_ext_start): New.
(gpgme_op_decrypt_ext): New.
(decrypt_verify_start): Add arg FLAGS.  Replace call to
engine_op_decrypt_verify by the plain decrypt with the flag set.
(gpgme_op_decrypt_verify_start): Pass the flag.
(gpgme_op_decrypt_verify): Pass the flag.
* src/decrypt.c (decrypt_start): Rename to ...
(_gpgme_decrypt_start): this.  Add arg FLAGS.  Pass FLAGS to
engine_op_decrypt.
(gpgme_op_decrypt_start): Adjust for chnage pass 0 for FLAG.
(gpgme_op_decrypt_start): Ditto.
* src/engine.c (_gpgme_engine_op_decrypt_verify): Remove.
(_gpgme_engine_op_decrypt): Add arg FLAGS.
* src/gpgme.def, src/libgpgme.vers: Add new functions.
* src/engine-backend.h (struct engine_ops): Remove member
'decrypt_verify'.  Add FLAGS to 'decrypt'.  Adjust all initialization.
* src/engine-uiserver.c (uiserver_decrypt): Remove.
(uiserver_decrypt_verify): Remove.
(_uiserver_decrypt): Rename to ...
(uiserver_decrypt): this.  Replace arg VERIFY by new arg FLAGS.
* src/engine-gpg.c (gpg_decrypt): Support GPGME_DECRYPT_UNWRAP.
(gpg_encrypt): Support GPGME_ENCRYPT_WRAP.

* tests/run-decrypt.c (main): New option --unwrap.
* tests/run-encrypt.c (main): New option --wrap.
--

Manual testing of that wrap/unwrap feature can be done this way:

 ./run-encrypt --verbose --key Alice /etc/motd > x
 ./run-decrypt --verbose --unwrap x > y
 ./run-encrypt --verbose --key Bob --wrap y > z

1. The message was first encrypted to Alice.
2. Alice decrypts the message receiving a valid OpenPGP message.
3. Alice encrypt that message to Bob

This will also work with encrypted and signed messages; the signature
will be kept intact during re-encryption.  Requires GnuPG 2.1.12.

Signed-off-by: Werner Koch <wk@gnupg.org>
2017-03-24 15:17:23 +01:00
..
gpg tests: Reduce iterations / threads 2017-01-30 14:19:52 +01:00
gpgsm doc: Replace http: by https: in core source files. 2016-11-16 13:27:00 +01:00
opassuan doc: Replace http: by https: in core source files. 2016-11-16 13:27:00 +01:00
.gitignore .gitignore: flesh out rules and add subdirectory-.gitignores. 2012-04-20 16:05:11 +02:00
ChangeLog-2011 move some file encodings to UTF-8 2016-09-23 16:08:33 +02:00
Makefile.am doc: Replace http: by https: in core source files. 2016-11-16 13:27:00 +01:00
run-decrypt.c core: New flags GPGME_DECRYPT_UNWRAP and GPGME_ENCRYPT_WRAP. 2017-03-24 15:17:23 +01:00
run-encrypt.c core: New flags GPGME_DECRYPT_UNWRAP and GPGME_ENCRYPT_WRAP. 2017-03-24 15:17:23 +01:00
run-export.c doc: Replace http: by https: in core source files. 2016-11-16 13:27:00 +01:00
run-genkey.c core: New API gpgme_op_set_uid_flag. 2017-03-21 19:03:58 +01:00
run-identify.c doc: Replace http: by https: in core source files. 2016-11-16 13:27:00 +01:00
run-import.c doc: Replace http: by https: in core source files. 2016-11-16 13:27:00 +01:00
run-keylist.c core: New public API gpgme_op_keylist_from_data_start. 2017-03-21 09:50:23 +01:00
run-keysign.c doc: Replace http: by https: in core source files. 2016-11-16 13:27:00 +01:00
run-sign.c core: Add new context flag "redraw". 2017-01-31 09:44:29 +01:00
run-support.h doc: Replace http: by https: in core source files. 2016-11-16 13:27:00 +01:00
run-swdb.c doc: Replace http: by https: in core source files. 2016-11-16 13:27:00 +01:00
run-tofu.c doc: Replace http: by https: in core source files. 2016-11-16 13:27:00 +01:00
run-verify.c doc: Replace http: by https: in core source files. 2016-11-16 13:27:00 +01:00
start-stop-agent tests: Fix distcheck. 2017-03-20 17:07:31 +01:00
t-data-1.txt 2001-10-16 Marcus Brinkmann <marcus@g10code.de> 2001-10-17 19:17:46 +00:00
t-data-2.txt 2001-10-16 Marcus Brinkmann <marcus@g10code.de> 2001-10-17 19:17:46 +00:00
t-data.c tests: Mark lots of unused vars and fix const mismatches. 2016-09-13 20:48:06 +02:00
t-engine-info.c core: Extend gpgme_get_dirinfo to return the gpg-wks-client name. 2017-03-21 11:16:16 +01:00
t-version.c Change the various version numbers to the new scheme. 2013-02-26 17:10:18 +01:00