* src/debug.h (TRACE_BEG, TRACE_LOG, TRACE_SUC): Use variadic macros
and remove the TRACE_BEG1 et al. Change all users to always pass a
format string.
(TRACE): Ditto.
* src/debug.c (_gpgme_debugf): New.
* configure.ac <GCC>: Add -Wno-format-zero-length.
--
This makes it easier for use to enable format checks. The zero-length
format is required to allow for an empty format due to the comman
problematic of __VA_ARGS__.
Signed-off-by: Werner Koch <wk@gnupg.org>
* tests/Makefile.am (run-threaded): Add.
* tests/run-threaded.c: New.
--
This test is intended to help detect race conditions
or other multithread problems. It can also be used
to put the whole GnuPG system under extreme load.
* tests/gpg/t-support.h (check_gpg_version, compare_versions),
(parse_version_string, parse_version_number): Remove version
check code.
* tests/json/t-json.c (check_gpg_version, compare_versions),
(parse_version_string, parse_version_number): Add.
--
t-support header was not a good place for this. It should
go into a library e.g. gpgrt in the future. For now we
can keep it close to where it is needed.
* t-config-opt.in.json,
t-config-opt.out.json,
t-import.in.json,
t-import.out.json,
t-sign.in.json,
t-sign.out.json: New.
--
These should actually have been in a previous commit as
they are already registered.
* tests/json/t-json.c (test_contains): Try all siblings of
the haystack child.
--
This fixes the case where we don't match against the
first child because the order might have changed or
a new element was inserted at the top. Then we
have to try out also all the siblings.
* t-json.c (tests): Register new tests.
* t-createkey.in.json,
t-createkey.out.json,
t-decrypt-verify.in.json,
t-decrypt-verify.out.json,
t-decrypt.in.json,
t-decrypt.out.json,
t-delete.in.json,
t-delete.out.json,
t-encrypt-sign.in.json,
t-encrypt-sign.out.json,
t-encrypt.in.json,
t-encrypt.out.json,
t-export-secret-info.in.json,
t-export-secret-info.out.json,
t-export.in.json,
t-export.out.json,
t-json.c,
t-keylist-secret.in.json,
t-keylist-secret.out.json,
t-keylist.in.json,
t-keylist.out.json,
t-verify.in.json,
t-verify.out.json,
t-version.in.json,
t-version.out.json: New.
--
Except for help and getmore there is now a test for each command.
* tests/json/t-json.c (test_contains): When searching for "*" accept
every string.
--
This allows it to write tests that check for the existence of
a string value but don't care about the contents. E.g. for Data.
* tests/json/t-json.c (main): Skip if version is not at least
2.2.0
--
In the past new tests often failed when a modern GPGME was
used with old GnuPG's.
This should avoid the hassle for packagers without the
requirement that we test against old versions.
* t-support.h (parse_version_number, parse_version_string)
(compare_versions): New. Copy&Paste from src/version.c
(check_gpg_version): New helper to check for a gpg version.
--
This should make it easier to write tests that e.g.
rely on modern gnupg features.
* configure.ac: Configure makefile.
* tests/Makefile.am: Run json tests if gpg tests are run.
* tests/json/t-json.c: New testrunner for json tests.
* tests/json/t-config.in, tests/json/t-config.out: First test.
--
The idea of this test runner is that it only looks for parts
in the output. This should allow it to write robust tests
that check for the basics in the output but don't fail when
the output is extended or slightly changed.
* src/gpgme.m4 (_AM_PATH_GPGME_CONFIG): Use gpgrt-config with gpgme.pc
when possible.
(AM_PATH_GPGME_GLIB): Likewise with gpgme-glib.pc.
--
Keeping AM_PATH_GPGME_PTHREAD, as is, untouched.
Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
* src/gpgme-glib.pc.in: New.
* src/gpgme.pc.in (avail_lang): Remove.
--
Provide gpgme-glib.pc for gpgme-glib library. The avial_lang
information is no use because *.pc is for C.
Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
* configure.ac: Generate src/gpgme.pc.
* src/Makefile.am (pkgconfigdir, pkgconfig_DATA): New.
(EXTRA_DIST): Add gpgme.pc.in.
* src/gpgme.pc.in: New.
* src/gpgme-config.in: Use variables.
--
Some usages of gpgme-config is not compatible to pkg-config style;
The --glib option and --thread option which affect the output
by --cflags or --libs are not supported by gpgme.pc.
gpgme-config's embedding information for gpg-error and libassuan at
the build time of gpgme is considered inflexible than pkg-config
style. It is now handled by dependency of gpgme.pc (Requires field).
To use gpgme.pc, newer libgpg-error (>= 1.33) and libassuan (>= 2.5.3)
are required, which provide gpg-error.pc and libassuan.pc respectively.
Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
* Continued restructuring as part of moving beyond mere;y the HOWTO
file.
* Generated the alternative source files for reST and Texinfo.
* Fixed some errors and updated links after moving the what's new
section to two new files (yes, two).
* src/w32-io.c (close_handle, _close_handle): New macro and function;
use in place of all CloseHandle calls.
(wait_for_single_object, _wait_for_single_object): Likewise.
Signed-off-by: Werner Koch <wk@gnupg.org>
* src/assuan-support.c (my_waitpid): Do not close the PID = it is not
a handle.
--
At some time in the distant past we might have used the process object
as pid which obviously required a close. However this was changed and
so what we did here was to close an arbitrary handle (one which
matches the pid).
GnuPG-bug-id: 4237
Signed-off-by: Werner Koch <wk@gnupg.org>
* src/w32-io.c (hddesc_t): New.
(reader_context_s, writer_context_s): Replace file_sock and file_hd by
the hddesc_t hdd.
(fd_table): Ditto. Add want_reader and want_writer.
(hddesc_lock): New lock variable.
(new_hddesc, ref_hddesc): New.
(release_hddesc): New.
(reader, writer): Call release_hddesc.
(create_reader, create_writer): Change for new hddesc scheme.
(destroy_reader, destroy_writer): Replace closing by a call to
release_hddesc.
(_gpgme_io_pipe): Change for new hddesc scheme.
(_gpgme_io_close): Ditto.
(_gpgme_io_dup): Ditto. Use want_reader and want_writer.
(_gpgme_io_socket): Change for new hddesc scheme.
--
GnuPG-bug-id: 4237
Signed-off-by: Werner Koch <wk@gnupg.org>
* src/debug.h (TRACE_SUC3): New.
(TRACE_LOGBUFX): New.
* src/posix-io.c: Use TRACE_LOGBUFX instead of TRACE_LOGBUF.
* src/w32-glib-io.c: Ditto.
--
This will also be changed for w32-io as part of another commit.
Signed-off-by: Werner Koch <wk@gnupg.org>
* src/w32-util.c (_gpgme_w32_cancel_synchronous_io): Fix name of DLL
and print trace info only on error.
--
Fixes-commit: 63ba09b541
Signed-off-by: Werner Koch <wk@gnupg.org>
* src/w32-util.c (_gpgme_w32_cancel_synchronous_io): New.
* src/w32-io.c (destroy_reader): Use it here.
--
This has not been tested but should on Vista and later help to fix a
possible hang.
Signed-off-by: Werner Koch <wk@gnupg.org>
* src/w32-io.c (fd_table_size): New. Used in most places instead of
the MAX_SLAFD constant.
(reader_table, writer_table, notify_table): Merge them into ...
(fd_table): this table. Chnage all affected code to take just one
lock.
Signed-off-by: Werner Koch <wk@gnupg.org>
* src/w32-io.c (find_reader, find_writer): Remove unused start_it
arg. It is always passed as true. Change callers.
Signed-off-by: Werner Koch <wk@gnupg.org>
* configure.ac: Remove WindwosCE support.
* contrib/: Remove all; it was only used for WindowsCE.
* src/w32-ce.c, src/w32-ce.h: Remove files.
* src/Makefile.am (system_components): Remove these files.
* src/ath.c, src/ath.h: Remove W32CE support.
* src/data-compat.c (gpgme_data_new_from_filepart): Ditto.
(gpgme_data_new_from_file): Ditto.
* src/debug.c (debug_init, _gpgme_debug): Ditto.
* src/gpgme-tool.c (gpgme_server): Ditto.
(main): Ditto.
* src/priv-io.h: Do not include w32-ce.h.
* src/util.h: Remove WindowsCE support.
* src/w32-io.c: Ditto.
* src/w32-util.c: Ditto.
* src/debug.h (TRACE_SUC4): New.
--
There is no more hardware to test our code, the support for Windows CE
terminated along time ago. Note that our code worked only with the
old WindowsCE with that overall system limit of 31 processes.
Signed-off-by: Werner Koch <wk@gnupg.org>
* src/w32-io.c (set_synchronize): Remove.
(create_reader, create_writer): No need for set_synchronize.
--
The set_synchronize dates back to 2001 at a time when I wrote the
Windows support on WindowsME and Windows2000. Maybe this was required
then due to bugs in that old NT or partly NT based Windows versions.
Signed-off-by: Werner Koch <wk@gnupg.org>
* src/engine-gpgsm.c (gpgsm_verify): Fix handling both
plaintext and signed_text as NULL.
--
Previously if plaintext was NULL and signed_text was NULL
it would set MESSAGE_FD to NULL which resulted in a
crash.
Ignoring the plaintext of an opaque signature might
make sense in some cases and engine-gpg handles it.
* lang/cpp/tests/run-verify.cpp: New.
* lang/cpp/tests/Makefile.am: Update accordingly.
--
Add another test runner which helps to find problems on windows.
* lang/cpp/src/context.cpp (Context::create): New.
* lang/cpp/src/context.h: Update accordingly.
* lang/cpp/src/key.cpp, lang/cpp/src/key.h:
(Key::isBad, Subkey::isBad, UserID::isBad)
(UserID::Signature::isBad): Add shorthand for the isX checks.
* NEWS: Mention it.
--
I don't know how often I wrote:
if (key.isNull() || key.isExpired() || key.isRevoked() ...
And for the context it is good practice to use a unique ptr
so the API should make it easy.
* Fixed a minor error in how the reST version of the HOWTO is
generated.
* Updated the help() in __init__.py with a little more detail as to
why not to use the lower level functions.