Commit Graph

1197 Commits

Author SHA1 Message Date
Michael Greene
937f36bd62 fix typo 2022-11-23 10:47:09 -08:00
Michael Greene
b3f1477089 remove spurious file 2022-11-23 09:57:10 -08:00
Michael Greene
0b6ff6e6c6 Merge pull request #412 from prebuilder/six
Got rid of `six`.
2022-11-23 09:52:10 -08:00
KOLANICH
a23dccef97 Got rid of six. 2022-11-11 17:39:38 +03:00
Michael Greene
23aac818e3 Merge pull request #410 from prebuilder/gpg_ver_conftest 2022-11-10 16:03:39 -08:00
Michael Greene
002e1d571e Merge pull request #312 from prebuilder/checks 2022-11-10 16:02:29 -08:00
KOLANICH
d0cea0a4e1 Fixed gpg_ver initialization in conftest.py.
It should be a global variable in order to be imported
2022-11-10 17:28:48 +03:00
KOLANICH
b8c28c5a46 Added some security checks: * a check of self-signatures (doesn't work - no self-signatures are detected on primary key (_signatures is empty), BouncyCastle detects them fine) * a check of cryptoprimitives used 2022-11-10 17:23:27 +03:00
Michael Greene
b5cc2f353b Merge pull request #415 from dkg/tz-aware-datetime 2022-11-09 14:50:16 -08:00
Michael Greene
d8a7289112 Merge pull request #414 from dkg/ignore-unknown-sig-versions 2022-11-09 14:49:21 -08:00
Daniel Kahn Gillmor
65613853fd Warn when the user passes a TZ-naive datetime object
TZ-naive datetime objects are looking for trouble.  We would prefer to
do all comparisons and work using TZ-aware datetime objects.
2022-11-09 07:52:45 -05:00
Daniel Kahn Gillmor
c880d72902 Generate and use TZ-aware datetime objects
pgpy has been using TZ-naive datetime objects, despite all OpenPGP
wire-format dates being essentially UTC.

Better to represent the datetime objects explicitly as UTC.

Closes: #401
2022-11-09 07:52:28 -05:00
Daniel Kahn Gillmor
82614f8019 Ignore unrecognized signature versions
As new versions of OpenPGP signatures are defined, implementations may
provide multiple signatures, one of an older version for legacy
clients and one of a new version for clients that can read the new
signature form.

PGPy should skip over any signature whose version is not recognized.
2022-11-09 07:49:01 -05:00
Michael Greene
473d3651e2 Merge pull request #313 from prebuilder/genExprs
Refactoring the generator expressions for better readability and possibility to add debug output
2022-11-02 21:36:08 -07:00
Michael Greene
ae2159e504 Merge pull request #311 from prebuilder/fingerprint_class
Fingerprint class
2022-11-02 21:31:47 -07:00
Michael Greene
d958cfe6a3 Merge pull request #309 from prebuilder/subkey_binding_signature
Added a subkey binding signature subpacket.
2022-11-02 21:28:35 -07:00
Michael Greene
f1a41ede87 Merge pull request #388 from dkg/passwords-as-bytes
Accept passphrases as bytes
2022-11-02 21:25:39 -07:00
Michael Greene
10f7d765e3 Merge pull request #394 from ignaloidas/default-to-3DES
Default to 3DES when preferred algorithms don't have any supporting algorithm
2022-11-02 21:24:56 -07:00
Michael Greene
0ba2bc5b15 Merge pull request #403 from hofrob/fix-removed-cryptography-utils-register-interface
fix removed cryptography.utils.register_interface
2022-11-02 21:23:56 -07:00
Michael Greene
c3d3afcbef Merge pull request #396 from bitfehler/bitfehler/is_ascii_regex
Allow tabs in regex for ASCII validity check
2022-11-02 21:23:38 -07:00
Michael Greene
4f133bbd15 Merge pull request #404 from kianmeng/fix-typos
Fix typos
2022-11-02 21:21:19 -07:00
Michael Greene
cd8dd43ddd Merge pull request #406 from eli-schwartz/testsuite-nointegration-regression
fix testsuite regression that immediately crashed without integration tests
2022-11-02 21:20:50 -07:00
Michael Greene
e0a4dcbe46 Merge pull request #407 from thesuperzapper/pin-cryptography-38
pin cryptography < 38.0.0 (fix pip install)
2022-11-02 21:14:56 -07:00
Mathew Wicks
ab706919d5 pin cryptography < 38.0.0 2022-11-01 16:32:00 +11:00
Eli Schwartz
383a3c9e64 fix testsuite regression that immediately crashed without integration tests
In commit 08a76fdda9, distutils was
dropped. Before then, gpg_ver was a global mutable class instance,
mutated inside a function and then used. After then, it's a global
string that is... also modified inside a function and then used.

Strings cannot be modified inside functions like that. It shadows the
variable in the local scope, which means the global variable is
inaccessible now. In fact the global variable exists solely to be used
inside this function, but now it cannot be.

So, because it can be bound inside the function, it *must* be, but only
if python-gpg was installed did this actually occur. If not, we skipped
the integration tests and then tried to log the version, assuming that
the global default value of "unknown" was still bound, which is no
longer true.
2022-10-26 20:57:16 -04:00
Kian-Meng Ang
6e5b685be3 Fix typos
Found via `codespell -L nd,wth,te,useg,bu,fpr,fo,clen,varius,unce`
2022-10-10 17:13:41 +08:00
Robert Hofer
d84597eb84 fix removed cryptography.utils.register_interface 2022-09-11 17:21:55 +02:00
Conrad Hoffmann
d2bd9e83b0 Allow tabs in regex for ASCII validity check
They can occur e.g. in armor headers.

Fixes: #395
2022-05-30 20:39:02 +02:00
Ignas Kiela
e0eb8fb4a5 Default to 3DES when preferred algorithms don't have any supporting algorithm
As per RFC 4880 13.2, "Since TripleDES is the MUST-implement algorithm,
if it is not explicitly in the list, it is tacitly at the end."

Some keys in the wild do not have it explicitly in the list, so put it
there as a default.
2022-04-20 17:53:29 +03:00
James Morris
02766befcd Merge pull request #387 from dkg/drop-distutils
tests: drop distutils
2022-02-02 13:08:45 -05:00
James Morris
85e5364a45 Bump Sphinx version 2022-02-02 12:51:08 -05:00
Daniel Kahn Gillmor
412540ad72 Accept passphrases as bytes
The OpenPGP specifications are ambiguous about the encoding of
passwords.

In practice, we expect most passphrases to be UTF-8-encoded, but if
the incoming passphrase is in fact a bytestring, we ought to be able
to handle it correctly.

Signed-off-by: Daniel Kahn Gillmor <dkg@fifthhorseman.net>
2022-02-01 23:05:54 -05:00
Daniel Kahn Gillmor
08a76fdda9 tests: drop distutils
distutils is going away in python 3.12.  LooseVersion() wasn't really
being used for anything particularly useful.  The strings that were
returned by the openssl backend for the cryptography module, or the
GPGME "engine" version were both just being replayed later as strings
anyway.

So, keep them in string form.  If future work needs to do things like
compare them, apparently packaging.version contains classes that might
be better-maintained going forward.

Signed-off-by: Daniel Kahn Gillmor <dkg@fifthhorseman.net>
2022-01-31 19:51:12 -05:00
James Morris
1594e41c09 Use HTML4 writer on Sphinx 2.0 and later 2021-12-24 13:10:48 -05:00
James Morris
852e830c37 Update deprecated autodoc_default_flags to autodoc_default_options 2021-12-21 16:56:36 -05:00
James Morris
946927f4c1 Update deprecated add_stylesheet to add_css_file 2021-12-21 16:24:41 -05:00
James Morris
955d166947 Add 3.10 tests 2021-12-21 11:41:29 -05:00
James Morris
c634d7a776 Merge pull request #380 from tzaffi/docs-vanilla-example
add example encrypting with a public key and decrypting with private key
2021-09-24 11:55:57 -04:00
James Morris
d009a6c5e5 Small rewording 2021-09-24 11:55:31 -04:00
James Morris
1bc474dff2 Fix comment 2021-09-24 10:52:28 -04:00
James Morris
6e6da41406 Error if we are running on GitHub CI without integration tests 2021-09-24 10:44:50 -04:00
Zeph Grunschlag
543b6ccd10 Update docs/source/examples/actions.rst 2021-09-24 07:36:18 -04:00
Zeph Grunschlag
0136213225 add example encrypting with a public key and decrypting with private key 2021-09-23 23:02:05 -04:00
James Morris
ff0c5cf9b9 Use a patched pytest-order
pytest-order contains a fix for parameterized tests in 1.0, but
that version dropped support for Python 3.5. This patched version
runs on Python 3.5 and has all the other updates in pytest-order 1.0.
2021-09-23 20:08:51 -04:00
James Morris
2536f36067 Fix mispelled tests messing with ordering 2021-09-23 18:59:41 -04:00
James Morris
5fe1cba13d Try running tests with Ubuntu's gpgme 2021-09-23 15:49:40 -04:00
James Morris
ab2bb90c1e Run Linux tests on ubuntu-18.04 2021-09-23 15:03:36 -04:00
James Morris
18796200c8 Merge pull request #378 from eli-schwartz/setup-cfg
remove unneeded setup_requires which are already in pyproject.toml
2021-09-23 12:30:04 -04:00
Eli Schwartz
d7e2c5c23f remove unneeded setup_requires which are already in pyproject.toml
A setup.cfg project metadata section is only ever parsed by setuptools,
and thusly does not need to specify that it depends on having setuptools
installed (it is already specified in the pyproject.toml)

Wheel is not required either, since it is only actually used by the
pyproject.toml specified build backend, and wheel is already specified
in the pyproject.toml

pyproject.toml build-requires is intended to specify the basic
requirements for acquiring a usable instance of the build backend. These
packages are dependencies of PEP 517.

setup_requires is intended only for additional project-specific packages
needed in addition to the build backend. These packages are dependencies
of setuptools.setup()

Example difference: wheel is required in order to create a wheel,
pyproject.toml specifies the creation of a wheel. wheel is NOT required
(and is not used at all) in order to run `python setup.py install`,
which does not read pyproject.toml at all.
2021-08-16 13:10:07 -04:00
Gabriel Cruz
50ef17a9b1 Feature:: Support for keys without usage flags (#371)
Co-authored-by: James Morris <jmorris@securityinnovation.com>
2021-07-08 15:52:09 -04:00