| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* tests: better testid generation for fernet vectors
Use the vector filename and array index for the pytest id rather than a
concatenation of the vector content.
eg: `tests/test_fernet.py::TestFernet::test_invalid[invalid.json:2]`
* (Multi)Fernet: allow str tokens for decryption
Remove some developer friction by allowing string tokens to be passed to
Fernet decryption methods. Because a valid token as generated by
`Fernet.encrypt()` is url-safe base64-encoded, a non-ASCII token is
definitely invalid.
The stdlib base64 function already accepts and checks ASCII str values
so delegate to that.
* Kick CI
|
|
|
|
|
|
|
|
| |
In OpenSSL 3.0.x the PEM_read_bio_PUBKEY function will invoke
the default password callback if you pass an encrypted private
key. This is very, very, very bad as the default callback can
trigger an interactive console prompt, which will hang the
Python process. We therefore provide our own callback to
catch this and error out properly.
|
|
|
| |
This commit adds back a return type for default_backend, so mypy would consider this function typed.
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
* RSA PSS openssl constant
* load PSS keys (OpenSSL only) but strip the constraints
* empty commit for CI, sigh
* review feedback
* nit
|
| |
|
|
|
| |
fixes #7104
|
|
|
|
|
| |
* fixes #7081 -- correctly handle escape sequences in RFC4514 strings
* Fix multi-digit OID arc parsing
|
|
|
|
|
|
|
| |
* add PSS auto support for verification
* add support for PSS.DIGEST_LENGTH
* review comments
|
|
|
|
|
|
|
|
|
| |
* 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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* 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
|
|
|
| |
fixes #6973
|
|
|
|
|
| |
* serialize certs to pkcs7
* missed assert
|
| |
|
|
|
|
|
|
|
|
|
| |
* TLSv1.3 PSKs function bindings
* add PSK related functions to be conditional
* add Cryptography_SSL_SESSION_new to avoid namespace collision
Co-authored-by: d00624431 <dongpu1@huawei.com>
|
|
|
|
|
| |
* SIV support
* empty commit to see if codecov sees the 3.0 coverage this time
|
|
|
| |
use f strings (why not) and internally use lists for processing AD
|
| |
|
|
|
|
|
|
| |
it was previously enforced by cffi since the underlying CipherUpdate
calls use a 32-bit signed integer. We added our own checks in #4322
so that we could test it without using crazy amounts of RAM, but
set the wrong limits. Whoops.
|
|
|
| |
to infinity, and beyond!
|
|
|
|
|
|
|
|
|
| |
* 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>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* 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.
|
|
|
| |
I'm reasonably certain it's not required in recent OpenSSL's
|
|
|
|
| |
(#6983)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* Dedicated check for signature hash algorithms
Move the check for FIPS mode and blocked SHA1 signature algorithm
into the backend code. Some distros will block SHA1 for RSA signatures
in the near future. The new ``signature_hash_supported()`` method will
allow us to flip the switch in one place.
Note: The ban of SHA1 signatures does not affect MGF1's inner hash algorithm.
Signed-off-by: Christian Heimes <christian@python.org>
* Address flake issues
* Update src/cryptography/hazmat/backends/openssl/backend.py
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
* 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>
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* Disable DSA tests in FIPS mode
See: #6880
* ignore coverage for nested FIPS check
* Remove if branch
* Remove skip modulus branch
* Keep tests that don't use the backend
|
|
|
|
|
| |
* refactor utils.deprecated to be more mypy friendly
* Poke for CI
|
| |
|
|
|
|
|
| |
* dont block pk12 serialization of ed pairs
* mimic test_ec curve skipping to satisfy alpine ci
|
|
|
| |
At some point it gained a default that was the same as what we were implementing.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* Block TripleDES in FIPS mode
NIST SP-800-131A rev 2 lists TripleDES Encryption as disallowed in FIPS 140-3
decryption as legacy use. Three-key TDEA is listed as deprecated
throughout 2023 and disallowed after 2023.
For simplicity we block all use of TripleDES in FIPS mode.
Fixes: #6875
Signed-off-by: Christian Heimes <christian@python.org>
* Fix flake
|
| |
|
| |
|
|
|
| |
As someone who first with Python in 2.4 or so, this habit is going to be hard to break.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
(#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.
|
|
|
|
|
| |
* type a context manager and its helper
* untype this since it also takes a cffi object
|
|
|
|
|
|
|
|
|
|
|
| |
* more pointless typing to improve metrics
* Apply suggestions from code review
Co-authored-by: Alex Gaynor <alex.gaynor@gmail.com>
* black
Co-authored-by: Alex Gaynor <alex.gaynor@gmail.com>
|
| |
|