Commit graph

2353 commits

Author SHA1 Message Date
Paul Kehrer
19546b9ccc
Add support for PSS.AUTO and PSS.DIGEST_LENGTH (#7082)
* add PSS auto support for verification

* add support for PSS.DIGEST_LENGTH

* review comments
2022-04-16 15:16:25 +00:00
Paul Kehrer
0724c5f1ee
check for invalid keys that RSA_check_key misses (#7080)
* check for invalid keys that RSA_check_key misses

RSA_check_key checks for primality but that fails to catch this case
since 2 is prime. Instead we fetch p and q and verify that they are odd
and if not reject the key as invalid.

* circleci sucks
2022-04-16 13:55:01 +00:00
Alex Gaynor
f3f695b1c1
Implement a parser for RFC4514 strings (#7055)
* Initial tests

* Implement.

Required updating many many tests based on my read of the RFC. Should be reviewed closely.

* Fix for py36

* flake8

* Improve coverage on hypothesis test

* Remove bad assertion in hypothesis test

* Update docs

* fix docs

* Fixed unicode support

* review

* docs review
2022-04-16 10:21:45 +02:00
Alex Gaynor
dc989d563a
Added Ubuntu Jammy to CI (#7047)
* Added Ubuntu Jammy to CI

* try thing
2022-04-07 02:15:09 -05:00
Dustin Ingram
033514708e
Fix indentation in docs/x509/reference.rst (#7044) 2022-04-05 21:11:10 +00:00
Paul Kehrer
7659fe4fd6
serialize certs to pkcs7 (#7034)
* serialize certs to pkcs7

* missed assert
2022-04-04 02:14:14 +00:00
Paul Kehrer
00c61b9537
update pkcs7 test vectors (#7030)
* update pkcs7 test vectors

* this is a word
2022-04-03 09:11:54 -04:00
Paul Kehrer
74e4202bd1
SIV support (#7029)
* SIV support

* empty commit to see if codecov sees the 3.0 coverage this time
2022-04-02 23:44:01 -04:00
Paul Kehrer
25cdad7d07
support 12-15 byte nonce sizes in OCB3 (#7011)
* support 12-15 byte nonce sizes in OCB3

* Update tests/hazmat/primitives/test_aead.py

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

Co-authored-by: Alex Gaynor <alex.gaynor@gmail.com>
2022-03-29 12:00:28 +00:00
Paul Kehrer
4a4f4d94ce
OCB3 test vectors for 104, 112, and 120-bit nonces (#7009) 2022-03-29 07:09:07 -04:00
ajoino
9d357cffb7
Serialize PKCS12 CA alias/friendlyName (#6910)
* PKCS12 serialization wrapper supports PKCS12Certificate cas

* Added code from Felix's gist to serialize_key_and_certificate_to_pkcs12. Doesn't break current behaviour/tests, need to write validate new behaviour, write tests, and format code.

* Simplified instance check

* Tried to write tests, but I cannot figure out how to read the friendlyName from parsed_more_certs.

* Fixed test function and renamed it.

* Fixed formatting.

* Commiting before trying black

* Formatted updates to make flake8 and black happy.

* Fixed first review comments.

* remove forgotten print statement

* use backend.openssl_assert instead of if ...

* Documented changes.

* Updated documentation.
2022-03-29 07:03:09 -04:00
Alex Gaynor
3714686044
Don't reference unsupported version in installation docs (#6946) 2022-03-13 05:21:45 +08:00
sanchayanghosh
9790f943df
Added OID for #6920 (#6925)
* Added OID

* Added to docuemntation for IPSec SAs

* Update docs/x509/reference.rst to correct the version change.

Co-authored-by: Paul Kehrer <paul.l.kehrer@gmail.com>

Co-authored-by: Paul Kehrer <paul.l.kehrer@gmail.com>
2022-03-03 07:11:46 +00:00
whiteowl3
fa75d77410
allow ed pk12, better tests (#6865)
* dont block pk12 serialization of ed pairs

* mimic test_ec curve skipping to satisfy alpine ci
2022-02-27 07:15:49 +08:00
Alex Gaynor
06e57ce62d
refs #6835 -- added oid constants for SHA3 signatures (#6850) 2022-02-07 16:38:07 -10:00
Alex Gaynor
3e0870468c
Test against Alpine on aarch64 (#6846)
* Test against Alpine on aarch64

* Update config.yml

* Update installation.rst

* Update config.yml
2022-02-06 22:32:16 -06:00
Alex Gaynor
7513197fc6
fixes #6804 -- improve error message quality with invalid characters in name attributes (#6843) 2022-02-06 21:42:56 -06:00
Alex Gaynor
05fa9c9833
Switch from centos to rhel in CI (#6844)
* Switch from centos to rhel in CI

* Update installation.rst

* Update installation.rst
2022-02-06 17:51:12 +00:00
Alex Gaynor
c9ac2c86d7
Remove FAQ that's no longer relevant (#6833)
We don't use environment markers anymore, now if you have a really old setuptools you get some different failure mode
2022-01-30 20:22:59 -08:00
Alex Gaynor
8114b3e61d
point to the AEAD version of GCM in the FAQ (#6832) 2022-01-31 01:55:42 +00:00
Alex Gaynor
02783d2297
Remove explicit subclassing of object now that all classes are new-style (#6830)
As someone who first with Python in 2.4 or so, this habit is going to be hard to break.
2022-01-30 16:29:24 +00:00
Alex Gaynor
335525a70d
Clean up the language in the docs now that 3.6 is the minimum we support (#6825) 2022-01-29 07:15:11 -08:00
April King
5ac3fdc46c
Found another place where ancient PBKDF2 iterations were listed (#6816) 2022-01-24 22:44:10 +00:00
Alex Gaynor
bab6faa262
Document M1 CI (#6799)
* Document M1 CI

* its a word
2022-01-07 00:22:06 +00:00
turettn
12497762be
Basic support for multiple SINGLERESP messages in one OCSP response, take 2 (#6410)
* OCSP responses can contain multiple SINGLERESPs

Instead of throwing an exception when encountering a OCSP
response with multiple SINGLERESPs, throw the exception when
attempting to pull a single structure if multiple are present.

Add a response_iter property to the OCSP Response object, which
allows for iteration through all the SINGLERESPs, and properties
to be individually accessed for each.

* Small fixes to OCSP multiple response handling.  Squash eventually

* Docs updates.  Should be squashed

* Get rid of mutating iterator, replace with separate return object

* Fix versionadded strings in docs

* Cleanup docs & python bindings.
2022-01-03 18:33:15 -05:00
Paul Kehrer
75be92de8e
support parsing bitstring values in DNs (#6629)
* support bitstring values in DNs

parsing is limited to x500UniqueIdentifier only

* Update src/cryptography/x509/name.py

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

Co-authored-by: Alex Gaynor <alex.gaynor@gmail.com>
2021-11-28 23:47:44 +00:00
Alex Gaynor
bd7e6ad653
closes #6663 -- deprecate openssl 1.1.0 support (#6667) 2021-11-28 12:12:47 +08:00
Natalia Maximo
e91d3047e9
fix: fixed confusing typo on DSA docs (#6662) 2021-11-27 00:15:38 +00:00
Paul Kehrer
5bd0c10d50
allow parsing of nonstandard country name and jurisdiction country name (#6641)
The spec requires both of these to be exactly two characters to
correspond with ISO country codes. Reality is sometimes messier, so this
allows parsing (but not encoding) of this invalid data. Parsing will
raise a UserWarning if incorrect lengths are detected.
2021-11-21 03:16:43 +00:00
April King
a9fa8015ae
Update fernet docs to use latest Django recommendations (#6611)
* Update fernet docs to use latest Django recommendations

* Err, remember how RST works
2021-11-16 03:44:52 +00:00
Paul Kehrer
78c2dd8a04
add AES SIV vectors (#6608) 2021-11-15 07:19:44 -05:00
Paul Kehrer
ffb40e6228
OCB3 support (#6607)
* OCB3 support in aead package

* improve comment
2021-11-14 23:10:06 -05:00
Paul Kehrer
c451c1df4e
add AES OCB3 test vectors (#6606) 2021-11-15 01:50:13 +00:00
Paul Kehrer
b9b95952f5
support attributes on csrs with an iterable (#6603) 2021-11-14 06:20:11 -05:00
Alex Gaynor
4da2a68118
Allow parsing CSR extensions with the critical bit having an explicitly encoded default (#6600)
* Allow parsing CSR extensions with the critical bit having an explicitly encoded default

* Poke for zuul
2021-11-14 05:42:10 +08:00
Alex Gaynor
afaf184674
Mention LibreSSL and BoringSSL in our installation docs (#6597) 2021-11-13 05:07:00 +08:00
Paul Kehrer
d3e23411a2
boring changelog (#6595) 2021-11-12 08:37:09 -05:00
Felix Fontein
19da50e93d
Allow to serialize extension values as DER bytes strings (#6346)
* Allow to serialize extension values as DER bytes string.

* Prepare test for SignedCertificateTimestamps.
2021-11-12 14:02:17 +08:00
Paul Kehrer
6f03deed83
allow x25519/x448 public keys in certificatebuilder (#6562)
also document that we can return these key types in a certificate,
although they can't be self-signed of course
2021-11-07 17:21:02 -05:00
Paul Kehrer
bb05d4b5e6
allow multiple identical pem blocks (#6551)
this matches our behavior to OpenSSL and allows users to pass a chain to
our PEM loaders. To make this a little less magical it is now
documented.
2021-11-05 07:07:36 -04:00
Paul Kehrer
7a2823bdff
deprecate backend part 6 of n (#6524) 2021-11-03 18:51:23 -04:00
Paul Kehrer
b6e898657e
some installation doc improvements (#6525) 2021-11-03 07:25:11 -04:00
Paul Kehrer
1eccc52b63
deprecate backend part 5 of n (#6523)
* deprecate backend part 5 of n

* remove doc8
2021-11-03 07:22:58 -04:00
Paul Kehrer
e333fa3279
deprecate backend part 4 of n (#6522) 2021-11-02 17:49:25 -04:00
Paul Kehrer
1040b39be5
deprecate backend part 3 of n (#6521)
finish the asymmetric docs
2021-11-02 17:48:18 -04:00
Paul Kehrer
dcf82c6c00
deprecate backend part 2 of n (#6518) 2021-11-02 12:14:45 +00:00
Paul Kehrer
ae1e4a4bc4
deprecate backend part 1 of n (#6517)
* update all custom vector generation scripts to not use backends
* remove references to backends in test-vectors.rst
2021-11-02 07:05:24 -04:00
Marti Raudsepp
0ac3e5037d
Allow custom attribute shortnames in rfc4514_string (#6490)
`rfc4514_string()` and related methods now have an optional
`attr_name_overrides` parameter to supply custom OID to name mappings,
which can be used to match vendor-specific extensions.

**BACKWARDS INCOMPATIBLE:** Reverted the nonstandard formatting of email
address fields as `E` in `rfc4514_string()` methods from version 35.0.

The previous behavior can be restored with:
`name.rfc4514_string({NameOID.EMAIL_ADDRESS: "E"})`

Expanded documentation of `Name.rfc4514_string`.
2021-11-01 08:41:00 +08:00
Paul Kehrer
f4871a218d
add accvraiz1 bmpstring test vector (#6503) 2021-10-31 07:46:48 -04:00
Alex Gaynor
9275fd07e3
Convert CRL creation to Rust (#6496)
* Convert CRL creation to Rust

* fixes

* small reflows

* Delete all teh code

* flake8
2021-10-31 05:40:28 +08:00