Commit graph

183 commits

Author SHA1 Message Date
Paul Kehrer
4d77fb9d3e
3.4.5 backports and changelog/version bump (#5827)
* Bump pyo3 and lower MSRV (#5823)

* fix signature of EllipticCurvePublicKey.verify() (#5808)

The signature change was introduced in https://github.com/pyca/cryptography/pull/5729 but is inconsistent with respect to related methods, breaks backward compatibility and compatibility with the OpenSSL backend (and maybe other backends) when named arguments are used.

* Name: update get_attributes_for_oid return type (#5809)

`List` gives more power to the caller.

Note that `RelativeDistinguishedName`, the same function returns a `List`.

Is there a reason this was `Iterable` only for `Name`? If we don't want to
promise `List`, `Sequence` is another alternative.

* Start typing a bunch of stuff from x509 extensions (#5812)

* part 2 of typing x509 extensions (#5815)

* 3.4.5 changelog and version bump

* spelling

* fix a false positive from the latest clippy (#5813)

Co-authored-by: Alex Gaynor <alex.gaynor@gmail.com>
Co-authored-by: Markus Wamser <wamserma@users.noreply.github.com>
Co-authored-by: Dan Halperin <dhalperi@users.noreply.github.com>
2021-02-13 16:44:43 -05:00
Alex Gaynor
0f40cb3acb
[3.4] Specify an MSRV in setup.py (#5789) (#5790)
* Specify an MSRV in setup.py (#5789)

* Changelog
2021-02-08 19:14:08 -06:00
Alex Gaynor
4a66e2bdde
[3.4] More aggressively point people at Rust version docs (#5782) (#5783) 2021-02-08 09:51:55 -06:00
Christian Heimes
843ada65e8
Remove setuptools_rust from install requirement (#5779) (#5781)
* Remove setuptools_rust from install requirement

setuptools_rust is only required for building cryptography.

Fixes: https://github.com/pyca/cryptography/issues/5778
Signed-off-by: Christian Heimes <cheimes@redhat.com>

* sdist needs setuptools_rust

Signed-off-by: Christian Heimes <cheimes@redhat.com>
2021-02-08 09:11:53 -06:00
Paul Kehrer
ebde3be7ef
3.4.1 fixes and changelog bump (#5761)
* Try to assist folks having issues with older pips (#5757)

* Try to assist folks having issues with older pips

* Update setup.py

* Update setup.py

* fix import cycle with asymmetricpadding (#5758)

* fix import cycle with asymmetricpadding

* Update src/cryptography/hazmat/primitives/_asymmetric.py

* bump for 3.4.1

Co-authored-by: Alex Gaynor <alex.gaynor@gmail.com>
2021-02-07 16:35:24 -05:00
Alex Gaynor
c84d6ee060
Integrate Rust into the build process properly (#5410) 2020-12-22 13:33:47 -06:00
Alex Gaynor
149796628e
put pytest configuration somewhere that goes in the sdist (#5648)
fixes #5646
2020-12-15 08:42:34 -06:00
Paul Kehrer
137b432da0
xdist experiment (#5621)
* switch to xdist in tox for faster runs

* not using auto to avoid too many processes on local laptops
* we need to use pytest-cov to generate coverage properly now

* these env vars aren't present on no coverage builds

* tox changes
2020-12-10 16:51:05 -05:00
Alex Gaynor
da2879d387
remove check from setup.py that's not needed anymore (#5626)
pypy 7.2 is the oldest pypy that supports py3.6
2020-12-09 21:33:57 -06:00
Alex Gaynor
e66db8079d
Complete removal of py2 (#5533)
* Drop Python 2

* Black everything
2020-12-09 09:13:48 -06:00
Alex Gaynor
e0477596f7
Remove __future__ import from our code (#5610) 2020-12-09 00:35:11 -06:00
Alex Gaynor
b3540ec4a3
Write a bunch of primitives tests as subtests for performance (#5246) 2020-12-09 00:20:32 -06:00
Alex Gaynor
7d4e567e16
Switch black to py36 as the minimum version (#5608) 2020-12-08 23:40:21 -06:00
Alex Gaynor
ff12a37552
Remove Python2 from CI and code that branched on it (#5607)
* Remove Python2 from CI and code that branched on it

* Update setup.py

Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>

* remove

* review feedback

Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>
2020-12-08 23:10:10 -06:00
Alex Gaynor
1be144acc6
bump cffi minimum version to help out pyopenssl (#5598)
fixes https://github.com/pyca/pyopenssl/issues/971
2020-12-01 13:01:43 -06:00
Alex Gaynor
96f2d96d1c
remove legacy debugging code from setup.py (#5597) 2020-12-01 12:23:39 -06:00
Paul Kehrer
66654d628d
print some stuff in setup.py to try to educate people (#5539)
This is likely futile, but maybe it will slightly help out people who
run into compilation errors and actually choose to look at the output.
2020-10-31 19:10:10 -04:00
Alex Gaynor
d9e174d3e1
Drop python 3.5 (#5527) 2020-10-28 07:38:42 -07:00
Paul Kehrer
0b2435940e
remove keywords with side effects hack in setup.py (#5426) 2020-08-25 11:28:08 -04:00
Paul Kehrer
ace8a92be9
remove idna support finally (#5351)
* remove idna support finally

* remove unused import
2020-07-26 13:07:31 -04:00
Alex Gaynor
60aa04481f
Paint it Black by the Rolling Stones (#5324) 2020-07-20 13:06:29 -05:00
Alex Gaynor
907ec96ee8
Disable parallel docs builds to fix spellcheck (#5287) 2020-06-26 09:01:52 -05:00
Alex Gaynor
33c2e55930
ban a sphinxcontrib-spelling version that breaks things (#5284)
* ban a sphinxcontrib-spelling version that breaks things

* try bumping the pypy3 version
2020-06-24 20:16:01 -05:00
Marko Kreen
0f8626093c
Support OpenSSH private key serialization format (#5146)
* ssh.py contains load/serialize code.
* Add PrivateFormat.OpenSSH to .private_bytes() format.
* Add load_ssh_private_key().
* Use new code for PublicFormat.OpenSSH too.
* load_ssh_public_key() now supports reading signed public keys.
* Supported algorithms: rsa, dsa, ec, ed25519.
* Optional dependency on 'bcrypt' package via [ssh] extra
2020-06-20 19:06:26 -05:00
Paul Kehrer
170599b87c
block another broken sphinx version (#5277) 2020-06-14 13:11:07 -04:00
Alex Gaynor
9dd4e1f2ce
Block a sphinx version that's broken (#5272) 2020-06-12 08:50:55 -05:00
Alex Gaynor
7dcd284c6e
Remove dead constant time code (#5239) 2020-04-26 17:19:57 -05:00
Paul Kehrer
d75335a7de drop python 3.4 support (#5087)
* drop python 3.4 support

Our dependencies have started dropping support so it is becoming
difficult to test. Additionally, Python 3.4 represents <2% of our
downloads, so taking on a large maintenance burden to maintain support
isn't a good use of limited time. Accordingly, we're dropping testing
infrastructure and migrating our abi3 wheels to py35+.

* use removed instead of dropped
2019-12-08 23:42:55 -05:00
Alex Gaynor
ae13fec7fc Fixes #5010 -- test and build 3.8 wheels (#5013)
* Fixes #5010 -- test and build 3.8 wheels

* try using isolated_build = True to work around a failure
2019-10-17 08:32:04 +08:00
David Benjamin
2d3b420383 Remove asn1crypto dependency (#4941)
* Remove non-test dependencies on asn1crypto.

cryptography.io actually contains two OpenSSL bindings right now, the
expected cffi one, and an optional one hidden in asn1crypto. asn1crypto
contains a lot of things that cryptography.io doesn't use, including a
BER parser and a hand-rolled and not constant-time EC implementation.

Instead, check in a much small DER-only parser in cryptography/hazmat. A
quick benchmark suggests this parser is also faster than asn1crypto:

  from __future__ import absolute_import, division, print_function
  import timeit

  print(timeit.timeit(
      "decode_dss_signature(sig)",
      setup=r"""
  from cryptography.hazmat.primitives.asymmetric.utils import decode_dss_signature
  sig=b"\x30\x2d\x02\x15\x00\xb5\xaf\x30\x78\x67\xfb\x8b\x54\x39\x00\x13\xcc\x67\x02\x0d\xdf\x1f\x2c\x0b\x81\x02\x14\x62\x0d\x3b\x22\xab\x50\x31\x44\x0c\x3e\x35\xea\xb6\xf4\x81\x29\x8f\x9e\x9f\x08"
  """,
      number=10000))

Python 2.7:
  asn1crypto: 0.25
  _der.py: 0.098

Python 3.5:
  asn1crypto: 0.17
  _der.py: 0.10

* Remove test dependencies on asn1crypto.

The remaining use of asn1crypto was some sanity-checking of
Certificates. Add a minimal X.509 parser to extract the relevant fields.

* Add a read_single_element helper function.

The outermost read is a little tedious.

* Address flake8 warnings

* Fix test for long-form vs short-form lengths.

Testing a zero length trips both this check and the non-minimal long
form check. Use a one-byte length to cover the missing branch.

* Remove support for negative integers.

These never come up in valid signatures. Note, however, this does
change public API.

* Update src/cryptography/hazmat/primitives/asymmetric/utils.py

Co-Authored-By: Alex Gaynor <alex.gaynor@gmail.com>

* Review comments

* Avoid hardcoding the serialization of NULL in decode_asn1.py too.
2019-07-28 12:06:40 -05:00
Alex Gaynor
ab115a9d19 Drop setup.py test support. (#4879)
* Drop setup.py test support.

It's fragile and relies on eggs. While our downstream redistributors don't love this (sorry!), it seems like the right tradeoff.

* Remove unused

* Added a changelog entry

* typo

* line length
2019-05-07 15:52:49 -04:00
Alex Gaynor
5fbc54ec05 Added an explicit content type for long_description (#4826)
It already defaults to x-rst, but this silences a warning
2019-04-01 13:04:04 +13:00
Paul Kehrer
3c68250ad9 allow bytes-like for key/iv/data for symmetric encryption (#4621)
* allow bytearrays for key/iv for symmetric encryption

* bump pypy/cffi requirements

* update docs, fix some tests

* old openssl is naught but pain

* revert a typo

* use trusty for old pypy

* better error msg again

* restore match
2018-12-09 23:13:31 -05:00
Paul Kehrer
7e422821b9 remove idna as a primary dependency (#4624)
* remove idna as a primary dependency

* empty commit

* dynamodb test fix (thanks to Matt Bullock)

* review feedback
2018-12-06 22:43:38 -05:00
Paul Kehrer
6d7b70e8f2 switch to twine check for verifying our readme renders on pypi (#4623) 2018-12-02 10:50:54 -05:00
Paul Kehrer
71e4251d83 blacklist latest hypothesis and pytest (#4510)
* ci is suffering again, is it the new pytest or hypothesis?

* now try 3.79.2 hypothesis

* it's a blacklist party
2018-10-23 07:34:01 -04:00
Paul Kehrer
d2df398bcd blacklist some pytests (#4502) 2018-10-19 09:29:42 -04:00
Paul Kehrer
7700251f26 block sphinx 1.8.0 since it fails our docs job (#4469) 2018-09-14 13:01:12 -04:00
Paul Kehrer
0322962e14 update pytest config (#4463)
* update pytest config

pytest 3.8.0 was just released and officially deprecates some of the way
we do pytest marks. They introduced a new way to do this in 3.6 so this
PR switches to that mechanism and updates our minimum pytest requirement

* update the stubs

* also update wycheproof test config to remove deprecated paths

* don't need this any more
2018-09-06 23:56:46 -04:00
Alex Gaynor
2af3d4c51b Fixes #3548 - add a pyproject.toml (#4363) 2018-07-23 13:10:13 -04:00
Paul Kehrer
4ee1cb9497 Add py37 (#4298)
* test against python 3.7 for windows

* update docs to say we test on 3.7

* more succinct

* maybe make this actually work.

* link properly

* moar changes
2018-06-27 23:07:14 -04:00
Jon Dufresne
95820b4e4f Document project as stable and ready for use in production (#4284) 2018-06-16 18:33:33 -07:00
Alex Gaynor
ca2055f982 Remove cffi branch for pypy that's not needed (#4209)
* Remove cffi branch for pypy that's not needed

* simplify further
2018-04-28 09:31:02 -10:00
Alex Gaynor
e49bb15656 Remove setup.py branch (#4203) 2018-04-22 09:20:54 -05:00
Alex Gaynor
ba45d28fc3 Remove version number from an error message so that it makes sense (#4188) 2018-04-09 04:39:08 +08:00
Paul Kehrer
e3d2fc1727 install only the minimum required to build our docs for rtd (#4133)
* install only the minimum required to build our docs for rtd

We don't need to install sphinxcontrib-spelling or doc8 in rtd.

* move another package
2018-03-05 19:50:10 -05:00
Paul Kehrer
ba6798161c temporarily pin cffi to avoid bug related to virtualenv (#4083)
* temporarily pin cffi to avoid bug related to virtualenv

* right, don't duplicate the name
2018-01-12 14:16:46 -05:00
Alex Gaynor
0ed80b467d Fixed #4039 -- added a python_requires to setup.py (#4064) 2017-12-26 12:04:31 -06:00
Paul Kehrer
9b086fdb07 pytest 3.3.0 has an issue with parametrized null bytes again (#4026) 2017-11-28 07:49:32 -06:00
Alex Gaynor
4941fc5c01 clearly error out on older setuptools (#4000)
* clearly error out on older setuptools

* use the right thing
2017-10-28 10:28:53 -05:00