Commit Graph

964 Commits (fix/85-NOTATION)

Author SHA1 Message Date
Isis Lovecruft f3515c44d7
Add ability to parse NOTIFICATION_* statuses in Verify.
* FIXES Issue #85:
   https://github.com/isislovecruft/python-gnupg/issues/85
2014-11-20 05:51:20 +00:00
Isis Lovecruft a3e2f70cd8
Merge branch 'fix/83-SIG_SUBPACKET' into develop 2014-11-19 22:51:47 +00:00
Isis Lovecruft 5aaf1df5d1
Add ability to handle SIG_SUBPACKET status in Verify.
* FIXES Issue #83:
   https://github.com/isislovecruft/python-gnupg/issues/83
2014-11-19 22:50:30 +00:00
Isis Lovecruft 245cf73baf
Change versioneer parameters in gnupg/_version.py to match setup.py.
* FIXES (hopefully) Issue #80:
   https://github.com/isislovecruft/python-gnupg/issues/80
2014-11-19 21:44:53 +00:00
Isis Lovecruft 8e5b3256fa
Merge remote-tracking branch 'charles-dyfis-net/trustdb_repair_arg_fix' into develop 2014-11-19 21:29:31 +00:00
Isis Lovecruft 30c8c05f84
Merge remote-tracking branch 'charles-dyfis-net/first_usable_binary' into develop
Conflicts:
	gnupg/_util.py
2014-11-19 21:22:21 +00:00
Isis Lovecruft f9d00794ee
Merge remote-tracking branch 'charles-dyfis-net/progress_during_verify' into develop 2014-11-19 19:52:25 +00:00
Isis Lovecruft 99e597f196
Merge remote-tracking branch 'ttanner/binary-symlink' into develop 2014-11-19 19:30:29 +00:00
Isis Lovecruft de82a1c32a
Merge branch 'fix/74-no-HOME-env' into develop 2014-11-19 18:31:36 +00:00
Isis Lovecruft 1104908ef9
Don't expect a $HOME directory to be set.
* FIXES Issue #74:
   https://github.com/isislovecruft/python-gnupg/issues/74
2014-11-19 18:31:14 +00:00
Isis Lovecruft 899d429f7a
Merge branch 'fix/76-verbose-flag-order' into develop 2014-11-19 04:29:22 +00:00
Isis Lovecruft 59992eb8c3
Put verbosity args before other options/args.
* FIXES Issue #76:
   https://github.com/isislovecruft/python-gnupg/issues/76
2014-11-19 03:51:06 +00:00
Isis Lovecruft fecf92c0ac
Remove expectation for UnicodeDecodeError in a unittest.
It seems that more modern versions of Python (e.g. 2.7.8), doing:

    from __future__ import print_function
    print("SIG=%s" % sig)

with some binary data doesn't actually produce a UnicodeDecodeError,
which means that Python2 is slowly getting less retarded. :D

On the downside, we probably shouldn't have been testing for things
which are Python2.x mis-design issues (and not really our fault, nor a
bug in python-gnupg) anyway.
2014-11-19 03:46:44 +00:00
Isis Lovecruft 751f25cb35
Merge branch 'fix/49-unicode-decode-on-readline' into develop 2014-10-28 01:07:12 +00:00
Isis Lovecruft d9116bace6
Replace UnicodeDecodeErrors caused by Python2 readline() method.
* CHANGE gnupg._meta.GPGBase.__init__() to register the builtin
   `codecs.replace_errors` handler and a global codecs "strict" error
   handler.
 * FIXES Issue #49:
   https://github.com/isislovecruft/python-gnupg/issues/49
2014-10-28 01:01:03 +00:00
Isis Lovecruft 79b1cbc260
Merge branch 'master' into develop 2014-10-04 00:54:39 +00:00
Isis Lovecruft d1a8fb101f
Merge branch 'release/1.3.2' 2014-10-04 00:53:44 +00:00
Charles Duffy 98e0fc7cf5 properly pass argument during trustdb repair 2014-10-02 04:56:56 -05:00
Charles Duffy 1b8c305829 Continue search for a usable binary if entries are symlinks
Existing code gives up searching for a GnuPG executable (returning None --
contrary to the docstring indicating that a RuntimeError will be thrown in all
cases where no binary can be found) if the first item found is a symlink or is
not accessed via an absolute path.

This refactored version moves the filtering logic down into the _which helper
-- and thus continues to search past unacceptable results -- even if the first
item found is not acceptable.
2014-09-30 20:45:44 -05:00
Charles Duffy 41c388e8f7 Ignore PROGRESS messages during verify operation
Parsing such messages would change documented behavior (which specifies a
limited set of messages, not conforming with the given status codes). Ignoring
them is thus the safer change.
2014-09-30 20:28:50 -05:00
Isis Lovecruft 7c2d060fca
Merge branch 'fix/63-hanging-fd' into develop 2014-09-27 01:27:59 +00:00
Isis Lovecruft 4a8a8c8592
Close process FDs after __init__() sanity check.
* FIXES and issue discovered by ttanner (https://github.com/ttanner)
   in `gnupg._meta.GPGBase._check_sane_and_get_gpg_version()` where the
   GnuPG process wasn't closed and its file descriptors were left
   hanging.

 * FIXES part of Issue #63.
   https://github.com/isislovecruft/python-gnupg/issues/63

   There were so many hanging FD issues when I started patching
   upstream python-gnupg ― I doubt I found all of them. I probably even
   introduced some along the way. And, as ttanner pointed out, this
   patch doesn't fix the issue fully, so there are likely more.
2014-09-27 01:22:27 +00:00
Isis Lovecruft 432833bdcb
Add an `upload` Makefile directive for uploading to PyPI. 2014-09-27 01:21:01 +00:00
Isis Lovecruft f6453b96a6
Add a `cleanup-dist` Makefile directive. 2014-09-27 01:19:08 +00:00
Isis Lovecruft 3a287d6e11
Remove generated MANIFEST file in `cleanup-build` Makefile directive. 2014-09-27 01:18:24 +00:00
Isis Lovecruft 17cf24c30d
Remove unused .travis.yml file.
It wouldn't be very nice to test this on Travis for three versions of
Python, because some of the integration tests generate keys, and
although this is usually done with a UID comment saying `(INSECURE!)`
in order to trigger libgcrypt's use of the dummy RNG, the testing
process is still a little brutal on heavily used headless machines.
2014-09-27 01:15:36 +00:00
Isis Lovecruft 572c911b82 Merge branch 'fix/30-hidden-recipient' into develop 2014-09-27 00:38:59 +00:00
Isis Lovecruft 2266a146c3
Exclude logfiles and Emacs autosave files from being packaged on PyPI.
* FIXES part of Issue #65.
   https://github.com/isislovecruft/python-gnupg/issues/65
2014-09-26 23:45:44 +00:00
Isis Lovecruft 3f2fc00ef0
Exclude anything in private directories from being packaged on PyPI. 2014-09-26 23:43:46 +00:00
Isis Lovecruft 177d762cef
Include in PyPI packages the examples/ directory.
* FIXES part of Issue #65.
   https://github.com/isislovecruft/python-gnupg/issues/65
2014-09-26 06:35:17 +00:00
Isis Lovecruft eeeb8580b3
Only PyPI package docs/ files necessary for Sphinx builds.
* FIXES part of Issue #65.
   https://github.com/isislovecruft/python-gnupg/issues/65
2014-09-26 06:01:36 +00:00
Isis Lovecruft 29c971585d
Remove irrelevant TODO item. 2014-09-26 05:58:21 +00:00
Isis Lovecruft f97c78d963
Remove outdated, unused scripts/ directory. 2014-09-26 05:54:57 +00:00
Isis Lovecruft ba632f3dad
Add a bunch of maintenance scripts which were in scripts/ directory.
These are going to be removed in the next commit, but just in case they
are/were useful, I'm making a record of their existence.
2014-09-26 05:53:28 +00:00
Isis Lovecruft 345ac83742
Remove old, unused patches/ directory. 2014-09-26 05:43:22 +00:00
Isis Lovecruft 1472a5ccb7
Merge branch 'fix/66-keyrevoked' into develop 2014-09-26 03:50:34 +00:00
Isis Lovecruft 4da7ec92bd
Handle KEYREVOKED status message during signature verification.
If we get a VALIDSIG, but the signing key has since been revoked, we
(mostly) ignore the KEYREVOKED status message (except to append "key
revoked" to the `Verify.status` string).

 * ADD ability to handle KEYREVOKED status to `gnupg._parsers.Verify`.

 * FIXES Issue #66
   https://github.com/isislovecruft/python-gnupg/issues/66

 * THANKS TO Tom Galloway for finding this bug.
   https://github.com/tomgalloway

 * CLOSES PR#38
   https://github.com/isislovecruft/python-gnupg/pull/38
2014-09-26 03:39:36 +00:00
Isis Lovecruft 08370fbc02
Merge branch 'fix/44-verbose-arg' into develop 2014-09-26 02:52:27 +00:00
Isis Lovecruft b51b0eb5ac
Only use `--debug-level=` syntax if GnuPG<=1.4.18.
* FIXES Issue #44 (again):
   https://github.com/isislovecruft/python-gnupg/issues/44#issuecomment-56907151
2014-09-26 02:43:22 +00:00
Isis Lovecruft bb5e2444ad
Cleanup logic for helping users who set a weird `verbose=` level.
* ADD new `gnupg._meta.GPGBase._set_verbose()` method, which will set
   `'basic'` as the default `--debug-level` for GnuPG, if the user did
   something weird like specifying `verbose=True` or typoing one of the
   string levels (e.g. `verbose='guruu'`).
2014-09-26 02:36:12 +00:00
Isis Lovecruft 6e228c3ef0
Move logic for sanity check and getting binary version to new method.
* CHANGE behaviour so that `gnupg.GPG.binary_version` is set in
   `gnupg._meta.GPGBase.__init__()`, instead of `gnupg.GPG.__init__()`.

 * ADD new `gnupg._meta.GPGBase._check_sane_and_get_gpg_version()`
   method, and move logic for doing a sanity check on the binary and
   getting the binary's version, which was previously in
   `gnupg.GPG.__init__()`, into this new method.

 * ADD an additional field for the `binary_version` to the logger call
   which displays initialisation settings when `gnupg.GPG.__init__()`
   is run.
2014-09-26 02:29:59 +00:00
Isis Lovecruft eb25ef2b91
Only compile the version string regex once on module import.
* MOVE the compiled regex for matching the GnuPG binary's version to a
   module-level variable in `gnupg._util`.
2014-09-26 02:24:46 +00:00
Isis Lovecruft 7dc3b66de4
Make GnuPG>2.0.x only methods always public.
They are only effective if the binary is GnuPG>=2.0.x anyway, and the
extra code to change the method names depending on the underlying
binary will cause clutter for anyone using python-gnupg.

This change is backwards compatible with python-gnupg<=1.3.1, since the
private methods (e.g. `gnupg.GPG._create_trusttb`) are kept intact.
2014-09-26 02:23:37 +00:00
Isis Lovecruft ed031210ca
Merge branch 'fix/44-verbose-arg' into develop 2014-09-24 22:21:56 +00:00
Isis Lovecruft 69cc991938
Fix bug in determining behaviours for those using GnuPG2 binaries.
This bug caused some extra behaviours which should only be invoked if
the user is using a gpg2 binary. It was caused by checking:

    if _util._is_gpg2:

which is always true, since `_util._is_gpg2` is a function which isn't
being called in this case, i.e.:

    >>> def foo(): return False
    >>> bool(foo)
    True

So instead this should be changed to actually call `_util._is_gpg2()`,
by using `gnupg.GPG.is_gpg2()` which will automatically pass in the
detected binary version number.
2014-09-24 22:13:25 +00:00
Isis Lovecruft 5ad99acd7c
Despite what GnuPG says it expects, it actually expects `--debug-level=`.
* FIXES Issue #44:
   https://github.com/isislovecruft/python-gnupg/issues/44
2014-09-24 22:12:20 +00:00
Isis Lovecruft d5fe2d7cc4
GnuPG's `--debug-level` ints are only required to be ≥ 1.
They aren't required to be ≤ 9, as the previous check in
`gnupg._meta.GPGBase._make_args()` ensured. That is, calling GnuPG from
the commandline, doing:

  $ gpg --debug-level=100000 …

is valid, so we should also accept 10000 (even though everything > 8
means the same debug level anyway).
2014-09-24 22:07:42 +00:00
Isis Lovecruft 7c56dd5864
Merge remote-tracking branch 'akerl/master' into develop 2014-09-24 21:30:46 +00:00
Isis Lovecruft f521545903
Merge remote-tracking branch 'anarcat/dev/monkeysign' into develop 2014-09-24 21:12:05 +00:00
Isis Lovecruft 728b5c8ec9
Merge remote-tracking branch 'kalikaneko/feature/expand-homedir' into develop 2014-09-24 19:49:34 +00:00