gpgme.git
3 years agoCpp: Clarify ownership of provider classes
Andre Heinecke [Wed, 10 Aug 2016 10:04:16 +0000 (12:04 +0200)]
Cpp: Clarify ownership of provider classes

* lang/cpp/src/context.h: Note that the context does not take
ownership of providers.

3 years agotests: Fix memory leak.
Justus Winter [Wed, 10 Aug 2016 08:37:31 +0000 (10:37 +0200)]
tests: Fix memory leak.

* tests/gpg/t-encrypt-mixed.c (main): Free 'text2'.

Signed-off-by: Justus Winter <justus@g10code.com>
3 years agocore: Ensure err is initalized in gpg_encrypt
Andre Heinecke [Wed, 10 Aug 2016 08:27:05 +0000 (10:27 +0200)]
core: Ensure err is initalized in gpg_encrypt

* src/engine-gpg.c (gpg_encrypt): Initialize err.

3 years agoQt: Fix t-keylist moc include
Andre Heinecke [Wed, 10 Aug 2016 07:50:26 +0000 (09:50 +0200)]
Qt: Fix t-keylist moc include

* lang/qt/tests/t-keylist.cpp: Don't include t-support.moc

--
Accidental leftover from trying to generate t-support moc from
another cpp file. This was solved instead by a new rule to generate
moc files from the header.

3 years agoQt: Clean up debug output in tests
Andre Heinecke [Tue, 9 Aug 2016 16:39:56 +0000 (18:39 +0200)]
Qt: Clean up debug output in tests

* lang/qt/tests/t-support.cpp: Remove accidentally commited
debug output.

3 years agoQt: Add encryption test and refactor testsuite
Andre Heinecke [Tue, 9 Aug 2016 12:10:15 +0000 (14:10 +0200)]
Qt: Add encryption test and refactor testsuite

* lang/qt/tests/Makefile.am: Add t-encrypt and t-support.
* lang/qt/tests/t-support.cpp, lang/qt/tests/t-support.c (QGpgMETest):
New. Class to handle common cleanup / init.
* lang/qt/tests/t-keylist.cpp,
lang/qt/tests/t-keylocate.cpp,
lang/qt/tests/t-ownertrust.cpp,
lang/qt/tests/t-tofuinfo.cpp: Inherit QGpgMETest.
* lang/qt/tests/t-encrypt.cpp: New. Test Symetric and Asymectric
encryption. Mixed encryption test is disabled.

3 years agoQt: Add support for EncryptJobs with generic flags
Andre Heinecke [Tue, 9 Aug 2016 11:10:08 +0000 (13:10 +0200)]
Qt: Add support for EncryptJobs with generic flags

* lang/qt/src/encryptjob.h, lang/qt/src/signencryptjob.h,
lang/qt/src/qgpgmeencryptjob.h, lang/qt/src/qgpgmeencryptjob.cpp,
lang/qt/src/qgpgmesignencryptjob.cpp,
lang/qt/src/qgpgmeencryptjob.cpp: Add start and exec overloads
that accept generic EncryptFlags.

--
While this technically is an ABI break (vtable change) there
are no known classes outside qgpgme that inherit encryptjob
or signencryptjob. And the new functions should be added
to the bottom of the vtable.

3 years agoCpp: Add support for all EncryptionFlags
Andre Heinecke [Tue, 9 Aug 2016 11:07:30 +0000 (13:07 +0200)]
Cpp: Add support for all EncryptionFlags

* lang/cpp/src/context.h (EncryptionFlags): Extend.
* lang/cpp/src/context.cpp (encryptflags2encryptflags): Ditto.

3 years agoCpp: Fix simple symmetric encryption
Andre Heinecke [Tue, 9 Aug 2016 10:56:01 +0000 (12:56 +0200)]
Cpp: Fix simple symmetric encryption

* lang/cpp/src/context.cpp (Context::encrypt): If no recipients
are provided encrypt with NULL and not an empty array.

--
Sending an empty array leads to an invalid argument error.

3 years agocore: Add support for mixed symmetric and asym enc
Andre Heinecke [Tue, 9 Aug 2016 09:40:29 +0000 (11:40 +0200)]
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.

3 years agocore: Let GPGME_PROTOCOL_ASSUAN pass Assuan comments through.
Werner Koch [Mon, 8 Aug 2016 15:02:54 +0000 (17:02 +0200)]
core: Let GPGME_PROTOCOL_ASSUAN pass Assuan comments through.

* src/engine-assuan.c (llass_new): Set ASSUAN_CONVEY_COMMENTS,
--

GnuPG-bug-id: 2429
Signed-off-by: Werner Koch <wk@gnupg.org>
3 years agoPrepend LD_LIBRARY_PATH for python tests
Andre Heinecke [Mon, 8 Aug 2016 13:04:01 +0000 (15:04 +0200)]
Prepend LD_LIBRARY_PATH for python tests

* lang/python/tests/Makefile.am (TESTS_ENVIRONMENT): Prepend path
instead of setting the value.

--
This fixes the case where tools / libararies are needed for
a working GnuPG system that are pointed to by LD_LIBRARY_PATH.
E.g. GnuPG itself is installed in a custom prefix and PATH /
LD_LIBRARY_PATH is set accordingly.

3 years agopython: Clean up and modernize examples.
Justus Winter [Fri, 5 Aug 2016 12:03:15 +0000 (14:03 +0200)]
python: Clean up and modernize examples.

* lang/python/examples/Examples.rst: Delete file.
* lang/python/examples/t-edit.py: Likewise.  This is actually a test
case and has been moved to 'tests'.
* lang/python/examples/assuan.py: New file.
* lang/python/examples/decryption-filter.py: Likewise.
* lang/python/examples/delkey.py: Modernize.
* lang/python/examples/encrypt-to-all.py: Likewise.
* lang/python/examples/exportimport.py: Likewise.
* lang/python/examples/genkey.py: Likewise.
* lang/python/examples/inter-edit.py: Likewise.
* lang/python/examples/sign.py: Likewise.
* lang/python/examples/signverify.py: Likewise.
* lang/python/examples/simple.py: Likewise.
* lang/python/examples/testCMSgetkey.py: Likewise.
* lang/python/examples/verifydetails.py: Likewise.

Signed-off-by: Justus Winter <justus@g10code.com>
3 years agocore: Extend gpgme_subkey_t to carry the keygrip.
Werner Koch [Thu, 4 Aug 2016 14:17:01 +0000 (16:17 +0200)]
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>
3 years agopython: Add a nicer interface to list keys.
Justus Winter [Wed, 3 Aug 2016 14:32:30 +0000 (16:32 +0200)]
python: Add a nicer interface to list keys.

* lang/python/pyme/core.py (Context.keylist): New method.
* lang/python/tests/t-keylist.py: Test new method.

Signed-off-by: Justus Winter <justus@g10code.com>
3 years agopython: Add a flag identifying in-tree builds.
Justus Winter [Tue, 2 Aug 2016 16:45:10 +0000 (18:45 +0200)]
python: Add a flag identifying in-tree builds.

* lang/python/helpers.c (pyme_in_tree_build): New variable.
* lang/python/helpers.h (pyme_in_tree_build): New declaration.
* lang/python/pyme/version.py.in (in_tree_build): New variable.
* lang/python/setup.py.in: Rework macro handling, set 'IN_TREE_BUILD'
as appropriate.

Signed-off-by: Justus Winter <justus@g10code.com>
3 years agopython: Fix build system integration.
Justus Winter [Tue, 2 Aug 2016 16:42:26 +0000 (18:42 +0200)]
python: Fix build system integration.

* lang/python/Makefile.am: Be more careful when cleaning the build
directory, we must not delete the generated file 'pyme/version.py'.

Signed-off-by: Justus Winter <justus@g10code.com>
3 years agodoc: Document the Assuan protocol.
Justus Winter [Tue, 2 Aug 2016 14:51:08 +0000 (16:51 +0200)]
doc: Document the Assuan protocol.

* doc/gpgme.texi: Document the Assuan protocol.

GnuPG-bug-id: 2407
Signed-off-by: Justus Winter <justus@g10code.com>
3 years agodoc: Fix formatting.
Justus Winter [Tue, 2 Aug 2016 14:50:54 +0000 (16:50 +0200)]
doc: Fix formatting.

--
Signed-off-by: Justus Winter <justus@g10code.com>
3 years agopython: Fix out-of-tree build.
Justus Winter [Thu, 28 Jul 2016 16:14:08 +0000 (18:14 +0200)]
python: Fix out-of-tree build.

* lang/python/MANIFEST.in: Add 'private.h'.

Fixes-commit: 3d4dc3f0
Signed-off-by: Justus Winter <justus@g10code.com>
3 years agopython: Improve error handling.
Justus Winter [Thu, 28 Jul 2016 15:44:18 +0000 (17:44 +0200)]
python: Improve error handling.

* lang/python/pyme/core.py (Context.protocol): Check that the engine
is usable before setting the protocol.
(Context._errorcheck): Add missing functions.

Signed-off-by: Justus Winter <justus@g10code.com>
3 years agosrc: Fix dummy engine versions.
Justus Winter [Thu, 28 Jul 2016 15:45:53 +0000 (17:45 +0200)]
src: Fix dummy engine versions.

Previously, 'gpgme_engine_check_version' failed for these protocols
because the version parser failed to parse the dummy versions.

* src/engine-assuan.c (llass_get_version): Use a version triple that
the parser can understand.
(llass_get_req_version): Likewise.
* src/engine-spawn.c (engspawn_get_version): Likewise.
(engspawn_get_req_version): Likewise.
* src/engine-uiserver.c (uiserver_get_version): Likewise.
(uiserver_get_req_version): Likewise.

Signed-off-by: Justus Winter <justus@g10code.com>
3 years agopython: Drop superfluous imports and trim public interface.
Justus Winter [Thu, 28 Jul 2016 14:29:05 +0000 (16:29 +0200)]
python: Drop superfluous imports and trim public interface.

* lang/python/pyme/__init__.py: Avoid leaking low-level 'gpgme', make
sure the main module looks nice and tidy, appease pyflakes.
* lang/python/pyme/errors.py: Appease pyflakes.
* lang/python/pyme/util.py: Avoid leaking low-level 'gpgme' into the
module namespace.
* lang/python/pyme/version.py.in: Likewise.
* lang/python/tests/t-keylist.py: Drop superfluous imports.
* lang/python/tests/t-sig-notation.py: Likewise.
* lang/python/tests/t-sign.py: Likewise.
* lang/python/tests/t-signers.py: Likewise.

Signed-off-by: Justus Winter <justus@g10code.com>
3 years agopython: Rename compiled SWIG module.
Justus Winter [Thu, 28 Jul 2016 13:44:38 +0000 (15:44 +0200)]
python: Rename compiled SWIG module.

Avoid the name pygpgme, as this is the name of another popular Python
binding for GPGME.

This commit renames the compiled Python module produced by SWIG.

* lang/python/Makefile.am: Rename the compiled Python module.
* lang/python/gpgme.i: Likewise.
* lang/python/pyme/core.py: Likewise.
* lang/python/pyme/errors.py: Likewise.
* lang/python/pyme/util.py: Likewise.
* lang/python/pyme/version.py.in: Likewise.
* lang/python/setup.py.in: Likewise.

Signed-off-by: Justus Winter <justus@g10code.com>
3 years agopython: Rename exported functions.
Justus Winter [Thu, 28 Jul 2016 13:24:05 +0000 (15:24 +0200)]
python: Rename exported functions.

Avoid the name pygpgme, as this is the name of another popular Python
binding for GPGME.

This commit renames all functions that are exported to the Python
world.

* lang/python/helpers.c: Rename all exported functions.
* lang/python/helpers.h: Likewise.
* lang/python/pyme/core.py: Likewise.

Signed-off-by: Justus Winter <justus@g10code.com>
3 years agopython: Rename private functions.
Justus Winter [Thu, 28 Jul 2016 12:51:20 +0000 (14:51 +0200)]
python: Rename private functions.

Avoid the name pygpgme, as this is the name of another popular Python
binding for GPGME.

This commit renames all functions that are not exported to the Python
world.

* lang/python/gpgme.i: Rename all private functions.
* lang/python/helpers.c: Likewise.
* lang/python/helpers.h: Likewise.
* lang/python/private.h: Likewise.  Also move the SWIG runtime helper
prototypes here.

Signed-off-by: Justus Winter <justus@g10code.com>
3 years agopython: Support the Assuan engine.
Justus Winter [Thu, 28 Jul 2016 10:40:54 +0000 (12:40 +0200)]
python: Support the Assuan engine.

* lang/python/gpgme.i: Add typemaps for the Assuan protocol callbacks.
* lang/python/helpers.c (_pyme_assuan_{data,inquire,status}_cb): New
functions.
* lang/python/private.h (_pyme_assuan_{data,inquire,status}_cb): New
prototypes.
* lang/python/pyme/core.py (Context.assuan_transact): New method.
* lang/python/pyme/util.py (percent_escape): New function.
* lang/python/tests/Makefile.am (py_tests): Add new test.
* lang/python/tests/t-protocol-assuan.py: New file.

Signed-off-by: Justus Winter <justus@g10code.com>
3 years agopython: Improve engine information handling.
Justus Winter [Thu, 28 Jul 2016 09:16:35 +0000 (11:16 +0200)]
python: Improve engine information handling.

* lang/python/gpgme.i (gpgme_engine_info_t): Wrap engine infos.
* lang/python/pyme/core.py (Context.engine_info): New property.
(Context.{g,s}et_engine_info): Improve docstrings.
* lang/python/pyme/results.py (EngineInfo): New class.

Signed-off-by: Justus Winter <justus@g10code.com>
3 years agopython: Add accessors for the protocol.
Justus Winter [Thu, 28 Jul 2016 08:59:46 +0000 (10:59 +0200)]
python: Add accessors for the protocol.

* lang/python/pyme/core.py (Context.__init__): Add 'protocol'
parameter.
(Context.protocol): New accessors.

Signed-off-by: Justus Winter <justus@g10code.com>
3 years agopython: Expose less functions to the Python world.
Justus Winter [Thu, 28 Jul 2016 08:20:20 +0000 (10:20 +0200)]
python: Expose less functions to the Python world.

* lang/python/Makefile.am (EXTRA_DIST, COPY_FILES): Add new file.
* lang/python/gpgme.i: Include new file and add comments.
* lang/python/helpers.c: Include new file.
* lang/python/helpers.h: Move functions we do not need to expose...
* lang/python/private.h: ... here.

Signed-off-by: Justus Winter <justus@g10code.com>
3 years agoFix including nil bytes in keylist output.
Ben Kibbey [Tue, 19 Jul 2016 00:16:46 +0000 (20:16 -0400)]
Fix including nil bytes in keylist output.

* src/gpgme-tool.c (cmd_keylist,gt_result): use strlen().

Signed-off-by: Ben Kibbey <bjk@luxsci.net>
3 years agopython: Make GPGME's version easily accessible.
Justus Winter [Fri, 15 Jul 2016 16:27:04 +0000 (18:27 +0200)]
python: Make GPGME's version easily accessible.

* lang/python/pyme/version.py.in (gpgme_versionstr): New variable.

Signed-off-by: Justus Winter <justus@g10code.com>
3 years agopython: Add an idiomatic interface.
Justus Winter [Wed, 8 Jun 2016 16:58:57 +0000 (18:58 +0200)]
python: Add an idiomatic interface.

* configure.ac: Bump required Python version.
* lang/python/pyme/__init__.py: Update docstring.  Import Context and
Data.
* lang/python/pyme/core.py (Context.encrypt): New function.
(Context.decrypt): Likewise.
(Context.sign): Likewise.
(Context.verify): Likewise.
* lang/python/pyme/errors.py: Add new errors.
* lang/python/pyme/util.py (process_constants): Rework and return the
inserted keys.
* lang/python/tests/Makefile.am (EXTRA_DIST): Add new keys.
* lang/python/tests/encrypt-only.asc: New file.
* lang/python/tests/sign-only.asc: Likewise.
* lang/python/tests/initial.py: Mark key 'Alpha' as trusted, import
new keys.
* lang/python/tests/support.py: Add fingerprints of known keys.
(in_srcdir): New function.
(print_data): Handle bytes too.
(mark_key_trusted): New function.
* lang/python/tests/t-decrypt-verify.py: Adjust test.  Test idiomatic
interface.
* lang/python/tests/t-decrypt.py: Test idiomatic interface.
* lang/python/tests/t-encrypt-sign.py: Likewise.
* lang/python/tests/t-encrypt-sym.py: Likewise.
* lang/python/tests/t-encrypt.py: Likewise.
* lang/python/tests/t-idiomatic.py: Simplify.
* lang/python/tests/t-keylist.py: Adjust to newly trusted key.
* lang/python/tests/t-sign.py: Likewise.  Test idiomatic interface.
* lang/python/tests/t-signers.py: Likewise.
* lang/python/tests/t-verify.py: Likewise.

Signed-off-by: Justus Winter <justus@g10code.com>
3 years agoQt: Disable keylocate test for gnupg < 2.0.10
Andre Heinecke [Thu, 14 Jul 2016 15:03:05 +0000 (17:03 +0200)]
Qt: Disable keylocate test for gnupg < 2.0.10

* lang/qt/tests/t-keylocate.cpp: Disable test for gnupg < 2.0.10

3 years agoCpp: Add EngineInfo::Version class
Andre Heinecke [Thu, 14 Jul 2016 15:01:33 +0000 (17:01 +0200)]
Cpp: Add EngineInfo::Version class

* lang/cpp/src/engineinfo.cpp (EngineInfo::engineVersion): New.
* lang/cpp/src/engineinfo.h (EngineInfo::engineVersion): Declare.
(EngineInfo::Version): Small helper to work with versions.

3 years agoQt: Fix usage of ignore-invalid-option in tests
Andre Heinecke [Thu, 14 Jul 2016 14:32:56 +0000 (16:32 +0200)]
Qt: Fix usage of ignore-invalid-option in tests

* Makefile.am (pubring-stamp): Fix config.

3 years agoQt: Fix tests if gpg2 is gpg
Andre Heinecke [Thu, 14 Jul 2016 13:31:50 +0000 (15:31 +0200)]
Qt: Fix tests if gpg2 is gpg

* lang/qt/tests/Makefile.am (pubring-stamp): Loopback and provide
passphrase on command line when importing.

3 years agopython: Fix test.
Justus Winter [Thu, 14 Jul 2016 11:22:59 +0000 (13:22 +0200)]
python: Fix test.

* lang/python/tests/t-keylist.py: Do not assume key alpha is trusted
yet.

Signed-off-by: Justus Winter <justus@g10code.com>
3 years agopython: Drop bad category.
Justus Winter [Thu, 14 Jul 2016 10:34:56 +0000 (12:34 +0200)]
python: Drop bad category.

--
Signed-off-by: Justus Winter <justus@g10code.com>
3 years agobuild: Update config.{guess,sub} to {2016-05-15,2016-06-20}.
Werner Koch [Wed, 13 Jul 2016 17:07:47 +0000 (19:07 +0200)]
build: Update config.{guess,sub} to {2016-05-15,2016-06-20}.

* build-aux/config.guess: Update.
* build-aux/config.sub: Update.

Signed-off-by: Werner Koch <wk@gnupg.org>
3 years agocore: New GPGME_DATA_ENCODING_MIME.
Werner Koch [Wed, 13 Jul 2016 12:45:02 +0000 (14:45 +0200)]
core: New GPGME_DATA_ENCODING_MIME.

* src/gpgme.h.in (GPGME_DATA_ENCODING_MIME): New.
* src/data.c (gpgme_data_set_encoding): Adjust check.
* src/engine-gpg.c (have_gpg_version): New.
(gpg_encrypt, gpg_encrypt_sign): Pass flag '--mimemode'.
(gpg_sign): Ditto.

* lang/cpp/src/data.h (GpgME): Add MimeEncoding.
* lang/cpp/src/data.cpp (encoding, setEncoding): Support MimeEncoding.

* src/gpgme-tool.c (server_data_encoding): Add flag --mime.
--

This feature allows an application to declare that the encrypted or
signed data is a valid MIME part.

What is missing is a way to return that information to the application
after decryption/verification.  This can be done by setting the
encoding of the output data object; however this requires some
internal additions to our processing model.

Signed-off-by: Werner Koch <wk@gnupg.org>
3 years agocore: Pass the engine's version string to the engine's new function.
Werner Koch [Wed, 13 Jul 2016 11:57:14 +0000 (13:57 +0200)]
core: Pass the engine's version string to the engine's new function.

* src/engine-backend.h (engine_ops): Add arg 'version' to NEW.
* src/engine-assuan.c (llass_new): Add dummy arg 'version'.
* src/engine-g13.c (g13_new): Ditto.
* src/engine-gpgconf.c (gpgconf_new): Ditto.
* src/engine-gpgsm.c (gpgsm_new): Ditto.
* src/engine-spawn.c (engspawn_new): Ditto.
* src/engine-uiserver.c (uiserver_new): Ditto.
* src/engine.c (_gpgme_engine_new): Pass version string to the new
function.
* src/engine-gpg.c (struct engine_gpg): Add field 'version'.
(gpg_new): Add arg 'version'.
(gpg_release): Free VERSION.

Signed-off-by: Werner Koch <wk@gnupg.org>
3 years agoCpp: Add feature enum for new identify
Andre Heinecke [Wed, 13 Jul 2016 09:56:18 +0000 (11:56 +0200)]
Cpp: Add feature enum for new identify

* lang/cpp/src/context.cpp (supported_features2): Add
BinaryAndFineGrainedIdentify
* lang/cpp/src/global.h (Feature2): ditto.

--
This is mostly for compatible code with KF5::Gpgmepp where there
is no hard requirement against gpgme 1.7. With 1.7 a version
check would also suffice.

3 years agopython: Port more tests.
Justus Winter [Mon, 6 Jun 2016 10:49:11 +0000 (12:49 +0200)]
python: Port more tests.

* lang/python/pyme/core.py (Context.op_keylist_all): Add missing
'op_keylist_end'.
(Context.op_trustlist_all): Fix function. Add missing
'op_trustlist_end'.
* lang/python/tests/Makefile.am (pytests): Add new files.
* lang/python/tests/t-import.py: New file.
* lang/python/tests/t-keylist.py: Likewise.
* lang/python/tests/t-trustlist.py: Check alternate interface.

Signed-off-by: Justus Winter <justus@g10code.com>
3 years agopython: Improve python packaging.
Justus Winter [Tue, 12 Jul 2016 14:20:35 +0000 (16:20 +0200)]
python: Improve python packaging.

* lang/python/Makefile.am: Sign source releases, and upload them.
* lang/python/setup.py.in: Add categories.

Signed-off-by: Justus Winter <justus@g10code.com>
3 years agom4: Don't set fpic for qt on windows
Andre Heinecke [Tue, 12 Jul 2016 13:26:14 +0000 (15:26 +0200)]
m4: Don't set fpic for qt on windows

* m4/qt.m4 (FIND_QT): Do not set fpic for windows.

--
Otherwise each compile call will result in a warning that
fpic is ignored for windows.

3 years agom4: Use LIBS instead of LDFLAGS for Qt libs
Andre Heinecke [Tue, 12 Jul 2016 13:10:16 +0000 (15:10 +0200)]
m4: Use LIBS instead of LDFLAGS for Qt libs

* m4/qt.m4: Modify LIBS instead of LDFLAGS for link test.

--
The test would otherwise fail when building for windows because the
link order was wrong.

3 years agoBump version to 1.7.0
Andre Heinecke [Tue, 12 Jul 2016 10:28:41 +0000 (12:28 +0200)]
Bump version to 1.7.0

* configure.ac(mym4_version_minor),
(mym4_version_micro): Next release will be 1.7.0

--
This was already mentioned in NEWS but acidentally not changed
in configure.ac

3 years agoQt: Install CamelCase forward includes
Andre Heinecke [Tue, 12 Jul 2016 09:47:33 +0000 (11:47 +0200)]
Qt: Install CamelCase forward includes

* lang/qt/src/Makefile.am (camelcase_headers): New. Create and install
CamelCase headers.

--
For Qt Libraries it is a common pattern that headers are installed
additionally under their Namespace / Class Name so that automated
inclusion works once a class is used in code. This was also
done for QGpgME headers when they lived in Libkleo so this increases
compatibility.

3 years agoQt: Export VerifyDetachedJob
Andre Heinecke [Tue, 12 Jul 2016 09:47:04 +0000 (11:47 +0200)]
Qt: Export VerifyDetachedJob

* lang/qt/src/verifydetachedjob.h (VerifyDetachedJob): Export it.

3 years agoQt/Cpp: Add version headers
Andre Heinecke [Tue, 12 Jul 2016 09:09:44 +0000 (11:09 +0200)]
Qt/Cpp: Add version headers

* lang/cpp/src/gpgmepp_version.h.in,
lang/qt/src/qgpgme_version.h.in: New. Version information.
* lang/qt/src/Makefile.am, lang/cpp/src/Makefile.am: Add them.
* configure.ac: Configure them.

--
The version headers are common practice in KDE Frameworks and
were installed for KF5Gpgmepp and Libkleo respectively.

3 years agoQt/Cpp: Add license blurb to export headers
Andre Heinecke [Tue, 12 Jul 2016 09:08:42 +0000 (11:08 +0200)]
Qt/Cpp: Add license blurb to export headers

* lang/cpp/src/gpgmepp_export.h,
lang/qt/src/qgpgme_export.h: Add license blurb.

3 years agopython: Fix distcheck.
Justus Winter [Mon, 11 Jul 2016 17:42:56 +0000 (19:42 +0200)]
python: Fix distcheck.

* lang/python/Makefile.am (EXTRA_DIST): Add missing files.

Signed-off-by: Justus Winter <justus@g10code.com>
3 years agom4: Add compile / link check for qt
Andre Heinecke [Mon, 11 Jul 2016 16:47:11 +0000 (18:47 +0200)]
m4: Add compile / link check for qt

* m4/qt.m4 (FIND_QT): Check if a qt application can be compiled and
linked.

--
In case gpgme is cross compiled pkg-config may pick up qt
for the build system and not for the host system. To avoid that
we check that we can compile a qt program for host.

3 years agopython: Enable out-of-tree build of pyme bindings.
Justus Winter [Mon, 11 Jul 2016 14:38:37 +0000 (16:38 +0200)]
python: Enable out-of-tree build of pyme bindings.

* lang/python/MANIFEST.in: Update manifest template.
* lang/python/Makefile.am: Copy more files, move generation of files
to Python build script, add 'sdist' target to build a Python source
distribution.
* lang/python/gpgme-h-clean.py: Add code to build 'errors.i'.
* lang/python/setup.py.in: Generate files, enable out-of-tree builds.

Signed-off-by: Justus Winter <justus@g10code.com>
3 years agopython: Do not depend on access to internal data structures.
Justus Winter [Mon, 11 Jul 2016 14:34:15 +0000 (16:34 +0200)]
python: Do not depend on access to internal data structures.

* lang/python/gpgme.i (gpgme_data_t): Rework so that it works without
access to the definition of 'struct gpgme_data'.
* lang/python/helpers.c (object_to_gpgme_data_t): Add assertion.

Signed-off-by: Justus Winter <justus@g10code.com>
3 years agopython: Make result wrapping backwards compatible.
Justus Winter [Mon, 11 Jul 2016 10:29:17 +0000 (12:29 +0200)]
python: Make result wrapping backwards compatible.

* lang/python/pyme/results.py (Result.__init__): Skip missing fields.

Signed-off-by: Justus Winter <justus@g10code.com>
3 years agoQt: Fix memleaks in tests
Andre Heinecke [Mon, 11 Jul 2016 14:47:30 +0000 (16:47 +0200)]
Qt: Fix memleaks in tests

* lang/qt/tests/t-keylist.cpp(cleanupTestCase): Ensure that
posted events are handled for autodeletion.
(testSingleKeylistSync): delete job.
* lang/qt/tests/t-ownertrust.cpp(cleanupTestCase): Ditto
* lang/qt/tests/t-ownertrust.cpp(testChangeOwnerTrust): Delete
keylistjobs.
* lang/qt/tests/t-keylocate.cpp(cleanupTestCase): Ditto

3 years agoQt: Add some general Protocol documentation
Andre Heinecke [Mon, 11 Jul 2016 14:41:09 +0000 (16:41 +0200)]
Qt: Add some general Protocol documentation

* lang/qt/src/protocol.h (Protocol): Add doc.

--
This explicitly documents that syncs run with exec need deletion.

3 years agoQt: Disable t-tofuinfo tests
Andre Heinecke [Mon, 11 Jul 2016 10:01:35 +0000 (12:01 +0200)]
Qt: Disable t-tofuinfo tests

* lang/qt/tests/t-tofuinfo.cpp: Disable tests.

--
Even with the wait this test could fail and anyway the delay
was not nice. So we remove the wait hack and just wait for
the bug (2405) to be fixed in GnuPG or GpgME core.

3 years agosrc: Fix error handling.
Justus Winter [Fri, 8 Jul 2016 16:00:01 +0000 (18:00 +0200)]
src: Fix error handling.

* src/encrypt.c (encrypt_status_handler): Fix error handling, ||
conflates errors.

Signed-off-by: Justus Winter <justus@g10code.com>
3 years agopython: Fix raising stashed exceptions.
Justus Winter [Fri, 8 Jul 2016 09:45:08 +0000 (11:45 +0200)]
python: Fix raising stashed exceptions.

Fixes an issue with newer versions of Python.

* lang/python/helpers.c (pygpgme_raise_callback_exception): Be more
careful when restoring the exception.

Signed-off-by: Justus Winter <justus@g10code.com>
3 years agopython: Fix distcheck.
Justus Winter [Wed, 6 Jul 2016 08:59:18 +0000 (10:59 +0200)]
python: Fix distcheck.

* lang/python/INSTALL: Drop obsolete file.
* lang/python/Makefile.am (EXTRA_DIST): Add missing files.
(CLEANFILES): Remove generated files.
(clean-local): Fix permissions of copied files.
* lang/python/tests/Makefile.am (TESTS): Use our own setup and
teardown scripts.
(EXTRA_DIST): Add missing files.
* lang/python/tests/final.py: New file.
* lang/python/tests/initial.py: Likewise.

Signed-off-by: Justus Winter <justus@g10code.com>
3 years agoqt: Fix distcheck.
Justus Winter [Wed, 6 Jul 2016 09:01:55 +0000 (11:01 +0200)]
qt: Fix distcheck.

* lang/qt/src/Makefile.am (qgpgme_headers): Add missing file.
(CLEANFILES): Add generated file.
* lang/qt/tests/Makefile.am (clean-local): Remove private keys.

Signed-off-by: Justus Winter <justus@g10code.com>
3 years agocpp: Fix distcheck.
Justus Winter [Thu, 7 Jul 2016 11:23:05 +0000 (13:23 +0200)]
cpp: Fix distcheck.

* lang/cpp/src/Makefile.am (CLEANFILES): Remove generated file.

Signed-off-by: Justus Winter <justus@g10code.com>
3 years agoQt: Add test for publicKeyAlgorithmAsString
Andre Heinecke [Wed, 6 Jul 2016 13:09:16 +0000 (15:09 +0200)]
Qt: Add test for publicKeyAlgorithmAsString

* lang/qt/tests/t-keylist.cpp (testPubkeyAlgoAsString): New.

3 years agoCpp: Expose gpgme_pubkey_algo_name
Andre Heinecke [Wed, 6 Jul 2016 13:07:34 +0000 (15:07 +0200)]
Cpp: Expose gpgme_pubkey_algo_name

* lang/cpp/src/key.cpp (Subkey::publicKeyAlgorithmAsString): New
static variant.
* lang/cpp/src/key.h: Declare function. Clarify comment about name
mismatch.

3 years agoQt: Add check for pubkeyAlgo in t-keylist
Andre Heinecke [Wed, 6 Jul 2016 11:39:43 +0000 (13:39 +0200)]
Qt: Add check for pubkeyAlgo in t-keylist

* lang/qt/tests/t-keylist.cpp (testSingleKeyListSync): Check
pubkeyAlgo.

3 years agoCpp: Add PubkeyAlgo enum
Andre Heinecke [Wed, 6 Jul 2016 11:38:20 +0000 (13:38 +0200)]
Cpp: Add PubkeyAlgo enum

* lang/cpp/src/key.h (Subkey::PubkeyAlgo): New enum.
(Subkey::publicKeyAlgorithm): Change return type.
* lang/cpp/src/key.cpp (Subkey::publicKeyAlgorithm): Use enum.

3 years agoQt: Fix include order when buildin test
Andre Heinecke [Wed, 6 Jul 2016 09:28:11 +0000 (11:28 +0200)]
Qt: Fix include order when buildin test

* lang/qt/tests/Makefile.am (AM_CPPFLAGS): Include cpp before
gpgme src directory.

--
This fixes a problem where context.h would be picked up from gpgme/src
instead of including the context.h from gpgme++.

3 years agoRevert "Qt: More robust lookup of Cpp's context.h"
Andre Heinecke [Wed, 6 Jul 2016 09:22:10 +0000 (11:22 +0200)]
Revert "Qt: More robust lookup of Cpp's context.h"

* lang/qt/src/threadedjobmixin.h: Revert using full path
for context.h

--
This reverts commit 47bfbc9026b49b9918359af5fcc1621aab0d1065 as
it causes problems depending on the include path. The proper
fix will be to ensure that cpp/src is included before gpgme/src.

3 years agoQt: Fix test build with Qt < 5.4.0
Andre Heinecke [Tue, 5 Jul 2016 20:11:42 +0000 (22:11 +0200)]
Qt: Fix test build with Qt < 5.4.0

* lang/qt/tests/t-keylist.cpp,
lang/qt/tests/t-keylocate.cpp,
lang/qt/tests/t-ownertrust.cpp: Use old style SIGNAl syntax for
QSignalSpy

3 years agoQt: More robust lookup of Cpp's context.h
Andre Heinecke [Tue, 5 Jul 2016 20:10:18 +0000 (22:10 +0200)]
Qt: More robust lookup of Cpp's context.h

* lang/qt/src/threadedjobmixin.h: When building qgpgme look for
context.h in the full cpp subdirectory.

--
Gpgme core also contains a context.h that can lead to confusion
otherwise.

3 years agow32: Fallback to 2.1 reg key for gpgconf search
Andre Heinecke [Tue, 1 Mar 2016 12:11:13 +0000 (13:11 +0100)]
w32: Fallback to 2.1 reg key for gpgconf search

* src/w32-util.c (_gpgme_get_gpgconf_path): Fallback to 2.1 installer
 registry key.

--
Finding gpgconf is utterly important so we should be as compatible
as possible.

3 years agoDoc: Document pinentry mode
Andre Heinecke [Mon, 4 Jul 2016 09:23:12 +0000 (11:23 +0200)]
Doc: Document pinentry mode

* doc/gpgme.texi (Passphrase Callback): Document as context
attribute.
(gpgme_set_passphrase_cb): Note that this requires LOOPBACK mode
with GnuPG 2.1.

3 years agoQt: Add testTofuSignCount
Andre Heinecke [Mon, 4 Jul 2016 09:42:30 +0000 (11:42 +0200)]
Qt: Add testTofuSignCount

* src/lang/qt/tests/t-tofuinfo.cpp(testTofuSignCount): New.
(initTestCase): Set gpg-agent loopback pinentry config.
(signAndVerify): Helper for tofuTestSignCount.

--
Also needs the wait code because of GnuPG-Bug-Id: 2405

3 years agoQt: Add test passphrase provider
Andre Heinecke [Mon, 4 Jul 2016 09:40:03 +0000 (11:40 +0200)]
Qt: Add test passphrase provider

* lang/qt/tests/t-support.h (TestPassphraseProvider): New.
* lang/qt/tests/Makefile.am (t_tofuinfo_SOURCES): Add t-support.h

3 years agoCpp: Add support for TOFU_CONFLICT sigsum
Andre Heinecke [Mon, 4 Jul 2016 09:31:01 +0000 (11:31 +0200)]
Cpp: Add support for TOFU_CONFLICT sigsum

* lang/cpp/src/verificationresult.cpp (GpgME::Signature::Summary):
Handle TOFU_CONFLICT.
* lang/cpp/src/verificationresult.h (Summary): Add TofuConflict.

3 years agoCpp: Add support for pinentry_mode
Andre Heinecke [Mon, 4 Jul 2016 09:25:40 +0000 (11:25 +0200)]
Cpp: Add support for pinentry_mode

* lang/cpp/src/context.cpp (Context::pinentryMode): Return mode.
(Context::setPinentryMode): Set mode.
* lang/cpp/src/context.h (PinentryMode): Add enum.

3 years agoQt: Add test for TofuInfo
Andre Heinecke [Fri, 1 Jul 2016 14:55:14 +0000 (16:55 +0200)]
Qt: Add test for TofuInfo

* lang/qt/tests/t-tofuinfo.cpp: New.
* lang/qt/tests/Makefile.am: Update accordingly.

--
The test currently contains a workaround for GnuPG-Bug-Id 2405

3 years agoCpp: Add TofuInfo to signatures
Andre Heinecke [Fri, 1 Jul 2016 14:49:06 +0000 (16:49 +0200)]
Cpp: Add TofuInfo to signatures

* lang/cpp/src/tofuinfo.cpp, lang/cpp/src/tofuinfo.h: New class.
* lang/cpp/src/verificationresult.cpp (Signature::tofuInfo): New.
(VerificationResult::Private): Handle tofu info.
(GpgME::operator<<(std::ostream &os, const Signature &sig)): Include
TofuInfo in dump.
* lang/cpp/src/verificationresult.h (Signature::tofuInfo): New.
* lang/cpp/src/Makefile.am (main_sources, gpgmepp_headers): Add
new files.
* configure.ac (LIBGPGMEPP_LT_REVISION): Bump for new API.

3 years agocore: Clarify documentation of tofu_stats address
Andre Heinecke [Fri, 1 Jul 2016 14:47:04 +0000 (16:47 +0200)]
core: Clarify documentation of tofu_stats address

* src/gpgme.h.in: Mention that Address is not always in addr-spec.

--
The old comment made it look like you could always expect the
address to be parsable as a mailbox address.

3 years agocore: Fix identify for armored detached sigs
Andre Heinecke [Fri, 1 Jul 2016 08:56:57 +0000 (10:56 +0200)]
core: Fix identify for armored detached sigs

* src/data-identify.c (basic_detection): Return signature for
signature.

--
This causes identify to return signature for both binary and
ascii armored detached signatures where previously it would
have returned signed for armored signatures and signature for
binary signatures.

GnuPG-Bug-Id: 2314

3 years agotests: Fix trivial memory leaks.
Justus Winter [Mon, 27 Jun 2016 15:56:18 +0000 (17:56 +0200)]
tests: Fix trivial memory leaks.

--
Signed-off-by: Justus Winter <justus@g10code.com>
3 years agoCpp: Expose new data_identify values
Andre Heinecke [Mon, 27 Jun 2016 13:50:01 +0000 (15:50 +0200)]
Cpp: Expose new data_identify values

* lang/cpp/src/data.cpp (GpgME::Data::type): Handle PGP Encrypted
 and Signature.
* lang/cpp/src/data.h: Add values accordingly.

3 years agoCpp: Do not treat KEYEXPIRED as error
Andre Heinecke [Mon, 27 Jun 2016 12:47:44 +0000 (14:47 +0200)]
Cpp: Do not treat KEYEXPIRED as error

* lang/cpp/src/editinteractor.cpp (status_to_error): No error
for KEYEXPIRED.

--
As keyexpired status is sent even if a subkey is expired
we can not treat it as a global error.

3 years agotests: Add new test tool run-decrypt
Andre Heinecke [Fri, 24 Jun 2016 09:30:55 +0000 (11:30 +0200)]
tests: Add new test tool run-decrypt

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

3 years agocore: Add closer inspection of "PGP MESSAGE".
Werner Koch [Thu, 23 Jun 2016 08:14:57 +0000 (10:14 +0200)]
core: Add closer inspection of "PGP MESSAGE".

* src/data-identify.c (inspect_pgp_message): New.
(basic_detection): Un-const arg DATA. Call inspect_pgp_message.

Signed-off-by: Werner Koch <wk@gnupg.org>
3 years agocore: Add a base 64 decoder.
Werner Koch [Thu, 23 Jun 2016 07:48:54 +0000 (09:48 +0200)]
core: Add a base 64 decoder.

* src/b64dec.c: New. Taken from gnupg.  Prefix function names with
_gpgme_ and change to use standard C malloc functions.
* src/util.h.h (struct b64state): New.
* src/Makefile.am (main_sources): Add file.

--

The file b64dec.c has been taken from gnupg commit
e430ff6ad0b7dcfcebd92b825dd5168205447ff3

Signed-off-by: Werner Koch <wk@gnupg.org>
3 years agocore: Detect compressed signed OpenPGP data.
Werner Koch [Wed, 22 Jun 2016 16:43:26 +0000 (18:43 +0200)]
core: Detect compressed signed OpenPGP data.

* src/data-identify.c (next_openpgp_packet): Allow partial encoding.
(pgp_binary_detection): Handle compressed packets.
--

Signed-off-by: Werner Koch <wk@gnupg.org>
3 years agotests: Add new test tool run-identify.
Werner Koch [Tue, 21 Jun 2016 14:17:26 +0000 (16:17 +0200)]
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>
3 years agocore: Enhance gpgme_data_identify to detect binary PGP messages.
Werner Koch [Tue, 21 Jun 2016 14:14:02 +0000 (16:14 +0200)]
core: Enhance gpgme_data_identify to detect binary PGP messages.

* src/gpgme.h.in (GPGME_DATA_TYPE_PGP_ENCRYPTED): New.
(GPGME_DATA_TYPE_PGP_SIGNATURE): New.
* src/data-identify.c: Add enum for OpenPGP packet types.
(buf32_to_ulong): New.
(next_openpgp_packet): New.  Based on the gnupg/kbx/keybox-openpgp.c
implementation and relicensed to LGPL by g10 Code.
(pgp_binary_detection): New.
(basic_detection): Call pgp_binary_detection instead of returning
unknown.

Signed-off-by: Werner Koch <wk@gnupg.org>
3 years agopython: Improve autmatically generated docstrings.
Justus Winter [Tue, 14 Jun 2016 11:28:37 +0000 (13:28 +0200)]
python: Improve autmatically generated docstrings.

* lang/python/gpgme.i: Add comment.
* lang/python/pyme/core.py (__getattr__): Rewrite automatically
generated doctrings for the wrapper methods.

Signed-off-by: Justus Winter <justus@g10code.com>
3 years agopython: Make result objects more robust.
Justus Winter [Tue, 14 Jun 2016 15:33:12 +0000 (17:33 +0200)]
python: Make result objects more robust.

Results returned by the GPGME are fragile, i.e. they are only valid
until the next operation is performed in the context.

We cannot arbitrarily constrain the lifetime of Python objects, we
therefore create deep copies of the results.

* lang/python/gpgme.i (gpgme_tofu_info_t): Turn these into a list.
(gpgme_*_result_t): Create deep copies of these objects.
* lang/python/helpers.c (pygpgme_wrap_fragile_result): New function.
* lang/python/helpers.h (pygpgme_wrap_fragile_result): New prototype.
* lang/python/pyme/results.py: New file.

Signed-off-by: Justus Winter <justus@g10code.com>
3 years agopython: Avoid creating SWIG proxy classes.
Justus Winter [Tue, 14 Jun 2016 11:48:33 +0000 (13:48 +0200)]
python: Avoid creating SWIG proxy classes.

* lang/python/Makefile.am (gpgme_wrap.c): Use '-builtin' to make SWIG
generate builtin types for c types.
* lang/python/gpgme.i (pygpgme_wrap_gpgme_data_t): Adapt slightly.

Signed-off-by: Justus Winter <justus@g10code.com>
3 years agopython: Simplify wrapping glue.
Justus Winter [Tue, 14 Jun 2016 10:37:26 +0000 (12:37 +0200)]
python: Simplify wrapping glue.

* lang/python/pyme/core.py: Rename '_getctype' to '_ctype' and turn it
  into a string.  Likewise rename '_getnameprepend' to '_cprefix'.
* lang/python/helpers.c: Adapt accordingly.

Signed-off-by: Justus Winter <justus@g10code.com>
3 years agopython: Rework callbacks.
Justus Winter [Mon, 13 Jun 2016 17:16:30 +0000 (19:16 +0200)]
python: Rework callbacks.

Simplify how the lifetime of callback arguments is managed.

* lang/python/gpgme.i (gpgme_edit_cb_t): Check arguments.
(PyObject_p_p, void_p_p): Drop rather dangerous interface.
(pygpgme_unwrap_gpgme_ctx_t): New function.
* lang/python/helpers.c (pygpgme_clear_generic_cb): Drop dangerous
function.
(pyPassphraseCb): Assert contract.
(pygpgme_set_passphrase_cb): Use Python's calling convention so that
we can raise exceptions.  Hand in 'self', get the wrapped object, and
simply store the hook data as attribute of the wrapper object.
(pyProgressCb, pygpgme_set_progress_cb): Likewise.
(pygpgme_set_status_cb): Likewise.
(pygpgme_data_new_from_cbs): Likewise.
* lang/python/helpers.h (pygpgme_clear_generic_cb): Drop prototype.
(pygpgme_set_passphrase_cb): Update prototype.
(pygpgme_set_progress_cb): Likewise.
(pygpgme_set_status_cb): Likewise.
(pygpgme_data_new_from_cbs): Likewise.
(pygpgme_unwrap_gpgme_ctx_t): New prottotype.
* lang/python/pyme/core.py (Context, Data): Update callsites.

Signed-off-by: Justus Winter <justus@g10code.com>
3 years agopython: Wrap objects implementing the buffer protocol.
Justus Winter [Wed, 8 Jun 2016 15:56:33 +0000 (17:56 +0200)]
python: Wrap objects implementing the buffer protocol.

* lang/python/Makefile.am: Add the toplevel source directory to CFLAGS
when compiling the bindings so that we can use private header files.
* lang/python/gpgme.i (gpgme_data_t): Rework the object wrapping.  Do
not create a Python wrapper object, merely a gpgme_data_t object, and
keep references to buffer objects, if any.  If necessary, update the
buffer after the function call.
(pygpgme_wrap_gpgme_data_t): New function.
* lang/python/helpers.c (object_to_gpgme_data_t): Rework object
wrapping.  Also wrap objects implementing the buffer protocol.
* lang/python/helpers.h (object_to_gpgme_data_t): Update prototype.
(pygpgme_wrap_gpgme_data_t): New prototype.
* lang/python/tests/t-idiomatic.py: Demonstrate this.

Signed-off-by: Justus Winter <justus@g10code.com>
3 years agopython: Add properties to wrapped object.
Justus Winter [Fri, 10 Jun 2016 11:00:33 +0000 (13:00 +0200)]
python: Add properties to wrapped object.

* lang/python/pyme/core.py (GpgmeWrapper.__repr__): Saner
representation.
(GpgmeWrapper.__str__): Construct a nicer human readable string.
(GpgmeWrapper._boolean_properties): New field.
(GpgmeWrapper.__wrap_boolean_property): New function.
(GpgmeWrapper.__getattr__): Wrap functions using properties.
(GpgmeWrapper.__setattr__): New method.  Likewise wrap functions.
(Context.signers): New property.
(Context.pinentry_mode): Likewise.
(Context._boolean_properties): List boolean properties.
(Context.__init__): Add keyword arguments for properties and apply
them.

Signed-off-by: Justus Winter <justus@g10code.com>
3 years agopython: Improve the documentation.
Justus Winter [Mon, 6 Jun 2016 12:08:59 +0000 (14:08 +0200)]
python: Improve the documentation.

* lang/python/Makefile.am: Copy the README file.
* lang/python/README: Rename, convert to org, and update.
* lang/python/pyme/__init__.py: Move license out of the docstring,
update docstring.
* lang/python/pyme/core.py: Add and update docstrings.

Signed-off-by: Justus Winter <justus@g10code.com>