Commit Graph

2237 Commits

Author SHA1 Message Date
Alon Bar-Lev
d1509428f3 python: Make generated 'setup.py' executable.
--
Signed-off-by: Alon Bar-Lev <alon.barlev@gmail.com>
2016-09-30 14:46:02 +02:00
Andre Heinecke
7302791c0d cpp, qt: Handle modified includedir installation
* lang/cpp/src/Makefile.am,
lang/qt/src/Makefile.am: Replace resolved_includedir.
* lang/cpp/src/GpgmeppConfig.cmake.in.in,
lang/qt/src/QGpgmeConfig.cmake.in.in: Use resolved_includedir
instead of relying on a common installation prefix.

--
This fixes usage of the config files in case gpgme
is configured with a custom --includedir.
We have to do the replacement manually like for libdir
because configure would include variables in the replacement.
2016-09-29 12:46:18 +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
Daniel Kahn Gillmor
145392f07f Clarify licensing
* src/b64dec.c, src/mbox-util.c, src/mbox-util.h: These three files
  are explicitly licensed under LGPL, but their comments suggest that
  details about the warranty can be found in the GPL.  Adjust comments
  to refer to the correct license.

Signed-off-by: Daniel Kahn Gillmor <dkg@fifthhorseman.net>
2016-09-27 12:41:38 +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
Justus Winter
c9934bb1ee python: Get rid of the last C++-style comments.
--
Signed-off-by: Justus Winter <justus@g10code.com>
2016-09-26 16:54:58 +02:00
Justus Winter
c38fabfea0 python: Correctly translate to size_t.
* lang/python/gpgme.i: Correctly translate Python number to size_t.

Signed-off-by: Justus Winter <justus@g10code.com>
2016-09-26 16:54:58 +02:00
Justus Winter
1d80e7374a python: Correctly translate off_t.
* lang/python/gpgme.i: Improve int/long translations, correctly handle
off_t with large file support.

Signed-off-by: Justus Winter <justus@g10code.com>
2016-09-26 16:54:58 +02:00
Justus Winter
3703a47238 python: Include 'config.h'.
* lang/python/Makefile.am: Pass 'top_builddir' to 'setup.py'.
* lang/python/gpgme.i: Include 'config.h'.
* lang/python/helpers.c: Likewise.
* lang/python/helpers.h: Likewise.
* lang/python/setup.py.in: Make sure that 'config.h' can be found.
--
Fixes build on 32 bit platforms with large file support.

Signed-off-by: Justus Winter <justus@g10code.com>
2016-09-26 16:54:57 +02:00
Daniel Kahn Gillmor
95f38652f6 Fix spelling
* lang/cpp/src/context.h, lang/qt/src/protocol.h,
   lang/qt/src/wkspublishjob.h, src/data-identify.c, src/engine-gpg.c:
   minor spelling cleanup.
--

Signed-off-by: Daniel Kahn Gillmor <dkg@fifthhorseman.net>
2016-09-23 16:09:27 +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
Andre Heinecke
a142f187b7 cpp, qt: Include config.h
lang/cpp/src/callbacks.cpp,
lang/cpp/src/configuration.cpp,
lang/cpp/src/context.cpp,
lang/cpp/src/context_glib.cpp,
lang/cpp/src/context_qt.cpp,
lang/cpp/src/context_vanilla.cpp,
lang/cpp/src/data.cpp,
lang/cpp/src/decryptionresult.cpp,
lang/cpp/src/defaultassuantransaction.cpp,
lang/cpp/src/editinteractor.cpp,
lang/cpp/src/encryptionresult.cpp,
lang/cpp/src/engineinfo.cpp,
lang/cpp/src/eventloopinteractor.cpp,
lang/cpp/src/exception.cpp,
lang/cpp/src/gpgadduserideditinteractor.cpp,
lang/cpp/src/gpgagentgetinfoassuantransaction.cpp,
lang/cpp/src/gpgsetexpirytimeeditinteractor.cpp,
lang/cpp/src/gpgsetownertrusteditinteractor.cpp,
lang/cpp/src/gpgsignkeyeditinteractor.cpp,
lang/cpp/src/importresult.cpp,
lang/cpp/src/key.cpp,
lang/cpp/src/keygenerationresult.cpp,
lang/cpp/src/keylistresult.cpp,
lang/cpp/src/scdgetinfoassuantransaction.cpp,
lang/cpp/src/signingresult.cpp,
lang/cpp/src/tofuinfo.cpp,
lang/cpp/src/trustitem.cpp,
lang/cpp/src/verificationresult.cpp,
lang/cpp/src/vfsmountresult.cpp,
lang/qt/src/dataprovider.cpp,
lang/qt/src/defaultkeygenerationjob.cpp,
lang/qt/src/gpgme_backend_debug.cpp,
lang/qt/src/job.cpp,
lang/qt/src/qgpgmeadduseridjob.cpp,
lang/qt/src/qgpgmebackend.cpp,
lang/qt/src/qgpgmechangeexpiryjob.cpp,
lang/qt/src/qgpgmechangeownertrustjob.cpp,
lang/qt/src/qgpgmechangepasswdjob.cpp,
lang/qt/src/qgpgmedecryptjob.cpp,
lang/qt/src/qgpgmedecryptverifyjob.cpp,
lang/qt/src/qgpgmedeletejob.cpp,
lang/qt/src/qgpgmedownloadjob.cpp,
lang/qt/src/qgpgmeencryptjob.cpp,
lang/qt/src/qgpgmeexportjob.cpp,
lang/qt/src/qgpgmeimportfromkeyserverjob.cpp,
lang/qt/src/qgpgmeimportjob.cpp,
lang/qt/src/qgpgmekeyformailboxjob.cpp,
lang/qt/src/qgpgmekeygenerationjob.cpp,
lang/qt/src/qgpgmekeylistjob.cpp,
lang/qt/src/qgpgmelistallkeysjob.cpp,
lang/qt/src/qgpgmenewcryptoconfig.cpp,
lang/qt/src/qgpgmerefreshkeysjob.cpp,
lang/qt/src/qgpgmesecretkeyexportjob.cpp,
lang/qt/src/qgpgmesignencryptjob.cpp,
lang/qt/src/qgpgmesignjob.cpp,
lang/qt/src/qgpgmesignkeyjob.cpp,
lang/qt/src/qgpgmetofupolicyjob.cpp,
lang/qt/src/qgpgmeverifydetachedjob.cpp,
lang/qt/src/qgpgmeverifyopaquejob.cpp,
lang/qt/src/qgpgmewkspublishjob.cpp,
lang/qt/src/threadedjobmixin.cpp,
lang/qt/tests/run-keyformailboxjob.cpp,
lang/qt/tests/t-encrypt.cpp,
lang/qt/tests/t-keylist.cpp,
lang/qt/tests/t-keylocate.cpp,
lang/qt/tests/t-ownertrust.cpp,
lang/qt/tests/t-support.cpp,
lang/qt/tests/t-tofuinfo.cpp,
lang/qt/tests/t-wkspublish.cpp: Include config.h

--
This fixes problems with mismatching definitions. Most
notably _FILE_OFFSET_BITS is now always set correctly.
2016-09-23 15:25:51 +02:00
Werner Koch
583aafdd68
w32: Silence some warnings about unused parameters.
* src/assuan-support.c (my_recvmsg, my_sendmsg, my_waitpid)
(my_socketpair) [W32]: Mark unused parameters.

Signed-off-by: Werner Koch <wk@gnupg.org>
2016-09-22 12:58:23 +02:00
Werner Koch
c447b64d59
core: Fix error checking in _gpgme_mkstemp.
* src/w32-util.c (_gpgme_mkstemp): Fix error checking.
(dlopen): Mark FLAGS as unused.

Signed-off-by: Werner Koch <wk@gnupg.org>
2016-09-22 12:46:06 +02:00
Werner Koch
dc39552d01
core: New helper function _gpgme_strconcat.
* src/conversion.c: Include stdarg.h.
(do_strconcat): New.
(_gpgme_strconcat): New.
* src/util.h: Provide fallback for GPGRT_ATTR_SENTINEL.
(_gpgme_strconcat): New with sentinel.

* src/w32-util.c (find_program_in_dir): Replace malloc and stpcpy by
_gpgme_strconcat.
(find_program_at_standard_place): Ditto.
(_gpgme_set_default_gpg_name): Ditto.
(_gpgme_set_default_gpgconf_name): Ditto.
(_gpgme_mkstemp): Ditto.
(_gpgme_set_override_inst_dir): Repalce malloc and strcpy by strdup.
--

The function has been taken from gnupg/common/stringhelp.c and license
changed to LPGLv2.1+.  I am the original author of that code.

Signed-off-by: Werner Koch <wk@gnupg.org>
2016-09-22 12:42:10 +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
dee56820ca
gpg: Add option --exit-on-status-write-error
* src/engine-gpg.c (gpg_new): Add --exit-on-status-write-error if the
engine version is latest enough to expect progress output from gpg.

--
GnuPG-bug-id: 1415
Signed-off-by: Daiki Ueno <ueno@gnu.org>

Changed the version test from the patch to use the newer
have_gpg_version.

Signed-off-by: Werner Koch <wk@gnupg.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
Daiki Ueno
0aaf1dedd6
doc: Fix minor errors in I/O callback example
* gpgme.texi (I/O Callback Example): Fix typos, add timeout to select,
and initialize mutex as recursive.

Signed-off-by: Daiki Ueno <ueno@gnu.org>
2016-09-22 09:12:43 +02:00
Andreas Stieger
ae324b51ff cpp: Avoid missing returns in non-void functions
* lang/cpp/src/context.cpp
  (Context::signaturePolicyURL): return nullptr on default
  (to_tofu_policy_t): add default case for unknown
* lang/cpp/src/key.cpp
  (Key::primaryFingerprint): return nullptr on default
* lang/cpp/src/tofuinfo.cpp
  (GpgME::TofuInfo::policy): add default case for unknown

Signed-off-by: Andreas Stieger <astieger@suse.com>
Signed-off-by: Andre Heinecke <aheinecke@intevation.de>
2016-09-21 16:46:06 +02:00
Werner Koch
0b78bc7ba4
Post release updates
--
2016-09-21 09:40:02 +02:00
Werner Koch
e7ab75379f
Release 1.7.0
* configure.ac: Bump LT vesion to C26/A15/R0.

Signed-off-by: Werner Koch <wk@gnupg.org>
2016-09-21 09:18:01 +02:00
Werner Koch
936928632b
python: Create install dir.
* lang/python/Makefile.am (install-exec-local): Create dir.

Signed-off-by: Werner Koch <wk@gnupg.org>
2016-09-21 09:18:00 +02:00
Werner Koch
0763357e39
tests: Make "make -j distcheck" work in Python.
* lang/python/Makefile.am (SUBDIRS): Make current dir fist.
* lang/python/tests/Makefile.am (xcheck): Depend on pubring-stamp.
(CLEANFILES): Remove private-keys-v1.d/gpg-sample.stamp.
(check-local): Remove.
(initial.py): Remove dependency.
(./pubring-stamp): Depend on conf files and the
private-keys-v1.d/gpg-sample.stamp file.  Also replace use of
basename.

--

This addresses the problem that two rules might run the private keys
copy rule and due to the files being chmod -w during make discheck the
second process running that rule's cp would get a permission error.

Signed-off-by: Werner Koch <wk@gnupg.org>
2016-09-20 19:58:00 +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
29207bcd3b
tests: Improve portability.
* lang/qt/tests/Makefile.am (clean-local): Avoid non-portable "--"
* lang/python/Makefile.am (copystamp): Use well defined cp -R instead
of cp -r.

Signed-off-by: Werner Koch <wk@gnupg.org>
2016-09-20 19:46:04 +02:00
Werner Koch
df7e92b4d5
build: Create swdb file.
* Makefile.am (distcheck-hook): New.
(dist-hook): s/VERSION/PACKAGE_VERSION/ for future compatibility.

Signed-off-by: Werner Koch <wk@gnupg.org>
2016-09-20 19:43:49 +02:00
Justus Winter
ef99b74eb1 python: Fix detection of Python available versions.
* configure.ac: Test for 'PYTHON_VERSION' as 'AX_PYTHON_DEVEL' sets
'PYTHON' but clears the former.

Fixes-commit: 99db3512
Signed-off-by: Justus Winter <justus@g10code.com>
2016-09-20 11:10:10 +02:00
Andre Heinecke
e3c35147d6 core: Remove moc artifact
* src/moc_kdpipeiodevice.cpp: Removed.
* src/Makefile.am (EXTRA_DIST): Remove moc_kdpipeiodevice.cpp.

--
This file was overlooked in 58ed9c17 which removed the unused
and obsolete w32-qt code. See lang/qt QIODeviceDataProvider which
replaced kdpipeiodevice.
2016-09-19 14:29:03 +02:00
Andre Heinecke
e89279442e Add NEWS entry for qt/cpp
--
2016-09-19 14:21:45 +02:00
Andre Heinecke
3f92253e0e qt: Improve README
* lang/qt/README: Add more content. Clearly note license difference.
2016-09-19 14:09:44 +02:00
Andre Heinecke
66febf9942 cpp: Improve README
* lang/cpp/README: Add more content, move license to bottom.
2016-09-19 14:09:19 +02:00
Justus Winter
65f6f68f09 python: Improve metadata and READMEs.
--
Signed-off-by: Justus Winter <justus@g10code.com>
2016-09-19 12:49:14 +02:00
Andre Heinecke
d438cb59a0 qt: Add debug output for testTofuPolicy
* lang/qt/tests/t-tofuinfo.cpp (testTofuPolicy): Add
debug output.

--
The debug output is only emitted before a failure of the
test in case a keylisting of bravo@example.net fails which
it should never do.
2016-09-19 10:01:19 +02:00
Werner Koch
db23985127
doc: Mention language bindings in the manual.
--

Signed-off-by: Werner Koch <wk@gnupg.org>
2016-09-19 09:06:32 +02:00
Ben Kibbey
9d62bacac7
core: Check for GPG_TTY as well as DISPLAY.
* src/engine-assuan.c (llass_new): Update --ttyname from GPG_TTY.
* src/engine-g13.c (g13_new): Ditto.
* src/engine-gpg.c (gpg_new): Ditto.
* src/engine-uiserver.c (uiserver_new): Ditto.
* src/engine-gpgsm.c (gpgsm_new): Ditto.

--
Useful when no DISPLAY is set and there is no attached terminal to the
current process.

Signed-off-by: Ben Kibbey <bjk@luxsci.net>
2016-09-19 08:35:20 +02:00
Andre Heinecke
a8ff34fc30 qt: Add test for setting tofu policy
* lang/qt/tests/t-tofuinfo.cpp (testTofuPolicy): New.
2016-09-16 16:58:39 +02:00
Andre Heinecke
77aecfb5c9 qt: Add job for tofupolicy
* lang/qt/src/job.cpp, lang/qt/src/protocol.h,
lang/qt/src/protocol_p.h: Register job.
* lang/qt/src/qgpgmetofupolicyjob.cpp,
lang/qt/src/qgpgmetofupolicyjob.h,
lang/qt/src/tofupolicyjob.h: New.
* lang/qt/src/Makefile.am: Update accordingly.
2016-09-16 16:58:39 +02:00
Andre Heinecke
4d384d7bfe cpp: Add support for gpgme_op_tofu_policy
* src/context.cpp, src/context.h (setTofuPolicy, setTofuPolicyStart):
New.
2016-09-16 16:58:39 +02:00
Andre Heinecke
32baac8cde cpp: Declare sizes of tofu-info enums
* lang/cpp/src/tofuinfo.h (Policy, Validity): Declare sizes.

--
This is a quick ABI break before the release so that we can
easier extend them in the future. All new enums in public API
should be declared with a size from now on.
2016-09-16 16:58:38 +02:00
Werner Koch
bd24db313d
cpp: Silence use of deprecated function warning.
* lang/cpp/src/context.cpp (GpgME): Use pragma to silence wardning.

Signed-off-by: Werner Koch <wk@gnupg.org>
2016-09-16 16:00:57 +02:00
Werner Koch
b615316168
core: Document the version a function has been deprecated.
* src/gpgme.h.in (_GPGME_DEPRECATED): Change to take versio numbers
for documentation.  Change all places.
(_GPGME_DEPRECATED_OUTSIDE_GPGME): Ditto.
* lang/python/gpgme-h-clean.py: Adjust RE.

Signed-off-by: Werner Koch <wk@gnupg.org>
2016-09-16 16:00:27 +02:00
Werner Koch
3d6340e8c5
core: Map GPGME_STATUS_EOF to the empty string.
* src/status-table.c (_gpgme_status_to_string): Return "" for EOF.
* src/engine-gpg.c (read_status): Ditto.  The old code accidently used
GPGME_STATUS_EOF which is the integer 0 and neiteyr NULL nor a string.

Signed-off-by: Werner Koch <wk@gnupg.org>
2016-09-16 16:00:27 +02:00
Justus Winter
6af7bee076 python: Release the GIL during calls into GPGME.
* lang/python/helpers.c (pyme_raise_callback_exception): Re-acquire
the Global Interpreter Lock.
(pyPassphraseCb, pyme_set_passphrase_cb, pyProgressCb,
pyme_set_progress_cb, pyStatusCb, pyme_set_status_cb,
_pyme_interact_cb, pyDataReadCb, pyDataWriteCb, pyDataSeekCb,
pyDataReleaseCb, pyme_data_new_from_cbs, _pyme_assuan_data_cb,
_pyme_assuan_inquire_cb, _pyme_assuan_status_cb): Likewise.
* lang/python/setup.py.in: Make 'gpgme-config' emit the correct
cflags, and SWIG generate code to release the GIL before calling us.

Co-authored-by: Kai Michaelis <kai@gnupg.org>
Signed-off-by: Justus Winter <justus@g10code.com>
2016-09-16 15:56:47 +02:00
Justus Winter
a458e7fe20 python: Adapt to 'gpgme_op_interact'.
* lang/python/examples/inter-edit.py: Update example.
* lang/python/gpgme.i (gpgme_edit_cb_t): Turn into
'gpgme_interact_cb_t'.
* lang/python/helpers.c (_pyme_edit_cb): Turn into
'_pyme_interact_cb_t'.
* lang/python/private.h (_pyme_edit_cb): Likewise.
* lang/python/pyme/constants/__init__.py: Replace numeric status codes
with the keywords.
* lang/python/pyme/constants/status.py: Likewise.
* lang/python/pyme/core.py (Context.interact): New method.
(Context.op_edit): Deprecate, update docstring, implement using
Context.interact.
* lang/python/tests/t-edit.py: Test both interfaces.

Signed-off-by: Justus Winter <justus@g10code.com>
2016-09-16 14:56:29 +02:00
Justus Winter
5259f9de46 core: Fix typos.
--
Signed-off-by: Justus Winter <justus@g10code.com>
2016-09-16 13:02:55 +02:00
Werner Koch
00f95e0fad
doc: Move description of most deprecated functions to a new appendix.
--
Signed-off-by: Werner Koch <wk@gnupg.org>
2016-09-16 12:20:55 +02:00
Werner Koch
e6405df624
doc: Document the recently added --quick-foo related functions.
--
2016-09-16 11:48:29 +02:00
Werner Koch
268e251b80
core: Remove stub to try implementing gpg < 2.1 support for createkey.
* src/engine-gpg.c (gpg_createkey_legacy): Remove.
(gpg_genkey): Remove call.

Signed-off-by: Werner Koch <wk@gnupg.org>
2016-09-16 11:45:36 +02:00