Commit graph

8000 commits

Author SHA1 Message Date
Sviatoslav Sydorenko
b1250e4519
Add deprecation warning handling advice note (#5346)
* Add deprecation warning handling advice note

This tip is being added to help the library maintainers keep
testing cryptography where supporting multiple Python runtime
is still necessary.

Resolves https://github.com/pyca/cryptography/issues/5335

* Move deprecation suppression advice to FAQ
2020-07-25 20:32:58 -05:00
Sviatoslav Sydorenko
a58c3d809a
Emit the deprecation one level up the stack (#5348)
Ref: https://github.com/pyca/cryptography/issues/5335#issuecomment-661880248
2020-07-25 20:29:01 -04:00
Paul Kehrer
2329b41545
remove 4 OCSP bindings we don't use (#5344) 2020-07-25 14:02:11 -04:00
Alex Gaynor
ec64843db4
Lock old issues+PRs automatically (#5342) 2020-07-24 22:02:37 -05:00
Alex Gaynor
73b128d755
Refs #5113 -- build against openssl with no ct (#5343) 2020-07-24 19:16:44 -05:00
Alex Gaynor
c3a5e082c5
fixed copyright year (#5337) 2020-07-21 11:36:08 -05:00
Alex Gaynor
56391ad537
Remove from nonsense from travis script that I think is unused (#5334) 2020-07-20 22:11:38 -05:00
Alex Gaynor
f7bc5ef7c3
fixes #5321 -- deprecate support for OpenSSL 1.0.2 (#5333) 2020-07-20 21:58:57 -05:00
Alex Gaynor
82da2316f1
fixes #5329 -- properly run CI on x.y tags (#5332) 2020-07-20 20:08:16 -05:00
Alex Gaynor
274f6af443
Delete several unused bindings (#5331) 2020-07-20 19:59:53 -05:00
Paul Kehrer
03bf8906d5
3.1 time (#5330) 2020-07-20 19:05:54 -04:00
Paul Kehrer
b0d9bdcfc9
prep 3.0 for release (#5327)
* prep 3.0 for release

* okay then
2020-07-20 16:16:47 -04:00
Alex Gaynor
6bd3faa114
Tell people to use black in our dev docs (#5328)
* Tell people to use black in our dev docs

* For codecov
2020-07-20 15:16:29 -05:00
Alex Gaynor
60aa04481f
Paint it Black by the Rolling Stones (#5324) 2020-07-20 13:06:29 -05:00
Paul Kehrer
4a245a657a
test FIPS mode on centos8 (#5323)
* test FIPS mode on centos8

* remove branch we don't take

* simpler

* better comment

* rename

* revert some things that don't matter

* small cleanups
2020-07-20 12:10:29 -04:00
Paul Kehrer
2fdb7472af
PKCS12 support (#5325)
* generate_pkcs12 (#4952)

* pkcs12 support

* simplify

* remove fixtures

* reorg and other improvements. memleak check

* ugh

* more fixes

* last changes hopefully

Co-authored-by: Tomer Shalev <tshalev@proofpoint.com>
2020-07-20 10:26:43 -04:00
Paul Kehrer
972c886f6f
refactor DH a bit to generate less parameters (#5326)
speeds things up a bit and makes it easier to do the FIPS PR
2020-07-19 22:46:20 -04:00
Alex Gaynor
31359f36c0
fix grammar in error message (#5322) 2020-07-19 12:31:29 -05:00
Paul Kehrer
084da16ebc
disable the osrandom engine on 1.1.1d+ (#5317)
* disable the osrandom engine on 1.1.1d+

* skip (and run) some tests on 1.1.1d+

* simplify our conditionals

* Update src/_cffi_src/openssl/src/osrandom_engine.c

Co-authored-by: Alex Gaynor <alex.gaynor@gmail.com>

* words

* more words

* language

* get coverage more cleverly

* a word

* Update .github/workflows/ci.yml

Co-authored-by: Alex Gaynor <alex.gaynor@gmail.com>

Co-authored-by: Alex Gaynor <alex.gaynor@gmail.com>
2020-07-19 12:33:18 -04:00
Paul Kehrer
1604ea7ec0
test exceptions and properly reject duplicate attributes in csrbuilder (#5319) 2020-07-18 22:11:23 -04:00
Alex Gaynor
b8656fc001
Implement __deepcopy__ for x509 certificates (#5318)
fixes #5129
2020-07-18 20:55:38 -05:00
Paul Kehrer
c51f7957dd
raise a valueerror on multi-SINGLERESP valued OCSP responses (#5316)
InternalErrors are bad when we know they're reachable
2020-07-18 20:59:56 -04:00
Paul Kehrer
aded1cd02f
support encoding attributes via CertificateSigningRequestBuilder (#5315)
* support encoding attributes via CertificateSigningRequestBuilder

* use a constant. now you know what 12 means!

* pep8
2020-07-18 20:55:25 -04:00
Paul Kehrer
e41177372f
change KeyUsage repr to be less confusing (#5314)
fixes #5127
2020-07-18 18:40:06 -04:00
Paul Kehrer
b8146690ec
support unstructured name x509 attributes (#5313) 2020-07-18 18:35:25 -04:00
Paul Kehrer
40e42fa65f
fix indexing on X509 request attribute value (#5312) 2020-07-18 17:32:13 -04:00
Alex Gaynor
68104923de
Avoid passing the wrong size to strncpy - simply use strcpy (#5311)
We have already validated that `p` is large enough to store `name`. In `strncpy` the `len` parameter should generally be the length of the target buffer, not the source buffer.
2020-07-18 11:08:30 -05:00
Tristan Seligmann
0064ce63c3
Set vectors -x. (#5310) 2020-07-18 10:15:10 -04:00
Steven Pitman
87b660d580
Add support for IBM z/OS (#5304) 2020-07-15 09:17:56 -05:00
Paul Kehrer
84514ee6ee
switch to a newer CSR with SHA256 and a challenge password (#5303)
we'll parse the challenge password in a doctest after another PR lands
2020-07-05 22:56:39 -04:00
Paul Kehrer
99bf4e4605
remove NPN bindings -- you should be using ALPN! (#4765)
* remove NPN bindings -- you should be using ALPN!

pyOpenSSL consumed these, but we've marked it as deprecated and it
already handles the case where the bindings are not available.

* set Cryptography_HAS_NEXTPROTONEG to 0 for pyOpenSSL

we can remove this symbol in like...5 years.

* remove another NPN related definition

* suspicious

* Revert "remove another NPN related definition"

This reverts commit d872a7d1d776858c77b8c607f63cc9b5fef1ae39.

Revert "suspicious"

This reverts commit 5b767484f1cde132f686600a46e61a18e33cbdae.
2020-07-05 22:43:31 -04:00
Paul Kehrer
28e2783a81
support x509 request challenge password parsing (#4944)
* support x509 request challenge password parsing

* switch to a more generic (but not too generic) attribute parsing

* make it raise a valueerror

* Update tests/x509/test_x509.py

Co-authored-by: Alex Gaynor <alex.gaynor@gmail.com>

Co-authored-by: Alex Gaynor <alex.gaynor@gmail.com>
2020-07-05 22:29:32 -04:00
Paul Kehrer
7a233b9a60
support 4096 bit DSA parsing from numbers classes (#5301)
* support 4096 bit DSA parsing from numbers classes

* need to get local linting fixed.

* reorder

* add a link to more reasons why DSA sucks
2020-07-05 21:19:39 -04:00
Paul Kehrer
c868961033
add unstructured name x509 csr attribute vector (#5302)
* add unstructured name x509 csr attribute vector

* Update docs/development/test-vectors.rst

Co-authored-by: Alex Gaynor <alex.gaynor@gmail.com>

Co-authored-by: Alex Gaynor <alex.gaynor@gmail.com>
2020-07-05 21:06:39 -04:00
Paul Kehrer
bd48e0f693
invalid challenge value csr (#5300) 2020-07-05 16:55:24 -04:00
Alex Gaynor
7d915fa4f9
Enforce that X.509 versions on valid on parse. (#5299)
Closes #5290
2020-07-05 14:51:59 -05:00
Paul Kehrer
210dc86628
Support parsing SCTs in OCSPResponse (#5298)
* Support parsing SCTs in OCSPResponse

* s/typically/only and pep8

* remove unused vector

Co-authored-by: Szilárd Pfeiffer <szilard.pfeiffer@balasys.hu>
2020-07-05 11:01:07 -04:00
Marko Kreen
8fa84f50f6
Reorganize KDF docs (#5297)
* Add variable/fixed cost section
* Add subtitle to each algorithm
* Reorder alphabetically
2020-07-05 09:33:56 -05:00
Alex Gaynor
5d0c8e0b5f
Run tests on centos8 (#5051)
* Run tests on centos8

* Document that we test this

* debugging

* Try adding this?

* Remove this
2020-07-04 18:17:35 -05:00
Paul Kehrer
13fae162da
add SubjectInformationAccess extension support (#5295)
* add SubjectInformationAccess extension support

* fixes
2020-07-02 01:13:33 -04:00
Paul Kehrer
63d337e5cc
constrain RSA key generation more heavily (#5288)
* constrain RSA key generation more heavily

* constraint to just 3 & 65537

* explain change
2020-06-28 00:18:00 -04:00
Alex Gaynor
907ec96ee8
Disable parallel docs builds to fix spellcheck (#5287) 2020-06-26 09:01:52 -05:00
Alex Gaynor
51fe7e659c
Bumped the minimum macOS version to 10.10 (#5286) 2020-06-25 19:59:15 -05:00
Alex Gaynor
b249ef30b3
Added a changelog entry for the new fernet methods (#5285) 2020-06-25 19:13:02 -05:00
Jakub Stasiak
9719375294
Disallow ttl=None in (Multi)Fernet.decrypt_at_time() (#5280)
* Disallow ttl=None in (Multi)Fernet.decrypt_at_time()

Since the introduction of the _at_time() methods in #5256[1] there's
been this little voice in the back of my mind telling me that maybe it's
not the best idea to allow ttl=None in decrypt_at_time(). It's been like
this for convenience and code reuse reasons.

Then I submitted a patch for cryptography stubs in typeshed[2] and I had
to decide whether to define decrypt_at_time()'s ttl as int and be
incompatible with cryptography's behavior or Optional[int] and advertise
an API that can be misused much too easily. I went ahead with int.

Considering the above I decided to propose this patch. Some amount of
redundancy (and a new test to properly cover the
MultiFernet.decrypt_at_time() implementation) is a price to prevent
clients from shooting themselves in the foot with the tll=None gun since
setting ttl to None disabled timestamp checks even if current_time was
provided.

[1] https://github.com/pyca/cryptography/pull/5256
[2] https://github.com/python/typeshed/pull/4238

* Actually test the return value here

* Fix formatting
2020-06-24 21:51:54 -04:00
David Benjamin
3f4944d4e5
Fix up crl_delta_crl_indicator.pem. (#5283)
The CRL is missing a CRL number and should mark the delta CRL extension
as critical. RFC 5280 says the following:

Section 5.2.3:

> CRL issuers conforming to this profile MUST include this extension
> [CRL number] in all CRLs and MUST mark this extension as
> non-critical.

Section 5.2.4:

> The delta CRL indicator is a critical CRL extension that identifies a
> CRL as being a delta CRL.

> When a conforming CRL issuer generates a delta CRL, the delta CRL
> MUST include a critical delta CRL indicator extension.

Sadly, RFC 5280 is often unclear about the difference between issuer
requirements and verifier requirements, but test certificates should
conform to issuer requirements where possible, in case the underly
library becomes stricter. Section 5.2.4 includes further text which
implies a delta CRL without a CRL number is unusable for a verifier
anyway:

> A complete CRL and a delta CRL MAY be combined if the following four
> conditions are satisfied:
>
> [...]
>
>   (d)  The CRL number of the complete CRL is less than the CRL number
>        of the delta CRL.  That is, the delta CRL follows the complete
>        CRL in the numbering sequence.

Note I have not updated the signature in crl_delta_crl_indicator.pem.
The test does not care, and it is unclear which key to sign it with.
2020-06-24 21:50:49 -04: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
Alex Gaynor
f0bc6620d9
Fix for linkcheck (#5281)
* Fix for linkcheck

* attempted linkcheck fix
2020-06-20 17:39:22 -05:00
Marko Kreen
0b03617084
Unify X.509 signature algorithm validation (#5276)
- Use common implementation
- OCSP signing was using different validation
- Check if private key is usable for signing
2020-06-14 16:12:06 -05:00