Commit graph

2485 commits

Author SHA1 Message Date
Alex Gaynor
f09c261ca1
41.0.6 release (#9927)
* Fixed crash when loading a PKCS#7 bundle with no certificates (#9926)

* Version bump for 41.0.6

* Temporarily allow a new clippy warning (#9835)

* Temporarily allow a new clippy warning

* Update lib.rs

* Update lib.rs

* Need to accept this to skip test

* It's a word
2023-11-27 13:35:35 -06:00
Paul Kehrer
e190ef1905
Backport ssh cert fix (#9211)
* Fix encoding of SSH certs with critical options (#9208)

* Add tests for issue #9207

* Fix encoding of SSH certs with critical options

* Test unexpected additional values for crit opts/exts

* temporarily allow invalid ssh cert encoding

---------

Co-authored-by: jeanluc <2163936+lkubb@users.noreply.github.com>
2023-07-11 00:46:49 +00:00
Paul Kehrer
b99900596e
Backport tolerate (#9006)
* tolerate NULL params in ECDSA SHA2 AlgorithmIdentifier (#9002)

* tolerate NULL params in ECDSA SHA2 AlgorithmIdentifier

Java 11 does this incorrectly. It was fixed in Java16+ and they are
planning to do a backport, but we'll need to tolerate this invalid
encoding for a while.

* test both inner and outer

* changelog entry

* language
2023-06-01 12:02:55 +00:00
Paul Kehrer
31436a4866
admit to the existence of nuance in HKDF (#8987)
* admit to the existence of nuance in HKDF

* Update docs/hazmat/primitives/key-derivation-functions.rst

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

---------

Co-authored-by: Alex Gaynor <alex.gaynor@gmail.com>
2023-05-30 02:32:57 +00:00
Paul Kehrer
93c96b777a
allow null params in AlgorithmIdentifiers with SHA hash function OIDs (#8974)
RFC 4055 section 2.1 states "All implementations MUST accept both
NULL and absent parameters as legal and equivalent encodings".

It also makes some somewhat conflicting statements after that, but
LibreSSL omits the null params for PSS, and OpenSSL parses this
without issue so tolerance it is.
2023-05-27 10:07:20 -04:00
Alex Gaynor
5b7dd82561
Fix gitlab URLs for linkcheck (#8938) 2023-05-17 00:39:18 +00:00
Alex Gaynor
cff3c8fee7
There are wheels for basically all linux distros now (#8923) 2023-05-15 04:36:57 +08:00
Alex Gaynor
cc4555394d
Remove linkcheck skip (#8915)
It now has a trusted issuer
2023-05-13 03:38:54 +08:00
Paul Kehrer
1ef3cdb616
support X.509 certificate PSS signing (#8888)
* support X.509 certificate PSS signing

no CSR, CRL, etc

* handle PSS.(MAX_LENGTH, DIGEST_LENGTH), review feedback

* name the kwarg

* test improvements

* skip if sha3 isn't supported
2023-05-10 21:09:56 -04:00
Paul Kehrer
cfee3c85a7
add RSA PSS SHA1 hash algorithm + SHA1 MGF1 test vector (#8906) 2023-05-11 00:29:39 +00:00
Paul Kehrer
b436fafa7c
add signature_algorithm_parameters to certificate (#8795)
this allows easier verification of cert signatures, but more
specifically allows PSS signature verification
2023-05-07 20:26:45 +00:00
Paul Kehrer
0f2b72bb12
invalid visible string support (#8884)
* invalid visible string support

this allows utf8 in visiblestring, which is not valid DER. we raise a
warning when this happens, but allow it since belgian eIDs, among
others, have encoding errors. Belgium fixed this by 2021 (and possibly
earlier), but their eID certificates have 10 year validity.

* review comments

* clippy
2023-05-07 16:01:33 +00:00
Harmin Parra Rueda
bbea31b68d
Fix for #8854 (#8855)
* Fix for #8854

Fix for issue #8854

* Fix for issue #8854

Fix for issue #8854

* versionadded

---------

Co-authored-by: Paul Kehrer <paul.l.kehrer@gmail.com>
2023-05-03 17:34:54 -04:00
Alex Gaynor
f0f9c9cf6f
Switch the vectors pacakge to use modern pyproject.toml (#8853) 2023-05-02 09:09:19 -05:00
Alex Gaynor
9d06775cb1
Automate the version bump (#8828) 2023-04-26 08:21:39 -05:00
Alex Gaynor
eb995fed64
modernize intersphinx_mapping configuration (#8806) 2023-04-24 13:23:15 +00:00
Paul Kehrer
9425d2376b
add one more RSA PSS invalid test vector (#8798) 2023-04-23 20:22:50 +00:00
Paul Kehrer
5f3871e4df
add two RSA PSS certificate vectors that have invalid encodings (#8797)
* add two RSA PSS certificate vectors that have invalid encodings

The signatures on these vectors are not valid.

* spelling
2023-04-23 19:51:35 +00:00
Paul Kehrer
49dee344a1
update MAC docs (#8777)
* Update hmac.rst

* Update poly1305.rst
2023-04-21 16:04:45 -06:00
Alex Gaynor
34edbb2e17
Update FAQ (#8773)
Add a Q on the scope of our issue tracker, and remove a legacy Q.
2023-04-21 11:16:35 -06:00
Paul Kehrer
45bddbfb19
add support for aes256-gcm@openssh.com decryption for SSH keys (#8738)
* add support for aes256-gcm@openssh.com decryption for SSH keys

* review feedback

* skip when bcrypt isn't present
2023-04-15 04:05:11 +00:00
Paul Kehrer
253a97a34b
update docs for rust versions in debian and rhel (#8702) 2023-04-10 12:34:46 +00:00
Alex Gaynor
f8e929a225
Fix alpine installation docs (#8701) 2023-04-10 12:28:50 +00:00
Paul Kehrer
7d3f8a43d4
we made WithSerialization an alias to the main types long ago (#8698)
stop documenting them entirely
2023-04-10 00:13:55 -04:00
Paul Kehrer
40c16dc180
OCSP responses are responses, not certificates (#8696) 2023-04-10 03:32:50 +00:00
Paul Kehrer
f724c9b2fd
Support msCertificateTemplate extension (#8695)
* support ms certificate template

* contortions for rust coverage

* review feedback
2023-04-10 03:10:41 +00:00
Paul Kehrer
5fef27733c
update docs for macOS dev with rust openssl (#8653) 2023-04-02 09:01:31 -04:00
Alex Gaynor
1e49cb9c13
Switch from tox to nox (#8651) 2023-04-02 16:28:22 +09:00
Alex Gaynor
89228a9deb
Added support for OCSP AcceptableResponses extension (#8617)
fixes #8589
2023-03-27 00:51:04 +00:00
Alex Gaynor
e030da4b54
fix copyright years (#8595)
* fix copyright year in docs

* update copyright year
2023-03-25 04:50:08 +08:00
Paul Kehrer
0794b0e31a
update MSRV 1.48.0 -> 1.56.0 (#8587)
* update MSRV 1.48.0 -> 1.56.0

* bump some deps for MSRV
2023-03-24 13:36:14 +00:00
Paul Kehrer
b5170bf26d
drop python 3.6 support (#8448)
* drop python 3.6 support

* Update tests/hazmat/bindings/test_openssl.py

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

---------

Co-authored-by: Alex Gaynor <alex.gaynor@gmail.com>
2023-03-24 13:15:13 +00:00
Paul Kehrer
5e6476a4c6
drop support for openssl < 1.1.1d (#8449)
This removes the OS random engine, which contained the only CPython PSF
licensed code in the repository. Accordingly, that license has now been
removed.
2023-03-24 08:36:58 -04:00
Paul Kehrer
2daf74aabf
update docs about testing, switch to 3.1.0 across more of our CI (#8558) 2023-03-21 07:29:52 -04:00
Alex Gaynor
f371af837a
Added support for handling python buffers in Rust code (#8556)
This is extra mega cursed, and strictly speaking unsound. It does, however, match the status quo ante, where someone mutating a buffer while its being used in cffi code will basically always be UB.
2023-03-21 08:16:53 +08:00
Alex Gaynor
6c39999b40
Ressurect the PoC of OpenSSL from Rust (#7164) 2023-03-15 13:06:16 +08:00
shane-kearns
d85db128fb
Fix sample code for policy extension (#8489) 2023-03-10 07:16:13 -05:00
Alex Gaynor
f84327556a
remove out of date details in random numbers docs (#8482) 2023-03-10 05:19:39 +08:00
Alexandre Duc
7ae97f8988
On Windows, os.urandom doesn't use CryptGenRandom anymore (deprecated) (#8481)
but BCryptGenRandom()
2023-03-09 12:24:55 -05:00
Marti Raudsepp
79e38a379e
Make Union type aliases a documented public API (#8168)
* Rename Union type aliases to CamelCase

Many `typing.Union` type aliases were previously using `UPPER_SNAKE_CASE`, but Python's convention is `CamelCase` for these (e.g. https://docs.python.org/3/library/typing.html#type-aliases)

* Add utils.deprecated for the old non-underscore type aliases

* Added documentation for new type aliases & minor tweaks

* Use 'versionadded:: 40.0.0'

* Fix CertificatePublicKeyTypes vs CertificateIssuerPublicKeyTypes. Rename CertificatePrivateKeyTypes to CertificateIssuerPrivateKeyTypes

* Fix imports (ruff)

* Fix one more versionadded

* Tweak docs & Reorder: CertificateIssuerPublicKeyTypes before CertificateIssuerPrivateKeyTypes

* Fix test mypy errors using cast()

* Fix black, oops

* Revert "Fix black, oops"

This reverts commit 85344e231d697bdc0940e105f7aed729445f9743.

* Revert "Fix test mypy errors using cast()"

This reverts commit b272d8ca95fbbbc62060663f9e8930a139a7a43e.

* Revert type of SubjectKeyIdentifier.from_public_key arg

* Changelog tweak
2023-03-07 19:20:32 +08:00
Marty Hill
a28ad12125
Update serialization.rst (#8464)
Proposed update to parameter in example call to pkcs12.serialize_key_and_certificates() on line 908.
2023-03-06 08:26:20 -05:00
Alex Gaynor
c4ff4f92ef
ignore ntt in linkcheck (#8423) 2023-03-02 23:02:58 +00:00
Alex Gaynor
d05a8ac6cd
Update to the new wycheproof (#8403) 2023-02-28 05:07:54 +00:00
Paul Kehrer
1937b4bb33
improve the custom build script slightly (#8392)
this will make it more robust to some upcoming pip changes
2023-02-26 22:27:48 +00:00
Alex Gaynor
94debb12c6
fixes #8374 -- removed docs for removed method (#8377)
* fixes #8374 -- removed docs for removed method

* Update CHANGELOG.rst
2023-02-22 08:08:33 -06:00
David Buchanan
db6905d69c
Add shortcut methods for exporting EC keys as raw bytes (#8357)
* WIP: Add raw export alias method for x25519 keys

* Ditto for x448, ed448, ed25519

* Document new private_bytes_raw public_bytes_raw methods

* docs: Populate versionadded to be 40

* docs: Fix PublicFormat -> PrivateFormat where applicable

* formatting

* Update tests for test_pub_priv_bytes_raw in x25519, x448, ed448 (TODO: ed25519)

* Add test_pub_priv_bytes_raw test for Ed25519
2023-02-22 08:09:34 -05:00
Jake
50fec7e541
Fix SSHCertificateBuilder sample code (#8373)
Update SSHCertificateBuilder sample code to:
* Correctly use the signing key when signing the certificate, rather than the user's own private key.
* Generate the user's public key in one line, making it clearer to the reader that only the public key is an input to the certificate builder.
2023-02-22 07:03:26 -05:00
Paul Kehrer
5a34d492bc
embrace my inner nitpicker (#8361)
fixes all our versionadded/changed to match actual versions we released
2023-02-20 23:57:08 +00:00
Paul Kehrer
49965cc078
use the modern invocation for our sphinx rtd theme (#8243)
* use the modern invocation for our sphinx rtd theme

* works with sphinx6?
2023-02-08 14:19:35 +00:00
Alex Gaynor
64a5498901
document that inheritance is not the way (#8204)
resolves #8186
2023-02-03 07:21:32 -08:00