Commit Graph

442 Commits

Author SHA1 Message Date
Werner Koch
fab8b1a166
core: New encryption flag GPGME_ENCRYPT_THROW_KEYIDS.
* src/gpgme.h.in (GPGME_ENCRYPT_THROW_KEYIDS): New flag.
* src/engine-gpg.c (gpg_encrypt): Implement flag
(gpg_encrypt_sign): Implement flag.

* tests/run-encrypt.c (main): New option --throw-keyids.
--

It would be nice to also selectively hide recipients (that is gpg
--hidden-recipient) but our API does not ye allow this because it is
based on key objects.  A possible way to implement that would be a API
to set processing flags into a key but this is complicated due to the
reference counting and thus the possibility that a key object is used
by different context.

Signed-off-by: Werner Koch <wk@gnupg.org>
2017-03-21 10:39:33 +01:00
Andre Heinecke
35023f3136
core: New public API gpgme_op_keylist_from_data_start.
* src/gpgme.h.in: New API gpgme_op_keylist_from_data_start.
* src/libgpgme.vers, src/gpgme.def: Add it.
* src/keylist.c (gpgme_op_keylist_from_data_start): New.
* src/engine-backend.h (engine_ops): Add field 'keylist_data'.  Change
all engines to pass NULL for it.
* src/engine.c (_gpgme_engine_op_keylist_data): New.
* src/engine-gpg.c (gpg_keylist_data): New.
(_gpgme_engine_ops_gpg): Register gpg_keylist_data.

* tests/run-keylist.c (main): New option --from-file.
--

Co-authored-by: Werner Koch <wk@gnupg.org>
GnuPG-bug-id: 2819
2017-03-21 09:50:23 +01:00
Werner Koch
ea9686ec71
core,cpp: New key flag 'is_de_vs'.
* src/gpgme.h.in (_gpgme_subkey): New flag is_de_vs.
* tests/run-keylist.c (main): Print that flag.
* src/keylist.c (parse_pub_field18): New.
(keylist_colon_handler): Parse compliance flags.
* lang/cpp/src/key.cpp (Key::isDeVs): New.
(Subkey::isDeVs): New.

* lang/cpp/src/key.h (class Key): New method isDeVs.
(class Subkey): New method isDeVs.

Signed-off-by: Werner Koch <wk@gnupg.org>
2017-03-20 20:05:16 +01:00
Justus Winter
392e51dd11
tests: Fix distcheck.
* tests/start-stop-agent: Do not create 'gpg-agent.conf' if it does
not exist.

Fixes-commit: 16b202d999
Signed-off-by: Justus Winter <justus@g10code.com>
2017-03-20 17:07:31 +01:00
Justus Winter
16b202d999
tests: Use 'gpg-agent --allow-loopback-pinentry' if applicable.
* lang/python/tests/Makefile.am (gpg-agent.conf): Do not hard-code the
option.  This breaks gpg-agent from GnuPG 2.0.
* tests/start-stop-agent: Rather, check if the option is supported and
add it to the configuration if it is.

GnuPG-bug-id: 3008
Fixes-commit: bbf19124bb
Signed-off-by: Justus Winter <justus@g10code.com>
2017-03-20 16:41:43 +01:00
Werner Koch
752d3597ef
core: Add new context flag "redraw".
* 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 <wk@gnupg.org>
2017-01-31 09:44:29 +01:00
Andre Heinecke
7bd6ab4a91 tests: Reduce iterations / threads
* tests/gpg/t-gpgconf.c (main): Reduce iterations to 10.
* tests/gpg/t-thread-keylist-verify.c,
tests/gpg/t-thread-keylist.c (THREAD_COUNT): Reduce to 10.

--
While these tests tested for race conditions a smaller number
of iteration should still show problems if they are run on
multiple systems and regulary. While the 100 Thread count in
the t-thread tests could lead to resource problems.
2017-01-30 14:19:52 +01:00
Andre Heinecke
a98951a30a tests: Use --debug-quick-random for tests
* tests/start-stop-agent: Don't autostart agent on --stop and
running check. Use --debug-quick-random when starting.

--
This should speed up the tests especially on low entropy systems.
Possibly fixing a hang on pythons op_genkey test in the Launchpad
build enviorment (see launchpad issue 1655298)
2017-01-25 14:10:18 +01:00
Andre Heinecke
ca69df8c8d tests: Add safeguards against nullptr deref
* t-gpgconf.c (main): Test some values before dereferencing them.
2017-01-17 15:20:56 +01:00
Justus Winter
92543da94c tests: Fix distcheck.
* tests/gpg/Makefile.am (CLEANFILES): Remove gpgconf backups.

Fixes-commit: ea7bb62f5d
Signed-off-by: Justus Winter <justus@g10code.com>
2017-01-16 13:21:02 +01:00
Justus Winter
186dcd3494 tests: Improve the gpgconf test.
* tests/gpg/t-gpgconf.c: Include support functions.
(fail_if_err): Remove macro.
(init_gpgme): Remove function.
(lookup): New function.
(main): Update some values and verify that the changes are applied.
* tests/gpg/t-support.h (test): New assert-like macro.

GnuPG-bug-id: 2881
Signed-off-by: Justus Winter <justus@g10code.com>
2017-01-12 14:18:15 +01:00
Justus Winter
ea7bb62f5d tests: Enable gpgconf test.
--
Fixes: 02ba35c1b6
Signed-off-by: Justus Winter <justus@g10code.com>
2017-01-12 14:06:27 +01:00
Justus Winter
9b22f82afc tests: Remove tofu.db.
* lang/python/Makefile.am (CLEANFILES): Add 'tofu.db'.
* tests/gpg/Makefile.am (CLEANFILES): Likewise.

Signed-off-by: Justus Winter <justus@g10code.com>
2016-11-25 09:13:01 +01:00
Werner Koch
7f5f26fd66
doc: Replace http: by https: in core source files.
--

Signed-off-by: Werner Koch <wk@gnupg.org>
2016-11-16 13:27:00 +01:00
Werner Koch
9fc92a15bd
core: Do not leak the override session key to ps(1).
* src/engine-gpg.c (struct engine_gpg): New field
override_session_key.
(gpg_release): Free that field.
(gpg_decrypt): With gnupg 2.1.16 use --override-session-key-fd.

* tests/run-decrypt.c (main): Fix setting over the override key.
--

Note that this works only with gnupg 2.1.16 and later.

Signed-off-by: Werner Koch <wk@gnupg.org>
2016-11-16 10:15:31 +01:00
Daniel Kahn Gillmor
5730647421
doc,tests: Require use of ctx_flag before use of session_key.
* doc/gpgme.texi: Document requirements of verifying that it is OK to
use session_key.
* tests/run-decrypt.c: Ensure that we fail if we're unable to access
the session key, so that we do not violate the guidance above.

Signed-off-by: Daniel Kahn Gillmor <dkg@fifthhorseman.net>

Changed the description

 -@code{gpgme_set_ctx_flag (ctx, "export-session-key")} returns
 -@code{GPG_ERR_NO_ERROR} or @code{gpgme_get_ctx_flag (ctx,
 -"export-session-key")} returns @code{"1"}.
 +@code{gpgme_set_ctx_flag (ctx, "export-session-key")} returns success
 +or @code{gpgme_get_ctx_flag (ctx, "export-session-key")} returns true
 +(non-empty string).

to get gpgme_get_ctx_flag for boolean values in sync with its own
description.

Note that I don't agree with the above suggestion but it does not
really harm to have it in the man page.

Signed-off-by: Werner Koch <wk@gnupg.org>
2016-11-16 10:15:31 +01:00
Werner Koch
7659d42468
core: Implement context flag "override-session-key".
* src/gpgme.c (gpgme_set_ctx_flag): Add flags "export-session-key" and
"override-session-key".
(gpgme_get_ctx_flag): Ditto.
(gpgme_set_export_session_keys): Remove.
(gpgme_get_export_session_keys): Remove.
* src/gpgme.def, src/libgpgme.vers: Remove them.
* src/context.h (struct gpgme_context): Add field
override_session_key.
* src/decrypt-verify.c (decrypt_verify_start): Pass
override_session_key value to the engine.
* src/decrypt.c (decrypt_start): Ditto.
* src/engine.c (_gpgme_engine_op_decrypt): Ditto.
(_gpgme_engine_op_decrypt_verify): Ditto.
* src/engine-backend.h (struct engine_ops): Extend DECRYPT and
DECRYPT_VERIFY_START with override_session_key.
* src/engine-uiserver.c (_uiserver_decrypt): Add stub arg
override_session_key.
(uiserver_decrypt): Ditto.
(uiserver_decrypt_verify): Ditto.
* src/engine-gpgsm.c (gpgsm_decrypt): Ditto.
* src/engine-gpg.c (gpg_decrypt): Add arg override_session_key and set
corresponding gpg option.

* tests/run-decrypt.c (print_result): Print the session key if
available.
(main): Add options --export-session-key and --override-session-key.

--

To keep the number of context manipulation functions at bay, this
patches removes the just added gpgme_set_export_session_keys and
gpgme_get_export_session_keys by flags for the generic context
function.

The patch also implements the --override-session-key feature.

GnuPG-bug-id: 2754
Signed-off-by: Werner Koch <wk@gnupg.org>
2016-11-15 10:34:13 +01:00
Werner Koch
3234b1bf1d
core: Add public function gpgme_get_ctx_flag.
* src/gpgme.h.in (gpgme_get_ctx_flag): New.
* src/gpgme.c (gpgme_set_ctx_flag): Move down the file and add a trace
statement.
(gpgme_get_ctx_flag): New.
* src/gpgme.def, src/libgpgme.vers: Add new interface.

Signed-off-by: Werner Koch <wk@gnupg.org>
2016-11-15 09:24:17 +01:00
Alon Bar-Lev
41d8c7e51a
tests,python: Atomic directory creation
* lang/python/tests/Makefile.am:  Use MIDIR_P.
* tests/gpg/Makefile.am: Ditto.
* tests/gpgsm/Makefile.am: Ditto.

--
Solves race in parallel build when mkdir fails if directory exists.

Signed-off-by: Alon Bar-Lev <alon.barlev@gmail.com>

- Tweaked the ChangeLog

Signed-off-by: Werner Koch <wk@gnupg.org>
2016-11-11 09:09:40 +01:00
Andre Heinecke
ddd0a3cf90 tests: Reduce thread count in new thread tests
* gpg/t-thread-keylist-verify.c,
gpg/t-thread-keylist.c: Reduce threads to 100

--
Due to the limit of FD_SETSIZE the
number of parallel threads is limited. So some systems
run into this problem when running the testsuite.
2016-11-10 18:35:09 +01:00
Andre Heinecke
d0030efb45 tests: Fix additional memleaks in thread tests
* tests/gpg/t-thread-keylist-verify.c (start_verify): Release
data.
(start_keylist): Unref keys.
* tests/gpg/t-thread-keylist.c (start_keylist): Unref keys.
2016-11-10 15:04:17 +01:00
Andre Heinecke
4d5174e4a8 tests: Improve new thread tests
* tests/gpg/t-thread-keylist-verify.c (start_keylist): Mark
arg as unused. Release context.
(start_verify): Ditto.
(main): Mark args as unused.
* tests/gpg/t-thread-keylist.c (start_keylist):  Mark
arg as unused. Release context.
(main): Mark args as unused.
2016-11-10 14:14:54 +01:00
Andre Heinecke
09b6455432 core: Use gpgrt locking for thread safeness
* configure.ac: Require libgpg-error 1.17. No longer
check for pthread.
* doc/gpgme.texi: Document removed neccessity for thread
safe gpgme flavours.
* src/sema.h (DEFINE_GLOBAL_LOCK),
(DEFINE_STATIC_LOCK, INIT_LOCK, DECLARE_LOCK)
(DESTROY_LOCK, LOCK, UNLOCK): Change to gpgrt equivalents.
* src/posix-sema.c, src/w32-sema.c: Removed.
* src/Makefile.am: Remove libpthread and
Update accordingly.
* src/ath.c, src/ath.h (ath_mutex_init)
(ath_mutex_destroy, ath_mutex_lock, ath_mutex_unlock): Removed.
* src/ath.h (ATH_MUTEX_INITIALIZER): Removed.
* src/version.c (do_subsystem_inits): sema_subsystem_init is
no longer required.
* tests/gpg/Makefile.am: Add new threading tests.
(t_thread1_LDADD, t_cancel_LDADD):
Use just gpgme.
* tests/gpg/t-thread-keylist-verify.c,
tests/gpg/t-thread-keylist.c: New.
* src/gpgme-config.in: Use -lgpgme for thread-model pthread.

--
Using gpgrt locks instead of pthread locks removes
the neccessity to link pthread directly to gpgme and
have a different, thread safe flavor of gpgme. Now
gpgme is thread-safe if the conditions mentioned
in the doc are met.

As the cpp bindings linked against libgpgme
and not libgpgme-pthread this fixes threading problems
with them.

libgpgme-pthread is removed but gpgme-config still supports
--thread=pthread for compatibility with find scripts.
2016-11-10 13:33:13 +01:00
Werner Koch
aad94cb7c3
core: Add gpgme_op_query_swdb and helper.
* src/gpgme.h.in (gpgme_query_swdb_result_t): New.
(gpgme_op_query_swdb): New.
(gpgme_op_query_swdb_result): New.
* src/libgpgme.vers, src/gpgme.def: Add the two new functions.
* src/queryswdb.c: New.
* src/Makefile.am (main_sources): Add new file.
* src/context.h (OPDATA_QUERY_SWDB): New.
* src/engine-backend.h (struct engine_ops): Add field 'query_swdb'.
Adjust all initializer.
* src/engine.c (_gpgme_engine_op_query_swdb): New.
* src/engine-gpgconf.c (parse_swdb_line): New.
(gpgconf_query_swdb): New.
(_gpgme_engine_ops_gpgconf): Register that function.

* src/util.h (GPG_ERR_TOO_OLD): Define for older libgpg-error.
(GPG_ERR_ENGINE_TOO_OLD): Ditto.

* tests/run-swdb.c: New.
* tests/Makefile.am (noinst_PROGRAMS): Add new debug tool.

Signed-off-by: Werner Koch <wk@gnupg.org>
2016-11-03 17:32:30 +01:00
Werner Koch
b8159eadb5
core: New API functions gpgme_set_sender, gpgme_get_sender.
* 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 <wk@gnupg.org>
2016-10-25 17:28:01 +02:00
Werner Koch
05e8e1260b
tests: Make t-cancel more portable.
* tests/gpg/t-cancel.c: Include sys/time.h and protect sys/select.h.

Signed-off-by: Werner Koch <wk@gnupg.org>
2016-10-14 16:32:59 +02:00
Justus Winter
857592041b Add missing includes.
* lang/cpp/src/key.cpp: Include <strings.h> for 'strcasecmp'.
* tests/gpg/t-cancel.c: Include <sys/select.h> for 'fd_set' and
friends.

Signed-off-by: Justus Winter <justus@g10code.com>
2016-10-06 13:12:52 +02:00
Justus Winter
a6e9eefb23 tests: Fix blunder.
--
Fixes-commit: a423603f
Signed-off-by: Justus Winter <justus@g10code.com>
2016-09-27 12:49:24 +02:00
Justus Winter
a423603f80 tests: Fix check for gpg versions not reporting the critical flag.
* lang/python/tests/t-sig-notation.py: Also blacklist 2.0.x.
* tests/gpg/t-sig-notation.c: Likewise.

Signed-off-by: Justus Winter <justus@g10code.com>
2016-09-27 12:31:18 +02:00
Daniel Kahn Gillmor
a11450eb04 move some file encodings to UTF-8
* THANKS, doc/ChangeLog-2011, tests/ChangeLog-2011,
  tests/gpg/geheim.txt: convert from iso 8859-1 to utf-8.
* lang/qt/src/dataprovider.cpp, lang/qt/src/qgpgmerefreshkeysjob.cpp,
  lang/qt/src/qgpgmesecretkeyexportjob.cpp: replace U+FFFD REPLACEMENT
  CHARACTER with proper U+00E4 LATIN SMALL LETTER A WITH DIAERESIS.

--
Note that src/versioninfo.rc.in is still ISO-8859-1.  I don't know
whether Windows will properly handle UTF-8 in this file or not, so i
have not touched it.

Signed-off-by: Daniel Kahn Gillmor <dkg@fifthhorseman.net>
2016-09-23 16:08:33 +02:00
Andre Heinecke
9b38817968 tests: Check data after decryption
* tests/gpgsm/t-decrypt.c (main): Check data matches expected.
Only print result if it does not.
2016-09-23 16:04:33 +02:00
Daiki Ueno
7a6543c2df
tests: Add test for cancellation
* tests/gpg/t-cancel.c: New file.
* tests/gpg/Makefile.am (tests_skipped): New variable, default to
t-genkey and t-cancel.
(noinst_PROGRAMS): Add $(tests_skipped).
* tests/gpg/.gitignore: Add t-cancel.

Signed-off-by: Daiki Ueno <ueno@gnu.org>
2016-09-22 09:12:43 +02:00
Daiki Ueno
d0cf6b1512
tests: Fix select usage in t-eventloop
* tests/gpg/t-eventloop.c (do_select): Supply timeout value to select.

Signed-off-by: Daiki Ueno <ueno@gnu.org>
2016-09-22 09:12:43 +02:00
Werner Koch
bfb6890ded
tests: Use --batch for gpg import.
* lang/python/tests/Makefile.am (./pubring-stamp): Use --batch with
GPG to avoid Pinentries during import when using GnuPG >= 2.1.
Replace touch by echo.
* tests/gpg/Makefile.am (./pubring-stamp): Ditto.

Signed-off-by: Werner Koch <wk@gnupg.org>
2016-09-20 19:51:02 +02:00
Werner Koch
ed1f2700a7
core: New function gpgme_op_interact, deprecate gpgme_op_edit.
* src/gpgme.h.in (gpgme_interact_cb_t): New.
(GPGME_INTERACT_CARD): New.
(gpgme_op_interact_start, gpgme_op_interact): New.
* src/libgpgme.vers, src/gpgme.def: Add new functions.
* src/edit.c (op_data_t): Rename fnc to fnc_old and change users.  Add
fnc.
(edit_status_handler): Call old or new callback.
(command_handler): Ditto.
(interact_start): New.
(gpgme_op_interact_start, gpgme_op_interact_start): New.
* src/status-table.c (_gpgme_status_to_string): New.

* tests/gpg/t-edit.c (edit_fnc): Rename to interact_fnc and change
type of STATUS.  Use gpgme_io_writen.
(main): s/gpgme_op_edit/gpgme_op_interact/.
--

This change will eventually allow us to remove all those status codes
from gpgme.h.

Signed-off-by: Werner Koch <wk@gnupg.org>
2016-09-15 11:39:43 +02:00
Werner Koch
7c37719d79
core: New function gpgme_op_tofu_policy
* src/gpgme.h.in (gpgme_op_tofu_policy_start): New function.
(gpgme_op_tofu_policy): New function.
* src/libgpgme.vers, src/gpgme.def: Add new functions.
* src/tofupolicy.c: New.
* src/Makefile.am (main_sources): Add that file.
* src/context.h (ctx_op_data_id_t): Add OPDATA_TOFU_POLICY.
* src/engine.c (_gpgme_engine_op_tofu_policy): New.
* src/engine-backend.h (engine_ops): Add funcptr 'tofu_policy'.
Adjust all engine initializations.
* src/engine-gpg.c (gpg_tofu_policy): New.
(_gpgme_engine_ops_gpg): Register this function.

* tests/run-tofu.c: New.
* tests/Makefile.am (noinst_PROGRAMS): Add it.

Signed-off-by: Werner Koch <wk@gnupg.org>
2016-09-14 20:21:19 +02:00
Werner Koch
bfd2bd0ccc
core: New function gpgme_op_keysign.
* src/gpgme.h.in (gpgme_op_keysign_start, gpgme_op_keysign): New.
(GPGME_KEYSIGN_LOCAL): New.
(GPGME_KEYSIGN_LFSEP): New.
(GPGME_KEYSIGN_NOEXPIRE): New.
* src/context.h (ctx_op_data_id_t): Add OPDATA_KEYSIGN.
* src/keysign.c: New.
* src/Makefile.am (main_sources): Add keysig.
* src/libgpgme.vers, src/gpgme.def: Add gpgme_op_keysign_start.
* src/engine.c (_gpgme_engine_op_keysign): New.
* src/engine-backend.h (engine_ops): Add 'keysign' and adjust all
engine initializers.
* src/engine-gpg.c (_add_arg): Add args PREFIX and ARGLEN and change
callers to set them.
(add_arg_pfx): New.
(add_arg_len): New.
(gpg_keysign): New.
(_gpgme_engine_ops_gpg): Set keysign to gpg_keysign.
* tests/run-keysign.c: New.
* tests/Makefile.am (noinst_PROGRAMS): Add run-keysign.

Signed-off-by: Werner Koch <wk@gnupg.org>
2016-09-14 18:59:55 +02:00
Werner Koch
c943380b7a
core: New function gpgme_op_revuid.
* src/engine.h (GENKEY_EXTRAFLAG_REVOKE): New.
* src/genkey.c (adduid_start): Rename to addrevuid_start.  Add arg
REVOKE and pass it as extraflags.  Remove useless ARMOR extraflag.
Adjust callers.
(gpgme_op_revuid_start, gpgme_op_revuid): New.
* src/gpgme.def, src/libgpgme.vers: Add them.

* tests/run-genkey.c: Add option --revuid.

Signed-off-by: Werner Koch <wk@gnupg.org>
2016-09-14 12:42:12 +02:00
Werner Koch
3210f3e472
core: New function gpgme_op_adduid.
* src/genkey.c: Replace most error codes GPG_ERR_INV_VALUE by
GPG_ERR_INV_ARG.
(struct op_data_t): Add field UIDMODE.
(genkey_status_handler): Use UIDMODE.
(adduid_start): New.
(gpgme_op_adduid_start, gpgme_op_adduid): New.
* src/gpgme.def, src/libgpgme.vers: Add them.
* tests/run-genkey.c: Add option --adduid.

Signed-off-by: Werner Koch <wk@gnupg.org>
2016-09-14 11:40:34 +02:00
Werner Koch
cc353701b0
core: New function gpgme_op_createsubkey.
* src/genkey.c (createsubkey_start): New.
(gpgme_op_createsubkey_start, gpgme_op_createsubkey): New.
* src/gpgme.def, src/libgpgme.vers: Add them.
* src/engine-gpg.c (gpg_createkey): Factor some code out to ...
(gpg_add_algo_usage_expire): new.
(gpg_addkey): Implement.
* tests/run-genkey.c: Add option --addkey.

Signed-off-by: Werner Koch <wk@gnupg.org>
2016-09-14 09:51:16 +02:00
Werner Koch
9064eebdc0
tests: Mark lots of unused vars and fix const mismatches.
Signed-off-by: Werner Koch <wk@gnupg.org>
2016-09-13 20:48:06 +02:00
Werner Koch
4491ef0a9a
tests: Use gpgme_io_write in passhrase callbacks.
* tests/gpg/t-support.h (passphrase_cb): Use gpgme_io_write.
* tests/gpgsm/t-support.h (passphrase_cb): Ditto.
* tests/run-support.h (passphrase_cb): Ditto.

Signed-off-by: Werner Koch <wk@gnupg.org>
2016-09-13 20:46:41 +02:00
Werner Koch
00c501d296
core: New function gpgme_op_create_key.
* src/engine-backend.h (engine_ops): Change prototype of genkey.
* src/engine-gpgsm.c (gpgsm_genkey): Change accordingly.
* src/engine-gpg.c (gpg_genkey): Change it to a dispatcher.
(gpg_createkey_from_param): New for the old functionality.
(gpg_createkey_legacy): New.  Stub for now.
(gpg_createkey): New.
(gpg_addkey): New.  Stub for now.
(gpg_adduid): New.  Stub for now.
* src/engine.c (_gpgme_engine_op_genkey): Add new args.
* src/genkey.c (op_data_t): Add field ERROR_CODE.
(parse_error): New.
(genkey_status_handler): Parse ERROR status line.
(genkey_start): Use NULL/0 for the new args.
(createkey_start): New.
(gpgme_op_createkey_start, gpgme_op_createkey): New.
* src/gpgme.def, src/libgpgme.vers: Add gpgme_op_createkey_start and
gpgme_op_createkey.
* src/gpgme.h.in (_gpgme_op_genkey_result): Add fields PUBKEY and
SECKEY.
(GPGME_CREATE_SIGN): New.
(GPGME_CREATE_ENCR): New.
(GPGME_CREATE_CERT): New.
(GPGME_CREATE_AUTH): New.
(GPGME_CREATE_NOPASSWD): New.
(GPGME_CREATE_SELFSIGNED): New.
(GPGME_CREATE_NOSTORE): New.
(GPGME_CREATE_WANTPUB): New.
(GPGME_CREATE_WANTSEC): New.
(GPGME_CREATE_FORCE): New.

* tests/run-genkey.c: New.
* tests/Makefile.am (noinst_PROGRAMS): Add it.
--

This function uses the new --quick-gen-key API of gpg.  A limited
compatibility mode to use older gpg versions and gpgsm will eventually
be provided.  Not all flags are currently implemented.

 ./run-genkey --unprotected --force test@example.com

Create a new standard key with the given user id.  --force is used to
allow creating more than one key with that user id in the keyring.

 ./run-genkey --unprotected --force \
      test@example.com default default 2145826800

Creates a new standard key with an expiration date of 2037-12-31.

 ./run-genkey --unprotected --force \
      test@example.com future-default default 2145826800

Create a standard key using the fugure default algorithms.

Signed-off-by: Werner Koch <wk@gnupg.org>
2016-09-13 18:59:10 +02:00
Justus Winter
dfd99ab50c tests: Fix version comparison.
* tests/gpg/t-sig-notation.c: Fix version comparison.

Fixes-commit: a0263ad2
Signed-off-by: Justus Winter <justus@g10code.com>
2016-09-12 15:42:07 +02:00
Justus Winter
a0263ad282 tests: Make signature notation test compatible with older GnuPGs.
* lang/python/tests/t-sig-notation.py: Only check the critical flag
when GnuPG >= 2.1.13 is used.
* tests/gpg/t-sig-notation.c: Likewise.

Fixes-commit: c88c9ef3
Signed-off-by: Justus Winter <justus@g10code.com>
2016-09-12 14:56:07 +02:00
Werner Koch
120b14783c
core,cpp: Extend the TOFU information.
* src/gpgme.h.in (struct _gpeme_tofu_info): Rename FIRSTSEEN to
SIGNFIRST and LASTSEEN to SIGNLAST.  Add ENCRFIST and ENCRLAST.
* src/keylist.c (parse_tfs_record): Parse to ENCRFIRST and ENCRLAST.
* src/verify.c (parse_tofu_stats): Ditto.
* tests/run-keylist.c (main): Adjust and print encrypt stats.
* tests/run-verify.c (print_result): Ditto.

* lang/cpp/src/tofuinfo.h (TofuInfo): Rename firstSeen to signFirst
and lastSeen to signLast.  Add encrCount, encrFirst and encrLast.
* lang/cpp/src/tofuinfo.cpp (encrCount, encrFirst, encrLast): New.
--

The latest GnuPG commits have the needed changes but we also allow the
use of currently released GnuPG version.

Signed-off-by: Werner Koch <wk@gnupg.org>
2016-09-07 09:26:11 +02:00
Andre Heinecke
151da95470 tests: Set passphrase cb in t-encrypt-mixed
* tests/gpg/t-encrypt-mixed.c (main): Set passphrase cb.

--
This fixes the test when run without an agent and our
faked pinentry program.
2016-09-06 16:32:01 +02:00
Werner Koch
9ee103957e
core: Add GPGME_KEYLIST_MODE_WITH_TOFU.
* src/gpgme.h.in (GPGME_KEYLIST_MODE_WITH_TOFU): New.
* src/engine-gpg.c (gpg_keylist_build_options): Use that.
* src/keylist.c: Include limits.h.
(parse_tfs_record): New.
(keylist_colon_handler): Support TFS record.
* tests/run-keylist.c: Include time.h.
(isotimestr): New.
(main): Add option --tofu.  Print TOFU info.
* tests/run-verify.c: Include time.h.
(isotimestr): New.
(print_result): Use isotimestr for TOFU dates.

Signed-off-by: Werner Koch <wk@gnupg.org>
2016-08-25 11:38:03 +02:00
Werner Koch
be4ff75d7d
core: Change the way TOFU information are represented.
* src/gpgme.h.in (struct _gpgme_signature): Remove field 'tofu'.  Add
field 'key'.
(struct _gpgme_key): Add field 'fpr'.
(struct _gpgme_user_id): Add field 'tofu'.
(struct _gpgme_tofu_info): Remove fields 'address' and 'fpr'.
* src/key.c (gpgme_key_unref): Release TOFU and FPR.
* src/keylist.c (keylist_colon_handler): Store the fingerprint of the
first subkey also in KEY.
* src/verify.c (release_tofu_info): Remove.
(release_op_data): Release KEY.
(parse_tofu_user): Rewrite for new data structure.
(parse_tofu_stats): Ditto.
(parse_tofu_stats_long): Ditto.
* tests/run-verify.c (print_result): Ditto.
* tests/run-keylist.c (main): Print more fields.
--

TOFU information are now associated with the user ID and not with a
separate object.

Note that this breaks code relying on the former non-released TOFU
feature.  The C++ bindings won't work right now.

Signed-off-by: Werner Koch <wk@gnupg.org>
2016-08-23 15:24:10 +02:00
Werner Koch
24e61984c9
core: Add new items for gpgme_get_dirinfo.
* src/dirinfo.c (WANT_SYSCONFDIR, WANT_LIBEXECDIR, WANT_LIBDIR): New.
(WANT_DATADIR, WANT_LCOALEDIR, WANT_AGENT_SSH_SOCKET): New
(WANT_DIRMNGR_SOCKET): New.
(dirinfo): Add fields 'sysconfdir', 'bindir', 'libexecdir', 'libdir',
'datadir', 'localedir', 'agent_ssh_socket', and 'dirmngr_socket'.
(parse_output): Set these fields.
(get_gpgconf_item): Return them.
(gpgme_get_dirinfo): Likewise.

Signed-off-by: Werner Koch <wk@gnupg.org>
2016-08-22 16:57:51 +02:00
Werner Koch
8c09dd9989
core: New global flag "require-gnupg".
* src/gpgme.c (gpgme_set_global_flag): Add flag.
* src/engine.c (engine_minimal_version): New variable.
(_gpgme_set_engine_minimal_version): New function.
(gpgme_get_engine_info): Check that flag.

* tests/run-keylist.c (main): New option --require-gnupg.

Signed-off-by: Werner Koch <wk@gnupg.org>
2016-08-16 18:53:42 +02:00
Werner Koch
fe1e8e71aa
core: Make use of the "size-hint" in engine-gpg.
* src/engine-gpg.c: Include data.h.
(add_input_size_hint): New.
(gpg_decrypt, gpg_encrypt, gpg_encrypt_sign, gpg_sign)
(gpg_verify): Call new function,

* tests/run-encrypt.c (status_cb): Print to stderr.
(progress_cb): New.o
(main): Add option --progress.  Print full-status lines.  Provide a
size for the input data.

Signed-off-by: Werner Koch <wk@gnupg.org>
2016-08-12 15:32:31 +02:00
Justus Winter
04f994d5db tests: Fix memory leak.
* tests/gpg/t-encrypt-mixed.c (main): Free 'text2'.

Signed-off-by: Justus Winter <justus@g10code.com>
2016-08-10 10:37:31 +02:00
Andre Heinecke
3d2f027d0f core: Add support for mixed symmetric and asym enc
* src/gpgme.h.in (gpgme_encrypt_flags_t): New flag
GPGME_ENCRYPT_SYMMETRIC.
* src/engine-gpg.c (gpg_encrypt): Also add --symmetric if the flag
is given.
* NEWS: Mention new flag.
* tests/run-encrypt.c (show_usage): Extend for --symmetric.
(main): Handle --symmetric.
(main): Set passphrase_cb in loopback mode.
(main): Fix encrypt call if no recipients are given.
* tests/gpg/t-encrypt-mixed.c: New.
* tests/gpg/Makefile.am (c_tests): Add new test.
* doc/gpgme.texi: Document new flag.
2016-08-09 14:23:51 +02:00
Werner Koch
6f3dc66634
core: Extend gpgme_subkey_t to carry the keygrip.
* src/gpgme.h.in (struct _gpgme_subkey): Add file 'keygrip'.
* src/key.c (gpgme_key_unref): Free KEYGRIP.
* src/keylist.c (keylist_colon_handler): Parse GRP records.
* src/engine-gpg.c (gpg_keylist_build_options): Do not use
--with-fingerprint options for gpg versions >= 2.1.15.

* tests/run-keylist.c (main): Print subkeys and keygrips.

Signed-off-by: Werner Koch <wk@gnupg.org>
2016-08-04 16:17:01 +02:00
Justus Winter
62d10c2a38 tests: Fix trivial memory leaks.
--
Signed-off-by: Justus Winter <justus@g10code.com>
2016-06-27 18:14:02 +02:00
Andre Heinecke
3364549c19 tests: Add new test tool run-decrypt
* tests/run-decrypt.c: New.
* tests/Makefile.am (noinst_PROGRAMS): Add run-decrypt.
2016-06-24 11:33:05 +02:00
Werner Koch
5905e8bbd8
tests: Add new test tool run-identify.
* src/gpgme-tool.c (gt_identify): Add new strings.
* tests/run-identify.c: New.
* tests/Makefile.am (noinst_PROGRAMS): Add run-identify.

Signed-off-by: Werner Koch <wk@gnupg.org>
2016-06-21 16:18:00 +02:00
Justus Winter
c88c9ef384 tests: Fix notation tests.
* lang/python/tests/t-sig-notation.py (check_result): Check critical
flag.
* tests/gpg/t-sig-notation.c (check_result): Likewise.

Fixes-commit: 1cacd7d0
Signed-off-by: Justus Winter <justus@gnupg.org>
2016-06-01 12:50:32 +02:00
Werner Koch
1cacd7d00a
core: Set notation flags for verify.
* src/gpgme.h.in (GPGME_STATUS_NOTATION_FLAGS): New.
* src/status-table.c (status_table): Add new status.
* src/verify.c (parse_notation): Handle flags.  Also fix NOTATION_DATA
in case gpg would not percent-escape spaces.
(_gpgme_verify_status_handler): Handle flags.
* tests/run-verify.c (print_result): Print notaion data.
--

Note that this does only work with the soon to be released GnuPG
2.1.13.
2016-06-01 11:11:04 +02:00
Justus Winter
e3dfd0a5ed tests: Fix test.
--
Signed-off-by: Justus Winter <justus@gnupg.org>
2016-05-27 15:27:55 +02:00
Werner Koch
10df06ee8f
api: Return Tofu info for signatures.
* src/gpgme.h.in (gpgme_tofu_policy_t): New.
(gpgme_status_code_t): Add status codes for TOFU.
(struct _gpgme_tofu_info, gpgme_tofu_info_t): New.
(struct _gpgme_signature): Add field 'tofu'.
* src/status-table.c (status_table): Add new codes.
* src/verify.c: Include limits.h.
(release_tofu_info): New.
(release_op_data): Call that.
(parse_tofu_user): New.
(parse_tofu_stats): New.
(parse_tofu_stats_long): New.
(_gpgme_verify_status_handler): Handle TOFU status lines.

* tests/run-verify.c (print_description): New.
(print_result): print tofu info.

Signed-off-by: Werner Koch <wk@gnupg.org>
2016-05-21 10:32:51 +02:00
Werner Koch
88f2c1c0d1
api: Add new function gpgme_set_ctx_flag.
* src/gpgme.h.in (gpgme_set_ctx_flag): New prototype.
* src/gpgme.c (gpgme_set_ctx_flag): New.
* src/gpgme.def, src/libgpgme.vers: Add new function.
* src/context.h (struct gpgme_context): Add FULL_STATUS.
* src/decrypt.c (_gpgme_decrypt_status_handler): Do not call the
  status callback if FULL_STATUS is set.
* src/genkey.c (genkey_status_handler): Ditto.
* src/passphrase.c (_gpgme_passphrase_status_handler): Ditto.
* src/sign.c (_gpgme_sign_status_handler): Ditto.

* src/engine-backend.h (struct engine_ops): Add SET_STATUS_CB and add
adjust all definitions of that variable.
* src/engine.c (_gpgme_engine_set_status_cb): New.
* src/op-support.c (_gpgme_op_reset): Call this function.

* src/engine-gpg.c (struct engine_gpg): Add fields MON_CB and
MON_CB_VALUE.
(gpg_set_status_cb): New.
(_gpgme_engine_ops_gpg): Register that function.
(read_status): Call the monitor callback.

* src/engine-gpgsm.c (struct engine_gpgsm): Add fields MON_CB and
MON_CB_VALUE.
(_gpgme_engine_ops_gpgsm): Register that function.
(gpgsm_assuan_simple_command): Change first arg to be an engine
context and adjust call callers.  Call the monitor callback.

* src/engine-uiserver.c (struct engine_uiserver): Add fields MON_CB
and MON_CB_VALUE.
(_gpgme_engine_ops_uiserver): Register that function.
(uiserver_assuan_simple_command): Change first arg to be an engine
context and adjust call callers.  Call the monitor callback.

* tests/run-verify.c (status_cb): New.
(print_result): Print algo names.
(main): Add option --status.
--

This new feature is mainly intended for bug tracking.  Having access
to the raw status lines might also be useful for applications, though.

Signed-off-by: Werner Koch <wk@gnupg.org>
2016-05-19 17:04:54 +02:00
Werner Koch
30b447fcfe
tests: New maintenance helper run-encrypt.
* tests/run-encrypt.c: New.

Signed-off-by: Werner Koch <wk@gnupg.org>
2016-05-17 20:23:28 +02:00
Werner Koch
afc65aa60a
Trailing white space cleanup for 2 files in tests/.
--
2016-05-17 14:33:49 +02:00
Justus Winter
8c61cbfb8f Fix typos found by codespell.
--
Signed-off-by: Justus Winter <justus@g10code.com>
2015-12-02 11:28:07 +01:00
Werner Koch
208f029746
tests: Build test programs in tests/ without wrappers.
--
2015-08-25 10:37:02 +02:00
Werner Koch
491fcd91b8
tests: Allow using run-sign to test loopback pinentry problems.
* tests/run-sign.c: Add options --status and --loopback.
2015-08-25 09:05:33 +02:00
Werner Koch
2b632bbb78
Add an export secret key feature.
* src/gpgme.h.in (GPGME_EXPORT_MODE_SECRET): New.
(GPGME_EXPORT_MODE_RAW): New.
(GPGME_EXPORT_MODE_PKCS12): New.
* src/export.c (export_start, export_ext_start): Allow new flags.
* src/engine-gpg.c (export_common): Support secret key export.
* src/engine-gpgsm.c (gpgsm_export, gpgsm_export_ext): Ditto.

* src/gpgme-tool.c (cmd_export): Add options --secret, --raw,
and --pkcs12.
* tests/run-export.c (main): Likewise.
--

Note that exporting secret X.509 keys requires GnuPG 2.1.8.

Signed-off-by: Werner Koch <wk@gnupg.org>
2015-08-24 12:41:24 +02:00
Andre Heinecke
08086dd690
Add offline mode support for CMS keylisting
* doc/gpgme.texi: Document offline mode.
* src/context.h (gpgme_context): Add offline.
* src/engine-backend.h (keylist, keylist_ext): Add engine_flags.
* src/engine.c, src/engine.h (_gpgme_engine_op_keylist): Ditto.
  (_gpgme_engine_op_keylist_ext): Ditto.
* src/engine.h (GPGME_ENGINE_FLAG_OFFLINE): New.
* src/engine-gpg.c (gpg_keylist, gpg_keylist_ext): Ditto.
* src/engine-gpgsm.c (gpgsm_keylist): Handle engine_flags.
  (gpgsm_keylist_ext): Ditto.
* src/gpgme.c (gpgme_set_offline, gpgme_get_offline): New.
* src/gpgme.def (gpgme_set_offline, gpgme_get_offline): New.
* src/gpgme.h.in (gpgme_set_offline, gpgme_get_offline): New.
* src/libgpgme.vers (gpgme_set_offline, gpgme_get_offline): New.
* src/keylist.c (gpgme_op_keylist_start): Set offline flag.
  (gpgme_op_keylist_ext_start): Ditto.
* tests/run-keylist.c (show_usage, main): Add offline argument.

--
The offline engine option was introduced with gpgsm 2.1.6
it is mainly useful for a full keylisting that includes
the certificate validation but does not depend on external
information that could take an indefinite amount of time to
collect.

Signed-off-by: Andre Heinecke <aheinecke@intevation.de>
2015-07-31 15:18:27 +02:00
Werner Koch
7addffc082
tests: Add option --secret to run-keylist.
Signed-off-by: Werner Koch <wk@gnupg.org>
2015-06-08 12:30:11 +02:00
Werner Koch
a5b040cc57
Fix test suite for GnuPG 2.1 which uses pubring.kbx.
* tests/gpgsm/final.test: New.
* tests/gpgsm/initial.test: New.
* tests/gpg/start-stop-agent: Move to ../.
* tests/gpgsm/Makefile.am (TESTS_ENVIRONMENT): Export top_srcdir.
(TESTS): Add intial.test and final.test.
(AM_LDFLAGS): Add -no-install.
(clean-local): Use start-stop-agent
(initial.test): Add dependency.
* tests/gpg/Makefile.am (top_srcdir): Export top_srcdir.
(AM_LDFLAGS): Add -no-install.
(check-local): Depend on pubring-stamp instead of pubring.gpg.
(initial.test): Depend on check-local.
(./pubring-gpg): Replace by rule for ./pubring-stamp.
--

There are also a couple of other changes which should make the tests a
bit more robust and the gpg and gpgsm tests more similar.

The -no-install avoids creating wrappers for test programs, which make
debugging easier.

The dependency on check-local guarantees that its rules are run before
the first test.  This is important because conf files are setup by
this rule.  Earlier automake versions seem to have run check-local
always before the tests but today the order of execution is not
defined.

Signed-off-by: Werner Koch <wk@gnupg.org>
2015-06-08 10:43:29 +02:00
Werner Koch
428ea76965 Switch to automake 1.14 and update build-aux files.
Signed-off-by: Werner Koch <wk@gnupg.org>
2015-01-30 10:45:20 +01:00
Werner Koch
2e8ecc24cf tests: Delay some test file extraction until "make check".
* tests/gpg/Makefile.am (all-local): Change to check-local.
* tests/gpgsm/Makefile.am (all-local): Ditto.
2014-09-24 14:46:47 +02:00
Daniel Kahn Gillmor
36997e0f74 Clean up gpgme's tests/gpg when gpg2.1 is available
* tests/gpg/Makefile.am: Clean up .gpg-v21-migrated
--

We also need to gitignore this file.
2014-09-24 14:44:51 +02:00
Werner Koch
77931a9a14 Add gpgme_get_dirinfo.
* src/dirinfo.c (gpgme_get_dirinfo): New.
* tests/t-engine-info.c (main): Print results from that function.
2014-04-10 11:48:20 +02:00
Werner Koch
b788c36ec0 Remove compiler warning from test
--
2014-04-10 11:42:39 +02:00
Werner Koch
6564e5e78e Add global flags disable-gpgconf, gpgconf-name, and gpg-name.
* src/gpgme.c (gpgme_set_global_flag): Add names "disable-gpgconf",
"gpgconf-name", and "gpg-name".
* src/dirinfo.c (_gpgme_dirinfo_disable_gpgconf): New.
(get_gpgconf_item): Minor debug info change.
* src/posix-util.c (default_gpg_name, default_gpgconf_name): Add vars.
(_gpgme_set_default_gpg_name): New.
(_gpgme_set_default_gpgconf_name): New.
(_gpgme_get_gpg_path, _gpgme_get_gpgconf_path): Use new vars.
(walk_path): Add debug output on failure.
* src/w32-util.c (default_gpg_name, default_gpgconf_name): Add vars.
(replace_slashes): New.
(get_basename): New.
(_gpgme_set_default_gpg_name): New.
(_gpgme_set_default_gpgconf_name): New.
(_gpgme_get_gpg_path, _gpgme_get_gpgconf_path): Use new vars.

* tests/t-engine-info.c (main): Add --verbose and --set-global-flag
options.
--

Note that the Windows part has not been tested.
2014-01-06 17:16:52 +01:00
Werner Koch
02ba35c1b6 Locate engine names only at runtime and prefer GnuPG-2.
* configure.ac (NEED_GPG_VERSION, NEED_GPGSM_VERSION)
(NEED_G13_VERSION, NEED_GPGCONF_VERSION): Remove vars and all related
checks.  Do not check for any engine version.
(HAVE_ASSUAN): Remove AM conditional.
* src/Makefile.am: Remove separate component vars and always build all
engines but uiserver.
* src/dirinfo.c (WANT_GPGCONF_NAME): New.
(struct dirinfo): Add field gpgconf_name.
(_gpgme_get_default_gpgconf_name): Use WANT_GPGCONF_NAME.
(get_gpgconf_item): Set gpgconf name and adjust for _gpgme_get_*_path
now returning a malloced string.
* src/engine.c (engine_ops): Always init all engines except for
uiserver.
* src/posix-util.c (_gpgme_get_gpgsm_path, _gpgme_get_g13_path):
Remove unused functions.
(walk_path): New.
(_gpgme_get_gpg_path, _gpgme_get_gpgconf_path ): Re-implement using
walk_path.
* src/w32-util.c (_gpgme_get_gpgsm_path, _gpgme_get_g13_path): Remove
unused functions.
(_gpgme_get_gpg_path, _gpgme_get_gpgconf_path): Return a malloced
string.
* src/engine-g13.c (g13_get_req_version): Use a hardwired string with
the required version.  This info belongs into this file.
* src/engine-gpg.c (gpg_get_req_version): Ditto.
* src/engine-gpgconf.c (gpgconf_get_req_version): Ditto.
* src/engine-gpgsm.c (gpgsm_get_req_version): Ditto.
* tests/t-engine-info.c: Replace now useless test by an info output.
* tests/gpg/Makefile.am (GPG, GPG_AGENT): Hardwire gpg and gpg-agent.
* tests/gpgsm/Makefile.am (GPGSM): Hardwire gpgsm.

Signed-off-by: Werner Koch <wk@gnupg.org>
2013-12-27 16:08:20 +01:00
Werner Koch
eae9c32bd9 tests: Fix NULL ptr deref in gpgsm/t-verify.
* tests/gpgsm/t-verify.c (check_result): Do not dereference a sig or
sig->fpr if NULL.
2013-08-19 20:38:36 +02:00
Werner Koch
3ca7e96e38 Make test suite workable with GnuPG 2.1.
* tests/gpg/start-stop-agent: New.
* tests/gpg/initial.test: New.
* tests/gpg/final.test: New.
* tests/gpg/Makefile.am (c_tests): New.
(TESTS): Move all to c_tests.  Add initial.test, final.test, and
c_tests.
(TESTS_ENVIRONMENT): Add C_ALL=C
(private_keys): New.
(EXTRA_DIST): Add new files.
(./private-keys-v1.d/gpg-sample.stamp): Copy private keys.
(all-local): Depend on gpg-sample.stamp.
* tests/gpg/13CBE3758AFE42B5E5E2AE4CED27AFA455E3F87F: New.
* tests/gpg/13CD0F3BDF24BE53FE192D62F18737256FF6E4FD: New.
* tests/gpg/76F7E2B35832976B50A27A282D9B87E44577EB66: New.
* tests/gpg/7A030357C0F253A5BBCD282FFC4E521B37558F5C: New.
* tests/gpg/A0747D5F9425E6664F4FFBEED20FBCA79FDED2BD: New.
--

GnuPG 2.1 requires that the agent knows the private keys.  Thus we
need to install them.  The code should still work with GnuPG < 2.1.

To make the whole testing using a agent more robust, the way to start
the agent has also be changed.
2013-08-12 14:32:21 +02:00
Werner Koch
567e6481d7 Allow symmetric encryption with gpgme_op_encrypt_sign.
* src/encrypt-sign.c (encrypt_sym_status_handler): New.
(encrypt_sign_start): Handle recp == NULL case.
* src/engine-gpg.c (gpg_encrypt_sign): Implement symmetric encryption.
* tests/gpg/t-encrypt-sign.c (main): Add a test case for this.
--

Co-authored-by: Kyle L. Huff <g10bts@curetheitch.com>
GnuPG-bug-id: 1440
2013-05-22 16:31:51 +02:00
Werner Koch
18254f88f8 tests: Print auditlog in plain text format.
* tests/gpgsm/t-verify.c (show_auditlog): Use plain text format.
--

The HTML output is not very helpful on the console and a pain to the
eyes.
2013-05-22 15:03:57 +02:00
Werner Koch
d8b46c919f Change the various version numbers to the new scheme.
* configure.ac: Rename my_foo variables to mym4_foo variables to make
clear that they are processed by m4.
(VERSION_NUMBER): New ac_subst.
(AH_BOTTOM): Add CRIGHTBLURB macro.
(BUILD_REVISION, BUILD_FILEVERSION, BUILD_TIMESTAMP): Change them to
work similar to libgpg-error et al.
* src/versioninfo.rc.in: Remove use of BUILD_NUMBER and get it in line
with gpg-error et al.
* src/version.c (cright_blurb): New.
(gpgme_check_version_internal): Add magic to display the above
information.
* tests/t-version.c (main): Add option --verbose.
2013-02-26 17:10:18 +01:00
Werner Koch
cc59b75b21 tests: Adhere to the docs and call gpgme_check_version.
* tests/t-engine-info.c: Call gpgme_check_version.
2012-10-24 16:07:31 +02:00
Werner Koch
139e798c87 Remove all trailing whitespace from source files
--
Command used:  sed -i 's,[ \t]*$,,' FILE
2012-09-25 15:29:49 +02:00
W. Trevor King
4cb408d33e .gitignore: flesh out rules and add subdirectory-.gitignores. 2012-04-20 16:05:11 +02:00
Marcus Brinkmann
dae3073aaa Use gpgme interface for error handling to avoid linking with gpg-error.
* tests/t-data.c, tests/run-export.c, tests/run-keylist.c,
tests/run-support.h, tests/run-verify.c, tests/gpg/t-decrypt-verify.c,
tests/gpg/t-edit.c, tests/gpg/t-eventloop.c, tests/gpg/t-keylist-sig.c,
tests/gpg/t-keylist.c, tests/gpg/t-support.h, tests/gpg/t-trustlist.c,
tests/gpg/t-verify.c, tests/gpg/t-wait.c, tests/gpgsm/cms-decrypt.c,
tests/gpgsm/cms-keylist.c, tests/gpgsm/t-keylist.c,
tests/gpgsm/t-support.h, tests/gpgsm/t-verify.c,
tests/opassuan/t-command.c: Use gpgme interface for gpg-error functions.
2012-02-08 15:26:17 +01:00
Marcus Brinkmann
0052a72f89 Link the thread test to pthread.
* tests/gpg/Makefile.am (t_thread1_LDADD): Add -lpthread.
2012-02-08 15:19:33 +01:00
Werner Koch
a4c4ee1aae Generate the ChangeLog from commit logs.
* build-aux/gitlog-to-changelog: New script.  Taken from gnulib.
* build-aux/git-log-fix: New file.
* build-aux/git-log-footer: New file.
* build-aux/git-hook/commit-msg: New script.
* doc/HACKING: New file.
* ChangeLog: New file.
* Makefile.am (EXTRA_DIST): Add new files.
(gen-ChangeLog): New.
(dist-hook): Run gen-ChangeLog.
* autogen.sh: Install commit-msg hook for git.

Rename all ChangeLog files to ChangeLog-2011.
2011-12-02 11:36:37 +01:00
Marcus Brinkmann
d11500a77e Clean up the tests correctly. 2011-05-11 02:32:20 +02:00
Marcus Brinkmann
c79d8ad818 Make sure an existing agent doesn't interfere with test suite generation. 2011-05-06 02:11:40 +02:00
Marcus Brinkmann
470899e3a7 Improve import tests for GnuPG 2.1. 2011-05-04 00:52:11 +02:00
Marcus Brinkmann
43f38db1af Update GPGME test suite for use with GnuPG 2.1. 2011-04-27 18:03:46 +02:00
Werner Koch
fc0fd88d7f Prepare for a new protocol.
Comment clarification.
2009-11-03 20:27:35 +00:00
Marcus Brinkmann
c8e934b276 2009-10-26 Marcus Brinkmann <marcus@g10code.de>
* configure.ac (NEED_GPG_VERSION_DEFAULT): Bump to 1.4.0 as 1.3.0
	was development versions only.

tests/
2009-10-26  Marcus Brinkmann  <marcus@g10code.de>

	* opassuan/t-command.c: Update to new interface.

src/
2009-10-26  Marcus Brinkmann  <marcus@g10code.de>

	* gpgme.h.in (struct gpgme_io_event_done_data)
	(gpgme_io_event_done_data_t): New types.
	(struct _gpgme_op_assuan_result): Deprecate the err member.
	(gpgme_op_assuan_result): Deprecate (for now).
	(gpgme_op_assuan_transact_ext): New prototype.
	(gpgme_op_assuan_transact): Deprecate.
	(struct _gpgme_op_g13_result): Replace with ...
	(struct _gpgme_op_vfs_mount_result): ... this.
	(gpgme_op_g13_mount): Replace with ...
	(gpgme_op_vfs_mount): ... this.
	* gpgme.def (gpgme_op_assuan_transact_ext, gpgme_wait_ext)
	(gpgme_op_vfs_mount_result, gpgme_op_vfs_mount): New.
	(gpgme_op_g13_mount): Remove.
	* libgpgme.vers: Likewise.
	* engine-backend.h (struct engine_ops): Remove RESULT_CB and
	RESULT_CB_VALUE args in opassuan_transact member.  Add CANCEL_OP
	member.
	* ops.h (_gpgme_cancel_with_err, _gpgme_wait_on_condition): Add
	OP_ERR argument.
	(_gpgme_wait_one_ext): New prototype.
	* context.h (ctx_op_data_id_t): Add OPDATA_VFS_MOUNT.
	* engine-g13.c (g13_cancel_op): New function.
	(parse_status): Remove declaration.
	(g13_assuan_simple_command): Do nothing with status lines for now.
	(status_handler): Update opaque value access.
	(_gpgme_engine_ops_g13): Add new cancel_op member.
	* gpgme.c (_gpgme_cancel_with_err): Add new parameter OP_ERR.
	Handle operational errors.
	(gpgme_cancel, gpgme_io_read, gpgme_io_write): Add debug output.
	* data.c (_gpgme_data_inbound_handler)
	(_gpgme_data_outbound_handler): Adjust opaque value access.
	* engine-gpg.c (command_handler, status_handler)
	(colon_line_handler): Likewise.
	* engine-gpgsm.c (status_handler): Likewise.
	* engine-gpg.c (_gpgme_engine_ops_gpg): Add cancel_op member.
	* engine-gpgsm.c (_gpgme_engine_ops_gpgsm): Likewise.
	* g13.c: Rewritten (and will be rewritten again).
	* engine.h (_gpgme_engine_op_assuan_transact): Remove result_cb
	and result_cb_value parameters from prototype.
	(_gpgme_engine_cancel_op): New prototype.
	* engine.c (engine_ops) [! ENABLE_ASSUAN]: Add missing comma.
	(_gpgme_engine_op_assuan_transact): Remove result_cb and
	result_cb_value parameter.
	(_gpgme_engine_cancel_op): New function.
	* wait.h (_gpgme_run_io_cb): Add new argument OP_ERR.
	(struct io_cb_data): New struct to pass opaque data and get a
	op_err return value.  Needed because we can't modify I/O callback
	handler signature because it is exposed to the user.
	* wait.c (_gpgme_run_io_cb): Add OP_ERR parameter.  Handle
	operational errors.
	* wait-user.c (_gpgme_user_io_cb_handler): Handle operational
	errors.
	* wait-private.c (_gpgme_wait_on_condition): New argument to
	retrieve the operational result.  Handle operational errors in
	session based protocols.
	(_gpgme_wait_one_ext): New function.
	(_gpgme_wait_one): Pass argument in invocation of
	_gpgme_wait_on_condition.
	* wait-global.c (struct ctx_list_item): Add member OP_ERR.
	(ctx_done): New argument OP_ERR.
	(ctx_wait): New argument OP_ERR.
	(gpgme_wait_ext): New function based on gpgme_wait but handling
	operational errors.
	(gpgme_wait): Implement in term of gpgme_wait_ext.
	* keylist.c (gpgme_op_keylist_next): Pass argument in invocation
	of _gpgme_wait_on_condition.
	* trustlist.c (gpgme_op_trustlist_next): Pass argument in
	invocation of _gpgme_wait_on_condition.
	* engine-assuan.c (struct engine_llass): Replace members RESULT_CB
	and RESULT_CB_VALUE by LAST_OP_ERR.
	(_gpgme_engine_assuan_last_op_err): Add this hack function.
	(llass_cancel_op): New function.
	(_gpgme_engine_llass_ops): Add cancel_op member.
	(llass_status_handler): Update opaque value access.
	(llass_transact): Remove RESULT_CB and RESULT_CB_VALUE arguments.
	* opassuan.c: Move compat hacks to the end of file.
	(opassuan_start): Do not set OPD->result.err.
	Do not pass RESULT_Cb and CTX to _gpgme_engine_op_assuan_transact.
	(gpgme_op_assuan_transact_ext): New function.
2009-10-26 18:52:32 +00:00
Werner Koch
06e22ca339 Add new debug helper 2009-10-15 20:54:25 +00:00
Werner Koch
0fcf3ee915 Fix detection of invalid signer keys.
Support the new INV_SGNR status code.
2009-08-06 17:17:18 +00:00
Werner Koch
54719f4937 Add issing file. 2009-07-08 11:49:18 +00:00
Werner Koch
b996b0540a Inmplement import from keys for GPGSM.
Add option --cms to run-keylist test program.
2009-07-07 14:33:10 +00:00
Werner Koch
43427b0c91 Move gpg test programs to the top test directory. 2009-07-07 14:17:39 +00:00
Marcus Brinkmann
1c454aee81 2009-06-22 Marcus Brinkmann <marcus@g10code.de>
* configure.ac: Add AC_TYPE_UINTPTR_T.

	* assuan/assuan.h [_ASSUAN_IN_GPGME_BUILD_ASSUAN]: Declare
	_gpgme_io_connect.

src/
2009-06-22  Marcus Brinkmann  <marcus@g10code.de>

	* debug.h: Everywhere, use %p instead of 0x%x to print pointer.
	[HAVE_STDINT_H]: Include <stdint.h>.
	(_TRACE, TRACE, TRACE0, TRACE1, TRACE2, TRACE3, TRACE6): Cast tag
	to (uintptr_t) before casting it to (void*) to silence GCC
	warning.

	* gpgme.h.in (_GPGME_DEPRECATED_OUTSIDE_GPGME): New macro.
	* sign.c (_GPGME_IN_GPGME): Define it.
	* keylist.c (_GPGME_IN_GPGME): Define it.

	* debug.c (_gpgme_debug_begin, _gpgme_debug_add): Handle error in
	vasprintf and asprintf.

	* priv-io.h: Include <sys/socket.h>.  Declare _gpgme_io_connect.

tests/
2009-06-22  Marcus Brinkmann  <marcus@g10code.de>

	* gpg/t-support.h (passphrase_cb): Implement write() according to
	the book to silence compiler warning.
	* gpgsm/t-support.h (passphrase_cb): Likewise.
2009-06-22 14:50:17 +00:00
Werner Koch
bebd9cbe29 Add support for gpg --fetch-keys. 2009-06-16 15:42:37 +00:00
Werner Koch
b872605941 Add new functions to import and export keys specified by gpgme_key_t.
Allow  exporting keys to a keyserver.
2009-06-16 11:42:21 +00:00
Werner Koch
caf36ce1ce Add gpgme_io_write and gpgme_io_read.
Minor cleanups.
2009-06-09 16:01:02 +00:00
Moritz Schulte
edf19bbf8f * Makefile.am (DISTCHECK_CONFIGURE_FLAGS): Specify --with-gpg.
* gpg/Makefile.am (EXTRA_DIST): Replaced mkdemodirs with mkdemodirs.in.
(mkdemodirs): New target.
(clean-local): Added command for removing mkdemodirs script.
(./Alpha/Secret.gpg): Added dependency on mkdemodirs.

* gpg/mkdemodirs: Renamed to ...
* gpg/mkdemodirs.in: ... here.
* gpg/mkdemodirs.in (GPG): Derive value from @GPG@ instead of hard-coding "gpg".
2009-04-19 18:03:49 +00:00
Werner Koch
f0dccac380 Chnaged the op-assuan interface. 2009-02-24 15:13:01 +00:00
Werner Koch
259cbefd5c Provide inforation about smartcards. 2009-02-04 09:51:43 +00:00
Werner Koch
d951cb713f First take on the low-level assuan interface. 2009-01-26 10:21:10 +00:00
Marcus Brinkmann
6d93f41f05 2008-12-03 Marcus Brinkmann <marcus@g10code.de>
* Makefile.am (INCLUDES): Fix path to include file.
	* gpg/Makefile.am (INCLUDES), gpgsm/Makefile.am (INCLUDES): Likewise.
2008-12-03 14:27:52 +00:00
Werner Koch
92394f92d4 Fix SIGPIPE ignoring regression.
Fix unsupported algorithm detection.
2008-11-18 11:12:36 +00:00
Marcus Brinkmann
66d0fa1973 008-11-03 Marcus Brinkmann <marcus@g10code.com>
* configure.ac: Replace gpgme paths with src.
        * gpgme: Move to ...
        * src: ... this new directory.

assuan/
2008-11-03  Marcus Brinkmann  <marcus@g10code.com>

	* Makefile.am (INCLUDES): Replace gpgme path with src.

tests/
2008-11-03  Marcus Brinkmann  <marcus@g10code.com>

        * gpgsm/Makefile.am (INCLUDES, LDADD): Replace gpgme path with src.
        * gpg/Makefile.am (INCLUDES, LDADD, t_thread1_LDADD): Likewise.
	* Makefile.am (LDADD): Likewise.
2008-11-03 17:24:09 +00:00
Werner Koch
9c7489e8d1 use validated mode. 2008-10-30 14:41:23 +00:00
Werner Koch
66c64cfa05 new debug helper program 2008-10-30 13:23:42 +00:00
Werner Koch
63ea0d6663 Add example.
Update gpgconf test.
2008-06-19 18:38:28 +00:00
Marcus Brinkmann
2b5033018f 2008-01-28 Marcus Brinkmann <marcus@g10code.de>
* gpg/Makefile.am (DISTCLEANFILES): Add pubring.kbx~.
2008-01-28 19:49:40 +00:00
Marcus Brinkmann
38c5950991 2008-01-10 Marcus Brinkmann <marcus@g10code.de>
* gpg/t-gpgconf.c (main): Allow for dirmngr not to be available.
2008-01-10 04:54:16 +00:00
Marcus Brinkmann
ade61e1311 2008-01-10 Marcus Brinkmann <marcus@g10code.de>
* gpg/Makefile.am (./gpg-agent.conf): Correct pinentry path.
2008-01-10 04:40:25 +00:00
Marcus Brinkmann
25dccf5897 2008-01-10 Marcus Brinkmann <marcus@g10code.de>
* gpg/pinentry: New file.
	* gpg/Makefile.am (DISTCLEANFILES, all-local): Add gpg-agent.conf
	(./gpg-agent.conf): New target.
	(EXTRA_DIST): Add pinentry.
2008-01-10 04:33:34 +00:00
Marcus Brinkmann
62a1429a5c 2008-01-10 Marcus Brinkmann <marcus@g10code.de>
* gpg/t-gpgconf.c (main): Exit early if compiled without gpgconf.
2008-01-10 02:13:18 +00:00
Marcus Brinkmann
4028a0f390 2008-01-04 Marcus Brinkmann <marcus@g10code.de>
* gpg/Makefile.am (CLEANFILES): Add pubring.kbx and dirmngr.conf.
2008-01-04 14:40:45 +00:00
Marcus Brinkmann
19025d7918 2008-01-04 Marcus Brinkmann <marcus@g10code.de>
* configure.ac: Support gpgconf.

gpgme/
2008-01-04  Marcus Brinkmann  <marcus@g10code.de>

	* Makefile.am (gpgconf_components): New variable.
	(main_sources): Add gpgconf.c.
	* gpgme.h (gpgme_protocol_t): New protocol GPGME_PROTOCOL_GPGCONF.
	(gpgme_conf_level_t, gpgme_conf_type_t, gpgme_conf_arg_t)
	(gpgme_conf_opt_t, gpgme_conf_comp_t, gpgme_conf_arg_new)
	(gpgme_conf_arg_release, gpgme_conf_opt_change)
	(gpgme_conf_release, gpgme_op_conf_load, gpgme_op_conf_save): New
	types.
	* gpgconf.c, engine-gpgconf.c: New files.
	* engine.h: (_gpgme_engine_op_conf_load,
	(_gpgme_engine_op_conf_save): New prototypes.
	* op-support.c (_gpgme_op_reset): Ignore not implemented locale
	function.
	* posix-util.c (_gpgme_get_gpgconf_path): New function.
	* w32-util.c (_gpgme_get_gpgconf_path): New function.
	* engine-gpgsm.c:
	(_gpgme_engine_ops_gpgsm): Add stubs for conf_load and conf_save.
	* rungpg.c:
	(_gpgme_engine_ops_gpg): Add stubs for conf_load and conf_save.
	* gpgme.def: Add new gpgconf related interfaces.
	* libgpgme.vers: Likewise.
	* util.h (_gpgme_get_gpgconf_path): New prototype.
	* gpgme.h (gpgme_protocol_t): Add GPGME_PROTOCOL_GPGCONF.
	* engine-backend.h (_gpgme_engine_ops_gpgconf): New prototype.
	(struct engine_ops): Add members for conf_load and conf_save.
	* engine.c (engine_ops): Add _gpgme_engine_ops_gpgconf.
	(_gpgme_engine_op_conf_load,
	(_gpgme_engine_op_conf_save): New functions.
	(gpgme_get_engine_info): Allow protocol GPGME_PROTOCOL_GPGCONF.

tests/
2008-01-04  Marcus Brinkmann  <marcus@g10code.de>

	* Makefile.am (TESTS_ENVIRONMENT): Use absolute path for
	GNUPGHOME.
	* gpg/Makefile.am (TESTS_ENVIRONMENT): Use absolute path for
	GNUPGHOME.
	* gpgsm/Makefile.am (TESTS_ENVIRONMENT): Use absolute path for
	GNUPGHOME.
	* gpg/Makefile.am (TESTS): Add t-gpgconf.
	t-gpgconf.c: New file.
2008-01-04 14:31:15 +00:00
Werner Koch
38167ceddb Made autolog feature for if --enable-fd-passing has not been enabled.
Pass HTML glag to test program.
2007-11-26 10:59:11 +00:00
Marcus Brinkmann
f6ebf8638f 2007-11-23 Marcus Brinkmann <marcus@g10code.de>
* gpgsm/t-verify.c (show_auditlog): Check for GPG_ERR_ASS_UNKNOWN_CMD.
2007-11-23 17:25:11 +00:00
Werner Koch
c07011580a Make getauditlog work. For now only when configured with --enable-fd-passing. 2007-11-23 13:07:04 +00:00
Werner Koch
4dbd2fbdfe New API gpgme_op_getauditlog. 2007-11-22 16:44:37 +00:00
Marcus Brinkmann
37ac53e74c 2007-09-27 Marcus Brinkmann <marcus@g10code.de>
* assuan-pipe-connect.c (pipe_connect_gpgme): Do not close process
	handle here.  Use this function also on Unix systems.

gpgme/
2007-09-27  Marcus Brinkmann  <marcus@g10code.de>

	* w32-glib-io.c (_gpgme_io_spawn),
	w32-qt-io.cpp (_gpgme_io_spawn), w32-io.c (_gpgme_io_spawn): Close
	the process handle, return 0.

tests/
2007-09-27  Marcus Brinkmann  <marcus@g10code.de>

	* t-engine-info.c (check_engine_info): Fix debug output.
	* gpg/Makefile.am (tests_unix): New variable.
	(TESTS): Use it.
	* gpg/t-support.h (passphrase_cb) [HAVE_W32_SYSTEM]: Use WriteFile instead of write.
	* gpg/t-wait.c [HAVE_W32_SYSTEM]: Define sleep as _sleep.
2007-09-27 13:01:54 +00:00
Marcus Brinkmann
5f726f4af7 2007-09-14 Marcus Brinkmann <marcus@g10code.de>
* gpgsm/t-verify.c (main): Release TEXT and SIG.
2007-09-13 22:40:22 +00:00
Marcus Brinkmann
1ef14744a2 2007-07-12 Marcus Brinkmann <marcus@g10code.de>
* gpgsm/Makefile.am (key_id): Change := into =.
2007-07-12 18:26:51 +00:00
Werner Koch
906da085cf Changes for W32 2007-07-12 15:25:20 +00:00
Werner Koch
1786019d68 Detect and bailo out on double plaintext messages. 2007-02-26 10:36:08 +00:00
Marcus Brinkmann
68fc3075c3 2006-12-02 Marcus Brinkmann <marcus@g10code.de>
* gpgsm/t-keylist.c (main): Skip unknown keys.  Newer versions of
	GPGSM import more keys than older ones.
2006-12-02 22:47:02 +00:00
Werner Koch
b1fb4f2fa6 Basic PKA support. 2005-12-20 20:22:19 +00:00
Werner Koch
a1e484f9ea * Fixed a bug in that the fingerprints of subkeys are not available.
* Clarified usage of the SECRET flag in key listings.  It is now
   reset for stub keys.
2005-12-06 16:30:21 +00:00
Werner Koch
deae5fa5a2 Add a test for expired subkeys 2005-10-19 08:23:23 +00:00
Marcus Brinkmann
81735c3e4c 2005-10-07 Marcus Brinkmann <marcus@g10code.de>
* gpgsm/t-keylist.c (main): Allow for an email address as a second
	uid.
2005-10-07 13:34:22 +00:00
Marcus Brinkmann
2513557bf5 2005-10-07 Marcus Brinkmann <marcus@g10code.de>
* gpg/t-sig-notation.c: Change critical notation to something
	GnuPG understands.
2005-10-06 23:28:50 +00:00
Marcus Brinkmann
bda9541b51 2005-10-01 Marcus Brinkmann <marcus@g10code.de>
* gpg/Makefile.am (EXTRA_DIST): Remove gpg.conf.
	(DISTCLEANFILES): Add gpg.conf.
	(all-local): Add gpg.conf.
	(./gpg.conf): New target.
	* gpg/gpg.conf: Remove file.
2005-10-01 20:41:41 +00:00
Marcus Brinkmann
efb2ed5a78 2005-10-01 Marcus Brinkmann <marcus@g10code.de>
* gpg/Makefile.am (EXTRA_DIST): Add gpg.conf.
2005-10-01 19:22:16 +00:00
Marcus Brinkmann
b3304042aa doc/
2005-10-01  Marcus Brinkmann  <marcus@g10code.de>

	* gpgme.texi (Signature Notation Data): New section.
	(Verify): Added more about the notation data structure.

gpgme/
2005-10-01  Marcus Brinkmann  <marcus@g10code.de>

	* gpgme.def: Add gpgme_data_set_file_name,
	gpgme_data_get_file_name, gpgme_sig_notation_clear,
	gpgme_sig_notation_add and gpgme_sig_notation_get.
	* libgpgme.vers: Add gpgme_sig_notation_clear,
	gpgme_sig_notation_add and gpgme_sig_notation_get.
	* Makefile.am (libgpgme_real_la_SOURCES): Add sig-notation.c.
	* context.h (struct gpgme_context): New field sig_notations.
	* gpgme.h (struct _gpgme_sig_notation): New member value_len and
	critical.
	(GPGME_SIG_NOTATION_CRITICAL): New symbol.
	(gpgme_sig_notation_flags_t): New type.
	(gpgme_sig_notation_add, gpgme_sig_notation_clear,
	gpgme_sig_notation_get): New prototypes.
	* ops.h (_gpgme_sig_notation_create, _gpgme_sig_notation_free):
	New prototypes.
	* sig-notation.c (_gpgme_sig_notation_free): New file.
	* verify.c (parse_notation): Use support functions.
	(release_op_data): Likewise.
	* rungpg.c (append_args_from_sig_notations): New function.
	(gpg_encrypt_sign, gpg_sign): Call it.


tests/
2005-10-01  Marcus Brinkmann  <marcus@g10code.de>

	* gpg/Makefile.am (TESTS): Add t-sig-notation.
	* gpg/t-sig-notation.c (check_result): New file.
	* gpg/t-verify.c (check_result): Also check the length of the
	notation data.
	* gpg/gpg.conf: New file.
2005-10-01 02:33:35 +00:00
Marcus Brinkmann
c6ee58ef55 doc/
2005-09-30  Marcus Brinkmann  <marcus@g10code.de>

	* gpgme.texi (Data Buffer I/O Operations, Data Buffer Meta-Data):
	New subsections.

gpgme/
2005-09-30  Marcus Brinkmann  <marcus@g10code.de>

	* data.h (struct gpgme_data): New member file_name.
	* data.c (gpgme_data_set_filename): New function.
	(_gpgme_data_release): Free DH->filename if necessary.
	(gpgme_data_get_filename): New function.
	* rungpg.c (gpg_encrypt): Set filename option.
	(gpg_encrypt_sign): Likewise.
	(gpg_sign): Likewise.
	* libgpgme.vers (GPGME_1.1): Add gpgme_data_set_file_name and
	gpgme_data_get_file_name.

tests/
2005-09-30  Marcus Brinkmann  <marcus@g10code.de>

	* gpg/Makefile.am (TESTS): Add t-filename.
	* gpg/t-filename.c: New file.
2005-09-30 14:17:47 +00:00
Werner Koch
8a1ce95287 Boosted performance of w32 I/O 2005-09-23 13:29:04 +00:00
Marcus Brinkmann
30c821580d Restore the key files. 2005-09-08 15:17:58 +00:00
Marcus Brinkmann
172a8df25f gpgme/
2005-06-03  Marcus Brinkmann  <marcus@g10code.de>

	* wait-global.c (gpgme_wait): Break out of the fd processing loop
	after an error.
	Reported by Igor Belyi <gpgme@katehok.ac93.org>.

tests/
2005-06-03  Marcus Brinkmann  <marcus@g10code.de>

	* gpg/Makefile.am (TESTS): Add t-wait.
	* gpg/t-wait.c (main): New test.
2005-06-02 22:59:41 +00:00
Marcus Brinkmann
71775ad8fc 2004-12-07 Marcus Brinkmann <marcus@g10code.de>
* README: Refer to COPYING.LESSER and "each file" instead of
	COPYING.
	* COPYING.LESSER: New file.
	* gpgme.spec.in (%doc): Add COPYING.LESSER.
	* acinclude.m4, configure.ac, Makefile.am: Change license to LGPL
	2.1 or later.
	* TODO: Add copyright notice.
	* README.CVS: Likewise.

assuan/
2004-12-07  Marcus Brinkmann  <marcus@g10code.de>

	* README.1st: Add copyright notice.

doc/
2004-12-07  Marcus Brinkmann  <marcus@g10code.de>

	* Makefile.am: Change license to LGPL.
	(gpgme_TEXINFOS): Replace gpl.texi with lesser.texi.

	* gpgme.texi: Change license to LGPL (also for documentation of
	GPGME's license).
	* lesser.texi: New file.
	* gpl.texi: File removed.

gpgme/
2004-12-07  Marcus Brinkmann  <marcus@g10code.de>

	* putc_unlocked.c, funopen.c: I just claim copyright on these
	files and change their license to LGPL, because they are totally
	trivial wrapper functions.
	* isascii.c: Change copyright notice to the one from ctype/ctype.h
	in the GNU C Library (CVS Head 2004-10-10), where isascii is
	defined as a macro doing exactly the same as the function in this
	file.
	* memrchr.c: Update from the GNU C Library (CVS Head 2001-07-06).
	* stpcpy.c: Update from the GNU C Library (CVS Head 2004-10-10).
	* ath.c, ath-compat.c, ath.h, ath-pth.c, ath-pth-compat.c,
	ath-pthread.c, ath-pthread-compat.c, context.h, conversion.c,
	data.c, data-compat.c, data-fd.c, data.h, data-mem.c,
	data-stream.c, data-user.c, debug.c, debug.h, decrypt.c,
	decrypt-verify.c, delete.c, edit.c, encrypt.c, encrypt-sign.c,
	engine-backend.h, engine.c, engine-gpgsm.c, engine.h, error.c,
	export.c, genkey.c, get-env.c, gpgme.c, gpgme.h, import.c, io.h,
	key.c, keylist.c, mkstatus, Makefile.am, ops.h, op-support.c,
	passphrase.c, posix-io.c, posix-sema.c, posix-util.c, progress.c,
	rungpg.c, sema.h, sign.c, signers.c, trust-item.c, trustlist.c,
	util.h, verify.c, version.c, w32-io.c, w32-sema.c, w32-util.c,
	wait.c, wait-global.c, wait.h, wait-private.c, wait-user.c: Change
	license to LGPL.

tests/
2004-12-07  Marcus Brinkmann  <marcus@g10code.de>

	* gpg/mkdemodirs: Add copyright notice.

	* gpgsm/Makefile.am, gpgsm/t-support.h, gpgsm/t-decrypt.c,
	gpgsm/t-encrypt.c, gpgsm/t-export.c, gpgsm/t-genkey.c,
	gpgsm/t-import.c, gpgsm/t-keylist.c, gpgsm/t-sign.c,
	gpgsm/t-verify.c, gpg/Makefile.am, gpg/t-decrypt.c,
	gpg/t-decrypt-verify.c, gpg/t-edit.c, gpg/t-encrypt.c,
	gpg/t-encrypt-sign.c, gpg/t-encrypt-sym.c, gpg/t-eventloop.c,
	gpg/t-export.c, gpg/t-genkey.c, gpg/t-import.c, gpg/t-keylist.c,
	gpg/t-keylist-sig.c, gpg/t-sign.c, gpg/t-signers.c,
	gpg/t-support.h, gpg/t-thread1.c, gpg/t-trustlist.c,
	gpg/t-verify.c, Makefile.am, t-data.c, t-engine-info.c,
	t-version.c: Change license to LGPL.
2004-12-07 21:13:39 +00:00
Marcus Brinkmann
6d65ae9632 2004-08-17 Marcus Brinkmann <marcus@g10code.de>
* gpgsm/t-keylist.c (struct): Add new fields VALIDITY and
	KEY_LENGTH.
	(main): Use them.
	* gpgsm/t-import.c (check_result): New argument total_stat.
	(main): Pass this argument.  Reduce number of total considered
	keys to 1 for the second test.
2004-08-17 21:13:20 +00:00
Werner Koch
edf5d2bd31 * gpgme.h: Add GPGME_STATUS_NEWSIG.
* gpgsm/Makefile.am: Changed the faked system time to 20011213T12000.
2004-04-05 18:40:10 +00:00
Marcus Brinkmann
af3c09d9b2 2004-03-07 Marcus Brinkmann <marcus@g10code.de>
* configure.ac (NEED_GPGSM_VERSION): Bump up to 1.9.6.

2004-03-07  Marcus Brinkmann  <marcus@g10code.de>

	* gpgsm/t-keylist.c: Add chain IDs.
2004-03-07 22:49:42 +00:00
Werner Koch
e65396c735 * engine-gpgsm.c (gpgsm_export_ext): Properly insert a space
beween patterns.

* gpgsm/t-export.c (main): Also check exporting 2 certificates.
2004-03-03 15:15:41 +00:00
Werner Koch
91d3e5aa57 * gpgsm/t-import.c (check_result): gpgsm does now return info in
the result->imports; adjust for that.

* gpgsm/Makefile.am (TESTS_ENVIRONMENT): Reset the GPG_AGENT_INFO.

* gpg/t-keylist-sig.c (main): s/class/sig_class/.
* gpg/t-signers.c (check_result): Ditto.
* gpg/t-sign.c (check_result): Ditto.
* gpg/t-encrypt-sign.c (check_result): Ditto.
* gpgsm/t-sign.c (check_result): Ditto.
2004-02-17 17:26:20 +00:00
Werner Koch
215da10c1c About to release 0.4.4:
* configure.ac: Bumbed LT_Revision; now at C12/A1/R1.
(NEED_GPGSM_VERSION): Set to 1.9.3.

* sign.c: Include util.h for prototype of _gpgme_parse_timestamp.

* gpg/t-keylist-sig.c (main): Temporary disabled one test due top
gpg 1.3.4 problems.
* gpg/t-import.c (check_result): Likewise.
2004-01-12 13:28:36 +00:00
Werner Koch
82cb03cc83 * gpg/t-support.h (DIM): Added.
* gpg/t-verify.c (check_result): Rewrote test for notations
because the order of notaions is not guaranteed.

* gpgsm/t-support.h (fail_if_err): Also print the numeric values.
2003-11-19 15:15:33 +00:00
Marcus Brinkmann
91cc459641 2003-10-06 Marcus Brinkmann <marcus@g10code.de>
* gpg/t-eventloop.c: Include <sys/types.h> for old systems.
2003-10-06 19:46:55 +00:00
Marcus Brinkmann
638c25eda4 2003-10-06 Marcus Brinkmann <marcus@g10code.de>
* gpgsm/Makefile.am (DISTCLEANFILES): Add random_seed.
2003-10-06 19:33:05 +00:00
Marcus Brinkmann
0d0378a200 doc/
2003-10-06  Marcus Brinkmann  <marcus@g10code.de>

	* gpgme.texi (Signal Handling): New section.

gpgme/
2003-10-06  Marcus Brinkmann  <marcus@g10code.de>

	* io.h (_gpgme_io_subsystem_init): New prototype.
	* posix-io.c (_gpgme_io_subsystem_init): Add function.
	(_gpgme_io_spawn): Do not fixup signal handler here.
	* version.c (do_subsystem_inits): Call _gpgme_io_subsystem_init.

tests/
2003-10-06  Marcus Brinkmann  <marcus@g10code.de>

	* gpg/t-thread1.c (thread_one): Do not call initialize_gpgme.
	Likewise.
2003-10-06 16:17:13 +00:00
Marcus Brinkmann
b4473cfffd doc/
2003-09-14  Marcus Brinkmann  <marcus@g10code.de>

	* gpgme.texi (Multi Threading): Correct documentation on memory
	synchronization requirement.

tests/
2003-09-14  Marcus Brinkmann  <marcus@g10code.de>

	* gpg/t-thread1.c (main): Call init_gpgme here.
	(initialize_gpgme): Function removed.
2003-09-14 14:48:48 +00:00
Marcus Brinkmann
0a952a59b6 2003-09-14 Marcus Brinkmann <marcus@g10code.de>
* gpg/t-thread1.c: New file.
	* gpg/Makefile.am (TESTS): Add t-thread1.c.
	(t_thread1_LDADD): New variable.
	(LDADD): Remove GPG Error lib.
	* gpgsm/Makefile.am (LDADD): Likewise.
2003-09-14 01:32:41 +00:00
Marcus Brinkmann
38a0357afb Include "t-support.h". 2003-09-14 01:05:06 +00:00
Marcus Brinkmann
f8867f2707 2003-09-14 Marcus Brinkmann <marcus@g10code.de>
* gpg/t-import.c (main): Likewise.
	* gpg/t-keylist-sig.c (main): Likewise.
	* gpg/t-keylist.c (main): Likewise.
	* gpg/t-sign.c (main): Likewise.
	* gpg/t-signers.c (main): Likewise.
	* gpg/t-trustlist.c (main): Likewise.
	* gpgsm/t-support.h: Include <stdlib.h> and <locale.h>.
	(init_gpgme): New function.
	* gpg/t-support.h: Likewise.
	* gpgsm/t-verify.c (main): Call init_gpgme.
	* gpgsm/t-decrypt.c (main): Likewise.
	* gpgsm/t-encrypt.c (main): Likewise.
	* gpgsm/t-export.c (main): Likewise.
	* gpgsm/t-genkey.c (main): Likewise.
	* gpgsm/t-import.c (main): Likewise.
	* gpgsm/t-keylist.c (main): Likewise.
	* gpgsm/t-sign.c (main): Likewise.
	* gpg/t-verify.c (main): Call init_gpgme.
	* gpg/t-decrypt-verify.c (main): Likewise.
	* gpg/t-decrypt.c (main): Likewise.
	* gpg/t-edit.c (main): Likewise.
	* gpg/t-encrypt-sign.c (main): Likewise.
	* gpg/t-encrypt-sym.c (main): Likewise.
	* gpg/t-encrypt.c (main): Likewise.
	* gpg/t-eventloop.c (main): Likewise.
	* gpg/t-export.c (main): Likewise.
	* gpg/t-genkey.c (main): Likewise.
2003-09-14 00:30:53 +00:00
Marcus Brinkmann
5231aa6a2a 2003-08-14 Marcus Brinkmann <marcus@g10code.de>
* gpg/t-sign.c (check_result): Change output format for signature
	class to unsigned int.
	* gpg/t-signers.c (check_result): Likewise.
	* gpg/t-encrypt-sign.c (check_result): Likewise.
	* gpgsm/t-sign.c (check_result): Likewise.
2003-09-02 22:00:37 +00:00
Marcus Brinkmann
694e2a8041 doc/
2003-08-14  Marcus Brinkmann  <marcus@g10code.de>

	* gpgme.texi (Creating a Signature): Change type of member class
	to unsigned int.

gpgme/
2003-08-14  Marcus Brinkmann  <marcus@g10code.de>

	* gpgme.h (struct _gpgme_new_signature): Rename member CLASS to
	_OBSOLETE_CLASS, add member CLASS with type unsigned int.
	* sign.c (parse_sig_created): Also set SIG->_unused_class for
	backward compatibility.

tests/
2003-08-14  Marcus Brinkmann  <marcus@g10code.de>

	* gpg/t-sign.c (check_result): Change output format for signature
	class to unsigned int.
2003-08-14 17:32:18 +00:00
Marcus Brinkmann
51c384409e 2003-07-31 Marcus Brinkmann <marcus@g10code.de>
* gpg/t-verify.c (check_result): Change type of SUMMARY to
	unsigned int.
	* gpg/t-decrypt-verify.c (check_verify_result): Likewise.
	* gpg/t-keylist-sig.c (keys): Change type of member CLASS to
	unsigned int.
	* t-data.c (read_cb): Change type of AMOUNT to unsigned int.
	* t-version.c (version): Remove unused variable.
2003-07-31 15:44:32 +00:00
Marcus Brinkmann
ade276f81e 2003-07-22 Marcus Brinkmann <marcus@g10code.de>
* Makefile.am (AM_CPPFLAGS): New variable.
	(LDADD): Add @GPG_ERROR_LIBS@.
	* gpg/Makefile.am (AM_CPPFLAGS): New variable.
	(LDADD): Add @GPG_ERROR_LIBS@.
	* gpgsm/Makefile.am (AM_CPPFLAGS): New variable.
	(LDADD): Add @GPG_ERROR_LIBS@.
2003-07-22 11:40:48 +00:00
Marcus Brinkmann
a8fe22ca6b doc/
2003-06-06  Marcus Brinkmann  <marcus@g10code.de>

	* gpgme.texi (Crypto Operations): Rename gpgme_invalid_user_id_t
	to gpgme_invalid_key_t.

gpgme/
2003-06-06  Marcus Brinkmann  <marcus@g10code.de>

	* op-support.c (_gpgme_parse_inv_userid): Rename to
	_gpgme_parse_inv_recp and change to new datatype.
	* ops.h (_gpgme_parse_inv_key): Fix prototype.
	* gpgme.h (struct _gpgme_invalid_user_id): Rename to
	__gpgme_invalid_key.  Rename field ID to KEY.
	(gpgme_invalid_user_id_t): Rename to gpgme_invalid_key_t.
	(struct _gpgme_op_encrypt_result): Here, too.
	(struct _gpgme_op_sign_result): Likewise.
	* encrypt.c (struct op_data): Likewise.
	(release_op_data): Likewise.
	* sign.c (struct op_data): Likewise.
	(release_op_data): Likewise.
2003-06-06 00:56:03 +00:00
Marcus Brinkmann
02536bb72b doc/
2003-06-06  Marcus Brinkmann  <marcus@g10code.de>

	* gpgme.texi: Change error codes to GPG_ERR_* variants.
	(Error Handling): Rewritten.

gpgme/
2003-06-05  Marcus Brinkmann  <marcus@g10code.de>

	Everywhere: Use libgpg-error error codes.

	* Makefile.am (EXTRA_DIST): Remove mkerrors.
	(BUILT_SOURCES): Remove errors.c.
	(MOSTLYCLEANFILES): Likewise.
	(libgpgme_la_SOURCES): Likewise.  Add error.c.
	(errors.c): Remove target.
	* mkerrors: File removed.
	* error.c: New file.

	* gpgme.h (gpgme_error_t): Change to type gpg_error_t.
	(gpgme_err_code_t, gpgme_err_source_t): New types.
	(gpgme_err_code, gpgme_err_source, gpgme_error, gpgme_err_make):
	New static inline functions.
	(gpgme_strsource, gpgme_err_code_from_errno,
	gpgme_err_code_to_errno, gpgme_err_make_from_errno,
	gpgme_error_from_errno): New prototypes.

tests/
2003-06-06  Marcus Brinkmann  <marcus@g10code.de>

	Everywhere: Use libgpg-error error codes.

	* gpg/Makefile.am (noinst_HEADERS): New variable.
	* gpg/t-support.h: New file.
	* gpgsm/Makefile.am (noinst_HEADERS): New variable.
	* gpgsm/t-support.h: New file.
2003-06-05 23:20:29 +00:00
Marcus Brinkmann
8f8c78d534 doc/
2003-05-29  Marcus Brinkmann  <marcus@g10code.de>

	* gpgme.texi (Exporting Keys): Change and document prototypes.
	Add new gpgme_op_export_ext and gpgme_op_export_ext_start
	variants.
	(Selecting Recipients): Section removed.
	(Encrypting a Plaintext): Change prototypes and document the
	changes.

gpgme/
2003-05-29  Marcus Brinkmann  <marcus@g10code.de>

	* gpgme.h (gpgme_op_export_start): Change second arg to const char *.
	(gpgme_op_export): Likewise.
	(gpgme_op_export_ext_start): New prototype.
	(gpgme_op_export_ext): Likewise.
	* engine.h: Likewise for _gpgme_engine_op_export and
	_gpgme_engine_op_export_ext.
	* engine-backend.h (struct engine_ops): Change second argument of
	prototype of export to const char *, and add reserverd int as
	third argument.  Add prototype for export_ext.
	* engine.c (_gpgme_engine_op_export_ext): New function.
	(_gpgme_engine_op_export): Change second argument of prototype of
	export to const char *, and add reserverd int as third argument.
	* rungpg.c (gpg_export): Change second argument of prototype of
	export to const char *, and add reserverd int as third argument.
	(gpg_export_ext): New function.
	(gpg_keylist_ext): Break loop at error.
	(_gpgme_engine_ops_gpg): Add gpg_export_ext.
	* engine-gpgsm.c (gpgsm_export): Change second argument of
	prototype of export to const char *, and add reserverd int as
	third argument.
	(gpgsm_export_ext): New function.
	(_gpgme_engine_ops_gpgsm): Add gpgsm_export_ext.
	* export.c (export_start): Change second argument of prototype of
	export to const char *, and add reserverd int as third argument.
	(gpgme_op_export_start): Likewise.
	(export_ext_start): New function.
	(gpgme_op_export_ext_start): Likewise.
	(gpgme_op_export_ext): Likewise.

	* gpgme.h (gpgme_keylist_mode_t): New type for anonymous enum.
	(gpgme_sigsum_t): New type for anonymous enum.

	* encrypt-sign.c (encrypt_sign_start): Check for errors earlier,
	and return an error if RECP is not set.

	* Makefile.am (libgpgme_la_SOURCES): Remove user-id.c.
	* user-id.c: Remove file.
	* ops.h: Remove prototype for _gpgme_user_ids_all_valid.
	* gpgme.h (gpgme_encrypt_flags_t): New type.
	(gpgme_op_encrypt_start): Change second parameter to type
	gpgme_key_t[], and add third parameter.
	(gpgme_op_encrypt): Likewise.
	(gpgme_op_encrypt_sign_start): Likewise.
	(gpgme_op_encrypt_sign): Likewise.
	* encrypt.c (encrypt_start): Likewise.
	(gpgme_op_encrypt_start): Likewise.
	(gpgme_op_encrypt): Likewise.  Pass flags to engine.
	* encrypt-sign.c (encrypt_sign_start): Likewise.
	(gpgme_op_encrypt_sign_start): Likewise.
	(gpgme_op_encrypt_sign): Likewise.
	* engine-backend.h (struct engine_ops): Likewise for prototypes of
	encrypt and encrypt_sign.
	* engine.h: Likewise for prototypes of _gpgme_engine_op_encrypt
	and _gpgme_engine_op_encrypt_sign.
	* engine.c (_gpgme_engine_op_encrypt): Likewise.
	(_gpgme_engine_op_encrypt_sign): Likewise.
	* rungpg.c (gpg_encrypt): Likewise.
	(gpg_encrypt_sign): Likewise.
	* rungpg.c (gpg_encrypt): Check flags for always trust option.
	* engine-gpgsm.c (gpgsm_encrypt): Likewise.
	(set_recipients): Rewritten to use keys instead user IDs.
	* rungpg.c (append_args_from_recipients): Rewritten to use keys
	instead user IDs.
	* encrypt.c (_gpgme_encrypt_status_handler): Change errors
	returned to GPGME_Invalid_Key and GPGME_General_Error.

tests/
2003-05-29  Marcus Brinkmann  <marcus@g10code.de>

	* gpg/t-encrypt-sym.c (main): Adapt to new syntax.
	* gpg/t-encrypt.c (main): Likewise.
	* gpg/t-eventloop.c (main): Likewise.
	* gpg/t-encrypt-sign.c (main): Likewise.
	* gpgsm/t-export.c (main): Likewise.
	* gpgsm/t-encrypt.c (main): Likewise.
2003-05-29 03:21:02 +00:00
Marcus Brinkmann
92e9e8dd3a 2003-05-28 Marcus Brinkmann <marcus@g10code.de>
* gpgsm/t-encrypt.c (main): Likewise.
	* gpgsm/t-export.c (main): Likewise.
2003-05-28 01:50:15 +00:00
Marcus Brinkmann
bade4a32b5 doc/
2003-05-28  Marcus Brinkmann  <marcus@g10code.de>

	* gpgme.texi (Exporting Keys): Change argument type from
	gpgme_recipient_t to gpgme_user_id_t.
	(Encrypting a Plaintext): Likewise.
	(Selecting Recipients): Rewritten.

gpgme/
2003-05-28  Marcus Brinkmann  <marcus@g10code.de>

	* Makefile.am (libgpgme_la_SOURCES): Remove recipient.c, add
	user-id.c.
	* gpgme.h (gpgme_recipients_t): Removed.
	(gpgme_recipients_new, gpgme_recipients_release,
	gpgme_recipients_add_name,
	gpgme_recipients_add_name_with_validity, gpgme_recipients_count,
	gpgme_recipients_enum_open, gpgme_recipients_enum_read,
	gpgme_recipients_enum_close): Removed.
	(gpgme_op_encrypt, gpgme_op_encrypt_start, gpgme_op_encrypt_sign,
	gpgme_op_encrypt_sign_start, gpgme_op_export_start,
	gpgme_op_export): Change second argument to gpgme_user_id_t.
	(gpgme_user_ids_release): New prototype.
	(gpgme_user_ids_append): Likewise.
	* ops.h (_gpgme_recipients_all_valid): Remove.
	(_gpgme_user_ids_all_valid): Add.
	* context.h (struct gpgme_recipients): Removed.
	* user-id.c: New file.
	* recipient.c: Removed file.
	* rungpg.c (append_args_from_recipients): Change last arg to
	gpgme_user_id_t.  Reimplement.
	(gpg_encrypt): Change second arg to gpgme_user_id_t.
	(gpg_encrypt_sign): Likewise.
	(gpg_export): Likewise.  Rewrite user ID list code.
	* engine.c (_gpgme_engine_op_encrypt): Change second arg to
	gpgme_user_id_t.
	(_gpgme_engine_op_encrypt_sign): Likewise.
	(_gpgme_engine_op_export): Likewise.
	* engine.h (_gpgme_engine_op_encrypt, _gpgme_engine_op_encrypt_sign,
	_gpgme_engine_op_export): Likewise.
	* engine-gpgsm.c (set_recipients): Likewise.  Rewrite loop code.
	(gpgsm_encrypt): Likewise.
	(gpgsm_export): Likewise.
	* engine-backend.h (struct engine_ops): Likewise for members
	ENCRYPT, ENCRYPT_SIGN and EXPORT.
	* export.c (export_start, gpgme_op_export_start, gpgme_op_export):
	Likewise.
	* encrypt.c (encrypt_start): Likewise.  Don't check for count of
	recipients.
	(gpgme_op_encrypt_start): Likewise.
	(gpgme_op_encrypt): Likewise.
	* encrypt-sign.c (encrypt_sign_start): Likewise.
	(gpgme_op_encrypt_sign): Likewise.
	(gpgme_op_encrypt_sign_start): Likewise.

tests/
2003-05-28  Marcus Brinkmann  <marcus@g10code.de>

	* gpg/t-eventloop.c (main): Rewrite recipient management.
	* gpg/t-encrypt-sign.c (main): Likewise.
	* gpg/t-encrypt.c (main): Likewise.
	* gpg/t-export.c (main): Likewise.
2003-05-28 01:15:38 +00:00
Marcus Brinkmann
64b0e7004f Fix last changes. 2003-05-27 08:31:33 +00:00
Marcus Brinkmann
0be6fec1e2 2003-05-27 Marcus Brinkmann <marcus@g10code.de>
* gpg/Makefile.am (TESTS): Order t-keylist and t-keylist-sig after
	t-import.
	* gpg/t-edit.c (edit_fnc): Work around gpg 1.2.2 bug by resetting
	primary uid after setting expiration date.
	* gpg/t-keylist.c: Change order of user IDs.
	* gpg/t-keylist-sig.c: Likewise.
	* gpg/t-import.c: Add support for gpg in CVS.
2003-05-27 05:07:19 +00:00
Marcus Brinkmann
0a1940070d 2003-05-27 Marcus Brinkmann <marcus@g10code.de>
* t-data.c: Remove TEST_OUT_CB.
	(main): Likewise.
	* gpg/t-trustlist.c (main): Access ITEM directly.
2003-05-27 03:06:37 +00:00
Marcus Brinkmann
c440b6792e Reintroduce a check in edit_fnc. 2003-05-27 01:39:18 +00:00
Marcus Brinkmann
03bcb7f4c1 doc/
2003-05-27  Marcus Brinkmann  <marcus@g10code.de>

	* gpgme.texi (Passphrase Callback): Document new prototype.

gpgme/
2003-05-26  Marcus Brinkmann  <marcus@g10code.de>

	* engine.h (EngineCommandHandler): Change last argument to int fd.
	* gpgme.h (gpgme_passphrase_cb_t): Rewritten to take parts of the
	description and fd.
	(gpgme_edit_cb_t): Change last argument to int fd.
	* ops.h (_gpgme_passphrase_command_handler_internal): New prototype.
	* passphrase.c: Include <assert.h>.
	(op_data_t): Rename userid_hint to uid_hint, remove last_pw_handle.
	(release_op_data): Check values before calling free.
	(_gpgme_passphrase_status_handler): Likewise.
	(_gpgme_passphrase_command_handler_internal): New function.
	(_gpgme_passphrase_command_handler): Rewritten.
	* edit.c (edit_status_handler): Pass -1 as fd argument.
	(command_handler): Update prototype.  New variable processed.  Use
	it to store return value of
	_gpgme_passphrase_command_handler_internal which is now used
	instead _gpgme_passphrase_command_handler.  Use it also to check
	if we should call the user's edit function.  Pass fd to user's
	edit function.
	* rungpg.c (struct gpg_object_s): Change type of cmd.cb_data to
	void *.
	(gpg_release): Check value before calling free.  Do not release
	cmd.cb_data.
	(command_cb): Function removed.
	(command_handler): New function.  Thus we don't use a data object
	for command handler stuff anymore, but handle it directly.  This
	allows proper error reporting (cancel of passphrase requests, for
	example).  Also all callbacks work via direct writes to the file
	descriptor (so that passphrases are not kept in insecure memory).
	(gpg_set_command_handler): Rewritten to use even more ugly hacks.
	(read_status): Check cmd.keyword before calling free.  Install
	command_handler as the I/O callback handler with GPG as private
	data.

tests/
2003-05-27  Marcus Brinkmann  <marcus@g10code.de>

	* (t-decrypt-verify.c, t-decrypt.c, t-edit.c, t-encrypt-sign.c,
	t-encrypt-sym.c, t-sign.c, t-signers.c): Include <unistd.h>.
	(passphrase_cb): Rewritten.
	* t-edit.c (edit_fnc): Rewritten.
2003-05-27 01:31:06 +00:00
Marcus Brinkmann
0a882398e1 2003-05-18 Marcus Brinkmann <marcus@g10code.de>
In all files, replace the Gpgme* type names with the new gpgme_*
	type names.

doc/
2003-05-18  Marcus Brinkmann  <marcus@g10code.de>

	* gpgme.texi (Header): Remove Gpgme as namespace prefix.  Add
	_GPGME to namespace prefix.
	* gpgme.texi (Multi Threading): Add note about link order.

gpgme/
2003-05-18  Marcus Brinkmann  <marcus@g10code.de>

	* gpgme.h: The following types are renamed.  The old name is kept
	as a deprecated typedef.
	(GpgmeCtx): Rename to gpgme_ctx_t.
	(GpgmeData): Rename to gpgme_data_t.
	(GpgmeRecipients): Rename to gpgme_recipients_t.
	(GpgmeError): Rename to gpgme_error_t.
	(GpgmeDataEncoding): Rename to gpgme_data_encoding_t.
	(GpgmePubKeyAlgo): Rename to gpgme_pubkey_algo_t.
	(GpgmeHashAlgo): Rename to gpgme_hash_algo_t.
	(GpgmeSigStat): Rename to gpgme_sig_stat_t.
	(GpgmeSigMode): Rename to gpgme_sig_mode_t.
	(GpgmeAttr): Rename to gpgme_attr_t.
	(GpgmeValidity): Rename to gpgme_validity_t.
	(GpgmeProtocol): Rename to gpgme_protocol_t.
	(GpgmeStatusCode): Rename to gpgme_status_code_t.
	(GpgmeEngineInfo): Rename to gpgme_engine_info_t.
	(GpgmeSubkey): Rename to gpgme_subkey_t.
	(GpgmeKeySig): Rename to gpgme_keysig_t.
	(GpgmeUserID): Rename to gpgme_user_id_t.
	(GpgmePassphraseCb): Rename to gpgme_passphrase_cb_t.
	(GpgmeProgressCb): Rename to gpgme_progress_cb_t.
	(GpgmeEditCb): Rename to gpgme_edit_cb_t.
	(GpgmeIOCb): Rename to gpgme_io_cb_t.
	(GpgmeRegisterIOCb): Rename to gpgme_register_io_cb_t.
	(GpgmeRemoveIOCb): Rename to gpgme_remove_io_cb_t.
	(GpgmeEventIO): Rename to gpgme_event_io_t.
	(GpgmeEventIOCb): Rename to gpgme_event_io_cb_t.
	(GpgmeIOCbs): Rename to gpgme_io_cbs.
	(gpgme_io_cbs_t): New type.
	(GpgmeDataReadCb): Rename to gpgme_data_read_cb_t.
	(GpgmeDataWriteCb): Rename to gpgme_data_write_cb_t.
	(GpgmeDataSeekCb): Rename to gpgme_data_seek_cb_t.
	(GpgmeDataReleaseCb): Rename to gpgme_data_release_cb_t.
	(GpgmeDataCbs): Rename to gpgme_data_cbs.
	(gpgme_data_cbs_t): New type.
	(GpgmeInvalidUserID): Rename to gpgme_invalid_user_id_t.
	(GpgmeEncryptResult): Rename to gpgme_encrypt_result_t.
	(GpgmeDecryptResult): Rename to gpgme_decrypt_result_t.
	(GpgmeNewSignature): Rename to gpgme_new_signature_t.
	(GpgmeSignResult): Rename to gpgme_sign_result_t.
	(GpgmeSigNotation): Rename to gpgme_sig_notation_t.
	(GpgmeSignature): Rename to gpgme_signature_t.
	(GpgmeVerifyResult): Rename to gpgme_verify_result_t.
	(GpgmeImportStatus): Rename to gpgme_import_status_t.
	(GpgmeImportResult): Rename to gpgme_import_result_t.
	(GpgmeGenKeyResult): Rename to gpgme_genkey_result_t.
	(GpgmeKeyListResult): Rename to gpgme_keylist_result_t.
	(GpgmeTrustItem): Rename to gpgme_trust_item_t.
	* gpgme.h (gpgme_deprecated_error_t): New type, swallowing macros
	GPGME_No_Recipients, GPGME_Invalid_Recipient and
	GPGME_No_Passphrase.
	* data.h (struct gpgme_data_s): Rename to struct gpgme_data.
	* context.h (struct gpgme_context_s): Rename to struct
	gpgme_context.
	(struct gpgme_recipients_s): Rename to gpgme_recipients.
2003-05-18 20:45:24 +00:00
Marcus Brinkmann
13634fff8a 2003-05-04 Marcus Brinkmann <marcus@g10code.de>
* gpg/t-keylist-sig.c (main): Remove timestamp check.
2003-05-04 22:06:06 +00:00
Marcus Brinkmann
864371b340 2003-05-04 Marcus Brinkmann <marcus@g10code.de>
* gpgsm/t-keylist.c: Add check for timestamp.
2003-05-04 17:00:52 +00:00
Marcus Brinkmann
c5097caeae 2003-05-04 Marcus Brinkmann <marcus@g10code.de>
* gpg/Makefile.am (TESTS): Add t-keylist-sig.
	* gpg/t-keylist-sig.c: New file.
2003-05-04 16:43:24 +00:00
Marcus Brinkmann
102e973a9b doc/
2003-04-30  Marcus Brinkmann  <marcus@g10code.de>

	* gpgme.texi (Encrypting a Plaintext): Remove reference to
	gpgme_get_op_info.
	(Detailed Results): Subsection removed.

gpgme/
2003-04-30  Marcus Brinkmann  <marcus@g10code.de>

	* gpgme.h (gpgme_get_op_info): Remove prototype.
	* ops.h (_gpgme_set_op_info,
	_gpgme_data_release_and_return_string, _gpgme_data_get_as_string,
	_gpgme_data_append, _gpgme_data_append_string,
	_gpgme_data_append_string_for_xml, _gpgme_data_append_for_xml,
	_gpgme_data_append_percentstring_for_xml): Likewise.
	(_gpgme_progress_status_handler): Change first arg to void *.
	* progress.c (_gpgme_progress_status_handler): Likewise.
	* conversion.c: Do not include <string.h>, <errno.h>, <ctype.h>,
	and <sys/types.h>, but <string.h>.
	(_gpgme_data_append): Remove function.
	(_gpgme_data_append_string): Likewise.
	(_gpgme_data_append_for_xml): Likewise.
	(_gpgme_data_append_string_for_xml): Likewise.
	(_gpgme_data_append_percentstring_for_xml): Likewise.
	* data-mem.c (_gpgme_data_get_as_string): Likewise.
	(_gpgme_data_release_and_return_string): Likewise.
	* gpgme.c (gpgme_get_op_info): Likewise.
	(_gpgme_set_op_info): Likewise.

tests/
2003-04-30  Marcus Brinkmann  <marcus@g10code.de>

	* gpg/t-eventloop.c (main): Do not call print_op_info.
	(print_op_info): Function removed.
2003-04-30 03:34:30 +00:00
Marcus Brinkmann
ba333bf07e doc/
2003-04-30  Marcus Brinkmann  <marcus@g10code.de>

	* gpgme.texi (Key Listing Mode): Add GPGME_KEYLIST_MODE_SIGS.
	(Manipulating Keys): Add obsoleteness note.
	(Key Signatures): Likewise.
	(Information About Keys): Likewise.
	(Key Management): Add new data types GpgmeSubkey, GpgmeKeySig,
	GpgmeUserID, and all the information about GpgmeKey.

gpgme/
2003-04-30  Marcus Brinkmann  <marcus@g10code.de>

	* gpgme.h (struct _gpgme_key): New structure.
	(GpgmeKey): Define using _gpgme_key.
	(struct _gpgme_subkey): New structure.
	(GpgmeSubKey): New type.
	(struct _gpgme_key_sig): New structure.
	(GpgmeKeySig): New type.
	(struct _gpgme_user_id): New structure.
	(GpgmeUserID): New type.
	(struct _gpgme_op_keylist_result): New structure.
	(GpgmeKeyListResult): New type.
	(gpgme_op_keylist_result): New function.
	(gpgme_key_get_as_xml): Remove prototype.
	* context.h (struct gpgme_context_s): Remove members tmp_key,
	tmp_uid, key_cond and key_queue.
	(struct key_queue_item_s): Remove structure.
	(struct user_id_s): Remove structure.
	(struct gpgme_recipients_s): Replace with simple
	GpgmeUserID list.
	* gpgme.c (gpgme_release): Do not release CTX->tmp_key.
	* ops.h (_gpgme_key_add_subkey, _gpgme_key_append_name,
	_gpgme_key_add_sig, _gpgme_trust_item_new): New prototypes.
	* rungpg.c (command_cb): Return GpgmeError instead int.
	New variable ERR.  Use it to hold return value of cmd handler.
	(gpg_delete): Access fingerprint of key directly.
	(append_args_from_signers): Likewise.
	(gpg_edit): Likewise.
	(append_args_from_recipients): Use GpgmeUserID for recipient list.
	* engine-gpgsm.c: Do not include "key.h".
	(gpgsm_delete): Access fingerprint of key directly.
	(gpgsm_sign): Likewise.
	(set_recipients): Use GpgmeUserID for recipients.  Invert invalid
	user ID flag.
	* key.h: File removed.
	* key.c: Completely reworked to use exposed GpgmeKey data types.
	* keylist.c: Likewise.
	* recipient.c: Completely reworked to use GpgmeUserID.

tests/
2003-04-30  Marcus Brinkmann  <marcus@g10code.de>

	* gpg/t-keylist.c: Rewritten.
	* gpgsm/t-keylist.c (main): Rewritten.
	* gpg/t-edit.c (main): Do not use gpgme_key_get_as_xml.  Use
	gpgme_key_unref instead gpgme_key_release.
	* gpg/t-signers.c (main): Use gpgme_key_unref instead
	gpgme_key_release.
2003-04-30 03:02:50 +00:00
Marcus Brinkmann
c476829aba doc/
2003-04-29  Marcus Brinkmann  <marcus@g10code.de>

	* gpgme.texi (Trust Item Management): Add data members of
	GpgmeTrustItem type.
	(Information About Trust Items): Add note about obsoleteness.
	(Manipulating Trust Items): Add gpgme_trust_item_ref and
	gpgme_trust_item_unref.

gpgme/
2003-04-29  Marcus Brinkmann  <marcus@g10code.de>

	* gpgme.h (struct _gpgme_trust_item): New structure.
	(GpgmeTrustItem): New type.
	(gpgme_trust_item_ref, gpgme_trust_item_unref): New prototypes.
	* context.h (struct trust_queue_item_s): Remove structure.
	(struct gpgme_context_s): Remove trust_queue member.
	* Makefile.am (libgpgme_la_SOURCES): Add trust-item.c.
	* trust-item.c: New file.
	* trustlist.c: Do not include <stdio.h> or <time.h>, but
	"gpgme.h".
	(struct trust_queue_item_s): Change to new type op_data_t.
	(trust_status_handler): Change first argument to void *.
	(trust_colon_handler): Likewise.
	(_gpgme_op_trustlist_event_cb): Use op_data_t type.
	(gpgme_op_trustlist_start): Use op_data_t and rework error
	handling.
	(gpgme_op_trustlist_next): Use op_data_t.
	(gpgme_trust_item_release): Remove function.
	(gpgme_trust_item_get_string_attr): Likewise.
	(gpgme_trust_item_get_int_attr): Likewise.

tests/
2003-04-29  Marcus Brinkmann  <marcus@g10code.de>

	* gpg/t-trustlist.c: Rewritten.
2003-04-29 21:53:58 +00:00
Marcus Brinkmann
26ec59fdbd 2003-04-29 Marcus Brinkmann <marcus@g10code.de>
* gpg/t-verify.c (main): Rewritten.
	* gpg/t-decrypt-verify.c: Rewritten.
	* gpgsm/t-verify.c (main): Rewritten.
2003-04-29 20:51:25 +00:00
Marcus Brinkmann
30cdf13284 doc/
2003-04-28  Marcus Brinkmann  <marcus@g10code.de>

	* gpgme.texi (Verify): Rewritten to take into account new and
	deprecated functions and data types.

gpgme/
2003-04-28  Marcus Brinkmann  <marcus@g10code.de>

	* gpgme.h (struct _gpgme_sig_notation): New structure.
	(GpgmeSigNotation): New type.
	(struct _gpgme_signature): New structure.
	(GpgmeSignature): New type.
	(struct _gpgme_op_verify_result): New structure.
	(GpgmeVerifyResult): New type.
	(gpgme_op_verify_result): New prototype.
	(gpgme_get_notation): Remove prototype.
	* ops.h (_gpgme_op_verify_init_result): New prototype.
	(_gpgme_verify_status_handler): Change first argument to void *.
	* util.h (_gpgme_decode_percent_string, _gpgme_map_gnupg_error):
	New prototypes.
	* conversion.c (_gpgme_decode_percent_string): New function.
	(gnupg_errors): New static global.
	(_gpgme_map_gnupg_error): New function.
	* gpgme.c (gpgme_release): Don't release CTX->notation.
	(gpgme_get_notation): Remove function.
	* decrypt-verify.c (_gpgme_op_decrypt_verify_start): Call
	_gpgme_op_verify_init_result.
	* verify.c: Do not include <stdio.h>, <assert.h> and "key.h", but
	do include "gpgme.h".
	(struct verify_result): Replace with ...
	(op_data_t): ... this type.
	(release_verify_result): Remove function.
	(release_op_data): New function.
	(is_token): Remove function.
	(skip_token): Remove function.
	(copy_token): Remove function.
	(gpgme_op_verify_result): New function.
	(calc_sig_summary): Rewritten.
	(finish_sig): Remove function.
	(parse_new_sig): New function.
	(parse_valid_sig): New function.
	(parse_notation): New function.
	(parse_trust): New function.
	(parse_error): New function.
	(_gpgme_verify_status_handler): Rewritten.  Change first argument
	to void *.
	(_gpgme_op_verify_start): Rework error handling.  Call
	_gpgme_op_verify_init_result.
	(gpgme_op_verify): Do not release or clear CTX->notation.
	(gpgme_get_sig_status): Rewritten.
	(gpgme_get_sig_string_attr): Likewise.
	(gpgme_get_sig_ulong_attr): Likewise.
	(gpgme_get_sig_key): Likewise.
2003-04-28 23:59:03 +00:00
Marcus Brinkmann
16c4687a9c 2003-04-28 Marcus Brinkmann <marcus@g10code.de>
* gpgsm/t-decrypt.c (main): Rewritten.
2003-04-28 21:28:22 +00:00
Marcus Brinkmann
174e293252 doc/
2003-04-28  Marcus Brinkmann  <marcus@g10code.de>

	* gpgme.texi (Decrypt): Descript gpgme_op_decrypt_result and
	GpgmeDecryptResult.

gpgme
2003-04-28  Marcus Brinkmann  <marcus@g10code.de>

	* gpgme.h (struct _gpgme_op_decrypt_result): New structure.
	(GpgmeDecryptResult): New type.
	(gpgme_op_decrypt_result): New prototype.
	* ops.h (_gpgme_op_decrypt_init_result): New prototype.
	(_gpgme_decrypt_status_handler): Fix prototype.
	(_gpgme_decrypt_start): Remove prototype.
	* decrypt-verify.c: Do not include <stdio.h>, <stdlib.h>,
	<string.h> and <assert.h>, "util.h" and "context.h", but
	"gpgme.h".
	(decrypt_verify_status_handler): Change first argument to void *,
	and rework error handling.
	(_gpgme_op_decrypt_verify_start): New function.
	(gpgme_op_decrypt_verify_start): Rewrite using
	_gpgme_op_decrypt_verify_start.
	(gpgme_op_decrypt_verify): Likewise.
	* decrypt.c: Include <string.h>, "gpgme.h" and "util.h".
	(struct decrypt_result): Change to typedef op_data_t, rewritten.
	(is_token): Remove function.
	(release_op_data): New function.
	(skip_token): Remove function.
	(gpgme_op_decrypt_result): New function.
	(_gpgme_decrypt_status_handler): Change first argument to void *.
	Rework error handling.
	(_gpgme_decrypt_start): Rename to ...
	(decrypt_start): ... this.  Call _gpgme_op_decrypt_init_result.
	(_gpgme_op_decrypt_init_result): New function.
	(gpgme_op_decrypt_start): Use decrypt_start.
	(gpgme_op_decrypt): Likewise.

tests/
2003-04-28  Marcus Brinkmann  <marcus@g10code.de>

	* gpg/t-decrypt.c: Rewritten.
2003-04-28 21:17:15 +00:00
Marcus Brinkmann
66e29b068e 2003-04-28 Marcus Brinkmann <marcus@g10code.de>
* gpg/t-signers.c (print_data): Rewritten.
2003-04-28 20:23:20 +00:00
Marcus Brinkmann
e30568b240 2003-04-27 Marcus Brinkmann <marcus@g10code.de>
* gpg/t-encrypt-sign.c (check_result): Rewritten.
2003-04-27 22:52:09 +00:00
Marcus Brinkmann
588c16d324 doc/
2003-04-27  Marcus Brinkmann  <marcus@g10code.de>

	* gpgme.texi (Encrypting a Plaintext): Add info about
	GpgmeEncryptResult and gpgme_op_encrypt_result.

gpgme/
2003-04-27  Marcus Brinkmann  <marcus@g10code.de>

	* gpgme.h (GpgmeEncryptResult): New data type.
	(gpgme_op_encrypt_result): New prototype.
	* ops.h (_gpgme_op_encrypt_init_result): New prototype.
	(_gpgme_op_encrypt_status_handler): Fix prototype.
	* encrypt-sign.c (_gpgme_op_encrypt_sign_start): Call
	_gpgme_op_encrypt_init_result.
	* encrypt.c: Do not include <stdio.h>, <assert.h>, "util.h" and
	"wait.h".  Include <errno.h> and "gpgme.h".
	(SKIP_TOKEN_OR_RETURN): Remove macro.
	(struct encrypt_result): Rename to ...
	(op_data_t): ... new data type.  Rewrite for user result data.
	(append_xml_encinfo): Remove function.
	(release_op_data): New function.
	(gpgme_op_encrypt_result): New function.
	(_gpgme_op_encrypt_status_handler): Change first argument to void *.
	Rewrite result parsing.
	(_gpgme_op_encrypt_sym_status_handler): Change first argument to
	void *.
	(_gpgme_op_encrypt_init_result): New function.
	(_gpgme_op_encrypt_start): Rename to ...
	(encrypt_start): ... this.
	(gpgme_op_encrypt_start): Use encrypt_start, not
	gpgme_op_encrypt_start.
	(gpgme_op_encrypt): Likewise.

tests/
2003-04-27  Marcus Brinkmann  <marcus@g10code.de>

	* gpg/t-sign.c: Rewritten.
	* gpgsm/t-sign.c: Rewritten.
	* gpg/t-encrypt.c: Check for invalid recipients.
	* gpgsm/t-encrypt.c: Likewise.
2003-04-27 22:24:37 +00:00
Marcus Brinkmann
88f6eaea9e 2003-04-27 Marcus Brinkmann <marcus@g10code.de>
* gpg/t-import.c (check_result): Really use FPR.
	* gpgsm/t-import.c (check_result): Rewritten.
2003-04-27 18:25:07 +00:00
Marcus Brinkmann
ffa2b2158c doc/
2003-04-25  Marcus Brinkmann  <marcus@g10code.de>

	* gpgme.texi (Importing Keys): Change GPGME_IMPORT_PRIVATE to
	GPGME_IMPORT_SECRET.

gpgme/
2003-04-25  Marcus Brinkmann  <marcus@g10code.de>

	* gpgme.h: Change GPGME_IMPORT_PRIVATE to GPGME_IMPORT_SECRET.
	* import.c (parse_import_res): Parse unchanged field.

tests/
2003-04-25  Marcus Brinkmann  <marcus@g10code.de>

	* gpg/t-import.c: Rewritten.
2003-04-25 17:08:00 +00:00
Marcus Brinkmann
66be7f23a1 2003-04-25 Marcus Brinkmann <marcus@g10code.de>
* gpgsm/t-genkey.c: Rewritten.
	* gpgsm/Makefile.am (noinst_PROGRAMS): Add t-genkey.
	* gpg/t-genkey.c: Include <stdlib.h>.
	(main): Check result->fpr before checking its length.
2003-04-25 12:38:55 +00:00
Marcus Brinkmann
671edce1ae doc/
2003-04-24  Marcus Brinkmann  <marcus@g10code.de>

	* gpgme.texi (Generating Keys): Document changed gpgme_op_genkey
	and new gpgme_op_genkey_result function.  Document
	GpgmeGenKeyResult data type.

gpgme/
2003-04-24  Marcus Brinkmann  <marcus@g10code.de>

	* gpgme.h (struct _gpgme_op_genkey_result): New structure.
	(GpgmeGenKeyResult): New type.
	(gpgme_op_genkey): Drop last argument.
	(gpgme_op_genkey_result): New function.
	* genkey.c: Do not include "util.h", but "gpgme.h".
	(struct genkey_result): Replace with ...
	(op_data_t): ... this new type.
	(release_genkey_result): Replace with ...
	(release_op_data): ... this new function.
	(gpgme_op_genkey_result): New function.
	(genkey_status_handler): Rewritten using new op_data_t type.
	(get_key_parameter): New function.
	(_gpgme_op_genkey_start): Renamed to
	(genkey_start): ... this and rewritten.
	(gpgme_op_genkey_start): Use genkey_start instead
	_gpgme_op_genkey_start.
	(gpgme_op_genkey): Rewritten.  Remove FPR argument.

tests/
2003-04-24  Marcus Brinkmann  <marcus@g10code.de>

	* gpg/t-genkey.c: Rewritten to match new semantics.
2003-04-24 17:16:28 +00:00
Marcus Brinkmann
5a37051361 doc/
2003-02-06  Marcus Brinkmann  <marcus@g10code.de>

	* gpgme.texi (Cancelling an Operation): Removed.
	(Passphrase Callback): Document new type for GpgmePassphraseCb.

gpgme/
2003-02-06  Marcus Brinkmann  <marcus@g10code.de>

	* gpgme.h (GpgmePassphraseCb): Change type to return GpgmeError,
	and add argument for returning the result string.
	(gpgme_cancel): Remove prototype.
	* gpgme.c (gpgme_cancel): Remove function.
	* context.h (struct gpgme_context_s): Remove member cancel.
	* passphrase.c (_gpgme_passphrase_command_handler): Call the
	passphrase callback in the new way.

tests/
2003-02-06  Marcus Brinkmann  <marcus@g10code.de>

	* gpg/t-decrypt.c (passphrase_cb): Fix to new prototype.
	* gpg/t-decrypt-verify.c (passphrase_cb): Likewise.
	* gpg/t-edit.c (passphrase_cb): Likewise.
	* gpg/t-encrypt-sign.c (passphrase_cb): Likewise.
	* gpg/t-encrypt-sym.c (passphrase_cb): Likewise.
	* gpg/t-sign.c (passphrase_cb): Likewise.
	* gpg/t-signers.c (passphrase_cb): Likewise.
2003-02-06 20:09:24 +00:00
Marcus Brinkmann
d102681aef doc/
2003-01-30  Marcus Brinkmann  <marcus@g10code.de>

	* gpgme.texi (Engine Information): Rename member part to
	file_name.

gpgme/
2003-01-30  Marcus Brinkmann  <marcus@g10code.de>

	* engine-backend.h (struct engine_ops): Rename get_path to
	get_file_name.
	* gpgme.h (struct _gpgme_engine_info): Rename member path to
	file_name.
	* version.c: Do not include <stdio.h>, <stdlib.h>, context.h and
	util.h.  Other clean ups.
	(parse_version_number): Protect more seriously against
	overflow.
	(gpgme_get_engine_info): Move to ...
	* engine.c (gpgme_get_engine_info): ... here.
	(_gpgme_engine_get_info): Function removed.
	(_gpgme_engine_get_path): Make static and rename to ...
	(engine_get_file_name): .. this.
	(_gpgme_engine_get_version): Make static and rename to ...
	(engine_get_version): ... this.
	(_gpgme_engine_get_req_version): Make static and rename to ...
	(engine_get_req_version): ... this.
	* engine.h (_gpgme_engine_get_path, _gpgme_engine_get_version,
	_gpgme_engine_req_version, _gpgme_engine_get_info.): Remove
	prototypes.

tests/
2003-01-30  Marcus Brinkmann  <marcus@g10code.de>

	* t-engine-info.c: Use file_name instead path throughout.
2003-01-30 13:11:25 +00:00
Marcus Brinkmann
fdbee6b211 doc/
2003-01-30  Marcus Brinkmann  <marcus@g10code.de>

	* gpgme.texi (Engine Information): Rewritten.

gpgme/
2003-01-30  Marcus Brinkmann  <marcus@g10code.de>

	* gpgme.h (enum GpgmeProtocol): Remove GPGME_PROTOCOL_AUTO.
	* gpgme.c (gpgme_set_protocol): Don't handle GPGME_PROTOCOL_AUTO.
	(gpgme_get_protocol_name): New function.

	* engine-backend.h (struct engine_ops): New member
	get_req_version, remove member check_version.
	* engine.h (_gpgme_Engine_get_version): New prototype.
	* rungpg.c (gpg_get_req_version): New function.
	(gpg_check_version): Function removed.
	(_gpgme_engine_ops_gpg): Add gpg_get_req_version, remove
	gpg_check_version.
	* engine-gpgsm.c (gpgsm_get_req_version): New function.
	(gpgsm_check_version): Function removed.
	(_gpgme_engine_ops_gpgsm): Add gpgsm_get_req_version, remove
	gpgsm_check_version.
	* engine.c: Include ops.h.
	 (_gpgme_engine_get_req_version): New function.
	(gpgme_engine_check_version): Rewritten.
	* version.c (gpgme_get_engine_info): Rewritten.
	* gpgme.h (gpgme_engine_info): New structure.
	(GpgmeEngineInfo): New type.

tests/
2003-01-30  Marcus Brinkmann  <marcus@g10code.de>

	* Makefile.am (TESTS): Add t-engine-info.
	* t-engine-info.c: New file.
	* gpg/t-encrypt.c (main): Don't print engine info.
	* gpg/t-eventloop.c (main): Likewise.
	* gpg/t-encrypt-sign.c (main): Likewise.
	* gpgsm/t-encrypt.c (main): Likewise.
2003-01-30 11:54:23 +00:00
Marcus Brinkmann
b6e5bb310e doc/
2002-12-24  Marcus Brinkmann  <marcus@g10code.de>

	* gpgme.texi (Verify): Drop R_STAT argument in gpgme_op_verify.
	* gpgme.texi (Decrypt and Verify): Likewise for
	gpgme_op_decrypt_verify.

gpgme/
2002-12-24  Marcus Brinkmann  <marcus@g10code.de>

	* gpgme.h (gpgme_op_verify, gpgme_op_decrypt_verify): Drop R_STAT
	argument.
	* decrypt-verify.c (gpgme_op_decrypt_verify): Drop R_STAT
	argument.
	* verify.c (gpgme_op_verify): Drop R_STAT argument.
	(_gpgme_intersect_stati): Function removed.
	* ops.h (_gpgme_intersect_stati): Remove prototype.

tests/
2002-12-24  Marcus Brinkmann  <marcus@g10code.de>

	* gpgsm/t-verify.c (main): Adjust caller of gpgme_op_verify.
	* gpg/t-verify.c (main): Likewise.
	* gpg/t-decrypt-verify.c (main): Likewise for
	gpgme_op_decrypt_verify.
2002-12-24 13:08:56 +00:00
Marcus Brinkmann
c60bcb31ad 2002-12-23 Marcus Brinkmann <marcus@g10code.de>
* gpgsm/Makefile.am (./gpgsm.conf): Add a faked system time to
	avoid certification's expiry.
	* gpgsm/t-encrypt.c (main): Use the short certification name.
2002-12-23 21:06:38 +00:00
Marcus Brinkmann
dfc32a5441 doc/
2002-11-19  Marcus Brinkmann  <marcus@g10code.de>

	* gpgme.texi (Generating Keys): Document new argument to
	gpgme_op_genkey.

gpgme/
2002-11-19  Marcus Brinkmann  <marcus@g10code.de>

	* genkey.c: Only include <config.h> if [HAVE_CONFIG_H].
	(struct genkey_result_s): Add new member FPR.
	(_gpgme_release_genkey_result): Free RESULT->fpr if set.
	(genkey_status_handler): Extract the fingerprint from the status
	line.
	(gpgme_op_genkey): Add new argument FPR and return the fingerprint
	in it.
	* gpgme.h: Adjust prototype of gpgme_op_genkey.

tests/
2002-11-19  Marcus Brinkmann  <marcus@g10code.de>

	* gpg/t-genkey.c (main): Add missing argument to gpgme_op_genkey
	invocation.
CVSk: ----------------------------------------------------------------------
2002-11-19 16:41:17 +00:00
Marcus Brinkmann
0447e0dd6d gpgme/
2002-10-08  Marcus Brinkmann  <marcus@g10code.de>

	New data object component:

	* gpgme.h (GpgmeDataReadCb, GpgmeDataWriteCb, GpgmeDataSeekCb,
	GpgmeDataReleaseCb): New types.
	(struct GpgmeDataCbs): New structure.
	(gpgme_data_read): Changed prototype to match that of read() closely.
	(gpgme_data_write): Similar for write().
	(gpgme_data_seek, gpgme_data_new_from_cbs, gpgme_data_new_from_fd,
	gpgme_data_new_from_stream): New prototypes.
	(gpgme_data_get_type, gpgme_check_engine): Prototype removed.

	* Makefile.am (libgpgme_la_SOURCES): Add data.h, data-fd.c,
	data-stream.c, data-mem.c, data-user.c and data-compat.c.
	* data.c: Reimplemented from scratch.
	* (data-compat.c, data-fd.c, data.h, data-mem.c, data-stream.c,
	data-user.c): New file.
	* context.h (struct gpgme_data_s): Removed.
	* conversion.c: Include <errno.h> and <sys/types.h>.
	(_gpgme_data_append): New function.
	* data.c (_gpgme_data_append_string): Move to ...
	* conversion.c (_gpgme_data_append_string): ... here.
	* data.c (_gpgme_data_append_for_xml): Move to ...
	* conversion.c (_gpgme_data_append_for_xml): ... here.
	* data.c (_gpgme_data_append_string_for_xml): Move to ...
	* conversion.c (_gpgme_data_append_string_for_xml): ... here.
	* data.c (_gpgme_data_append_percentstring_for_xml): Move to ...
	* conversion.c (_gpgme_data_append_percentstring_for_xml): ... here.

	* ops.h (_gpgme_data_get_mode, _gpgme_data_set_mode): Prototype
	removed.
	* types.h (GpgmeDataMode): Type removed.

	* decrypt.c (_gpgme_decrypt_start): Don't check data type or mode.
	* edit.c (_gpgme_op_edit_start): Likewise.
	* encrypt.c (_gpgme_op_encrypt_start): Likewise.
	* encrypt-sign.c (_gpgme_op_encrypt_sign_start): Likewise.
	* encrypt-sign.c (_gpgme_op_encrypt_sign_start): Likewise.
	* export.c (_gpgme_op_export_start): Likewise.
	* genkey.c (_gpgme_op_genkey_start): Likewise.
	* import.c (_gpgme_op_import_start): Likewise.
	* sign.c (_gpgme_op_sign_start): Likewise.
	* verify.c (_gpgme_op_verify_start): Likewise.

	* encrypt.c (gpgme_op_encrypt): Remove hack that returns invalid
	no recipient if no data was returned.
	* encrypt-sign.c (gpgme_op_encrypt_sign): Remove hack that returns
	no recipient if no data was returned.
	* encrypt-sign.c (gpgme_op_encrypt_sign): Remove hack that returns
	no recipient if no data was returned.

	* engine.c (_gpgme_engine_op_verify): Add new argument to
	differentiate detached from normal signatures.
	* engine.h (_gpgme_engine_op_verify): Likewise for prototype.
	* engine-gpgsm.c (_gpgme_gpgsm_op_verify): Likewise.  Don't check
	mode of data argument.
	* engine-gpgsm.h (_gpgme_gpgsm_op_verify): Likewise for prototype.
	* gpgme.h (gpgme_op_verify_start): Likewise for prototype.
	(gpgme_op_verify): Likewise for prototype.
	* rungpg.c (_gpgme_gpg_op_verify): Likewise.
	* rungpg.h (_gpgme_gpg_op_verify): Likewise for prototype.
	* verify.c (_gpgme_op_verify_start): Likewise.
	(gpgme_op_verify_start): Likewise.
	(gpgme_op_verify): Likewise.

	* rungpg.c (struct arg_and_data_s): New member INBOUND to hold
	direction of data object.
	(_gpgme_gpg_add_data): Add new argument INBOUND.  Use it to
	determine direction of data object.
	(_gpgme_gpg_add_pm_data, _gpgme_gpg_set_command_handler,
	_gpgme_gpg_op_decrypt, _gpgme_gpg_op_edit, _gpgme_gpg_op_encrypt,
	_gpgme_gpg_op_encrypt_sign, _gpgme_gpg_op_export,
	_gpgme_gpg_op_genkey, _gpgme_gpg_op_import, _gpgme_gpg_op_sign,
	_gpgme_gpg_op_verify): Add new argument to _gpgme_gpg_add_data
	invocation.
	(build_argv): Use new member INBOUND to determine direction of
	file descriptor.  Don't check the data type.
	* rungpg.h (_gpgme_gpg_add_data): Add new argument to prototype.

	* gpgme.c (gpgme_get_op_info): Don't call
	_gpgme_data_get_as_string if CTX->op_info is NULL.

	* version.c (gpgme_check_engine): Function removed.


tests/
2002-10-09  Marcus Brinkmann  <marcus@g10code.de>

	* gpg/t-decrypt.c (print_data): Update to new gpgme_data_read
	interface, and use gpgme_engine_check_version instead
	gpgme_check_version.
	* gpg/t-decrypt-verify.c (print_data): Likewise.
	* gpg/t-edit.c (main): Likewise.
	* gpg/t-encrypt.c (print_data): Likewise.
	* gpg/t-encrypt-sign.c (print_data): Likewise.
	* gpg/t-encrypt-sym.c (print_data): Likewise.
	* gpg/t-eventloop.c (print_data): Likewise.
	* gpg/t-export.c (print_data): Likewise.
	* gpg/t-sign.c (print_data): Likewise.
	* gpg/t-signers.c (print_data): Likewise.
	* gpgsm/t-decrypt.c (print_data): Likewise.
	* gpgsm/t-encrypt.c (print_data): Likewise.
	* gpgsm/t-export.c (print_data): Likewise.
	* gpgsm/t-sign.c (print_data): Likewise.
	* gpg/t-verify.c (main): Likewise for gpgme_op_verify.
	* gpgsm/t-verify.c (main): Likewise for gpgme_op_verify.
	* t-data.c (read_once_test): Likewise.
	(write_test): Update for new behaviour of data objects.
	(main): Remove type test.
2002-10-09 00:16:38 +00:00
Werner Koch
d256945205 * gpgsm/t-keylist.c (doit): Add arg SECRET.
(main): Add option --secret.
2002-09-30 08:03:56 +00:00
Marcus Brinkmann
e9f9833e05 2002-09-28 Marcus Brinkmann <marcus@g10code.de>
* t-version.c: Include <string.h>.  Reported by St�phane Corth�sy.
2002-09-28 20:09:12 +00:00