* 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.
* lang/python/tests/t-callbacks.py: Updated test logic to try
generating a key which expires in 2099 and if that fails then
fallback to an expiration in 2037 in an attempt to catch the 32-bit
systems.
* src/genkey.c (get_key_parameter): Provide a fallback ENDTAG.
--
It would actually be more correct to return an error in this case but
it is possible tha there are users who did not provide an endtag and
out of luck they also didn't trigger a segv.
GnuPG-bug-id: 4192
Signed-off-by: Werner Koch <wk@gnupg.org>
* src/debug.c (_gpgme_debug_buffer): Bail out of BUF is NULL.
* src/genkey.c (gpgme_op_genkey): Do no deref a NULL in
TRACE_LOGBUF.
(gpgme_op_genkey_start): Ditto. Return an error if PARMS is NULL.
--
This robustness patch should solve one part of
GnuPG-bug-id: 4192
Signed-off-by: Werner Koch <wk@gnupg.org>
* lang/python/gpgme.i: ignore HAVE_CXX11 in SWIG interface
--
If there are two distinct builds (a) and (b) of gpgme which both build
python bindings, and build (a) also happens to build the C++ bindings,
then the generated gpg/gpgme.py file from build (a) will not be usable
with the .so generated in build (b), despite them being exactly the
same, and having nothing to do with C++.
In particular, it will fail with:
-----------
File "…/gpg/__init__.py", line 99, in <module>
from . import core
File "…/gpg/core.py", line 10, in <module>
from . import gpgme
File "…/gpg/gpgme.py", line 152, in <module>
HAVE_CXX11 = _gpgme.HAVE_CXX11
AttributeError: module 'gpg._gpgme' has no attribute 'HAVE_CXX11'
-----------
By asking SWIG to ignore this definition, we stabilize the generated
.py and the .so, ensuring that they are more cleanly interoperable.
* m4/python.m4 (AM_PATH_PYTHON): Add a 4th arg.
* configure.ac (available_languages): Remove separate python2 and
python3 and keep just python. Simplify test for pythons. Use an
explicit list of python versions to test.
--
This seems to be a starightforward chnage to support more than two
python versions. I am not sure why we had that complicated thing
before. On my box I get builds and run tests for 2.7, 3.4 and 3.5.
If 3.6, 3.7 or 3.8 are installed they should also work.
GnuPG-bug-id: 3354
Signed-off-by: Werner Koch <wk@gnupg.org>
--
* Use wrapper types calling translation functions instead of
TRANSLATE-{FROM,TO}-FOREIGN methods as they seem not to be
called in some cases.
* Use the (:STRUCT SOME-C-STRUCT) notation instead of the
deprecated direct reference to SOME-C-STRUCT.
* Add missing values in enums and bit fields.
* Use cffi-grovel to define system types (SIZE-T, OFF-T, etc).
* Wrap GPGME-DATA-T in a class (like contexts).
* Use the FINALIZE function from trivial-garbage to free the
C objects for contexts, keys and data automatically.
* Make DATA-READ-CB and DATA-WRITE-CB run faster.
* Update the README file.
Signed-off-by: Guillaume LE VAILLANT <glv@posteo.net>
* autogen.sh: Update from libgpg-error.
* configure.ac: Use mym4_version to create VERSION file.
* Makefile.am (dist-hook): Do not create VERSION.
(EXTRA_DIST): Add VERSION.
--
GnuPG-bug-id: 3283
Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
* lang/cpp/Makefile.am: Add tests subdir.
* lang/cpp/tests/Makefile.am: New.
* lang/cpp/tests/README,
lang/cpp/tests/run-getkey.cpp,
lang/cpp/tests/run-keylist.cpp: New.
* configure.ac: Configure tests makefile.
--
The autotests for c++ live in lang/qt/tests these
tests are more for manual experiments to validate some
functionality.
* src/context.h (gpgme_context): Extend with trust_model.
* src/engine-gpg.c (engine_gpg): Extend with trust_model.
(gpg_set_engine_flags): Take trust_model from context.
(build_argv): Handle trust_model.
(gpg_release): Free trust_model.
* src/gpgme.c (gpgme_set_ctx_flag): Handle trust-model flag.
(gpgme_release): Release trust-model.
* doc/gpgme.texi: Document new flag for gpgme_set_ctx_flag.
(Context Flags): New subsection for the context flags.
* tests/run-keylist.c (show_usage, main): Add new --trust-model
parameter.
--
This gives a GPGME user fine grained control over the
trust-model.
Changing the trust model for only a single application depends
on:
GnuPG-Bug-Id: T4134
Maniphest Tasks: T4134
Differential Revision: https://dev.gnupg.org/D466
* lang/cpp/src/context.cpp (Context::startKeyListing),
(Context::keyListResult, Context::signingKeys): Initialize key.
--
"Should" not be neccessary but it's cleaner and would have
covered the case of the previous commit.
* src/keylist.c (gpgme_get_key): Move r_key init above
the first invalid value check.
--
This fixes the case where someone passes an unitialized
r_key and no fingerprint.