summaryrefslogtreecommitdiff
path: root/src/cryptography/utils.py
Commit message (Collapse)AuthorAgeFilesLines
* invalid visible string support (#8884)Paul Kehrer2023-05-071-0/+1
| | | | | | | | | | | | * 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
* Use from __future__ import annotations everywhere (#8643)Alex Gaynor2023-03-311-0/+1
|
* Make CffiBuf implementation sounder (#8612)Alex Gaynor2023-03-261-2/+2
| | | This keeps the buffer object alive, in addition to the original object. Some buffer-implementors have different behavior based on whether there's a buffer object alive.
* Fix handling very large pointer values (32-bit) (#8602)Alex Gaynor2023-03-251-1/+1
|
* remove unused warning constant (#8594)Alex Gaynor2023-03-251-1/+0
|
* Added support for handling python buffers in Rust code (#8556)Alex Gaynor2023-03-211-0/+7
| | | 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.
* remove verify_interface (#8260)Paul Kehrer2023-02-101-11/+0
| | | | | * remove verify_interface * ruff ruff
* Use the ruff 'pyupgrade' checks (#8104)Alex Gaynor2023-01-201-3/+3
|
* deprecate support for DSA in load_ssh_public_key (#8009)Paul Kehrer2023-01-081-0/+1
| | | | | * deprecate support for DSA in load_ssh_public_key * try to prevent bad things a bit more
* mark verify_interface with a deprecation comment (#7649)Paul Kehrer2022-09-251-0/+3
| | | this will help us revisit it in the future
* Make verify_interface a no-op (#7648)Alex Gaynor2022-09-251-29/+3
| | | This should be sufficient to keep aws-encryption-sdk working, but let's us delete the code.
* Remove pyOpenSSL fallback. (#7590)Alex Gaynor2022-09-111-1/+0
| | | We already require pyOpenSSL>=22.0, but pyOpenSSL has not required this fallback since 21.0.
* Remove deprecated support for x.509 signing with SHA1 and MD5 (#7573)Alex Gaynor2022-09-071-1/+0
|
* fixes #7179 -- remove deprecated from_encoded_point (#7572)Alex Gaynor2022-09-071-1/+0
|
* Deprecate support for MD5 and SHA1 signatures in X.509 (#7283)Alex Gaynor2022-05-281-0/+1
|
* Remove register_interface, which was basically unused (#7234)Alex Gaynor2022-05-271-23/+0
| | | | | * Remove register_interface, which was basically unused * Remove now unused verify_interface
* refactor utils.deprecated to be more mypy friendly (#6923)Alex Gaynor2022-03-031-2/+7
| | | | | * refactor utils.deprecated to be more mypy friendly * Poke for CI
* Remove explicit subclassing of object now that all classes are new-style (#6830)Alex Gaynor2022-01-301-1/+1
| | | As someone who first with Python in 2.4 or so, this habit is going to be hard to break.
* more pointless typing to improve metrics (#6780)Paul Kehrer2022-01-031-13/+20
| | | | | | | | | | | * 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>
* add some more mypy flags (#6751)Paul Kehrer2021-12-231-3/+1
| | | | remove some unneeded type ignores. This work found a missing type and added it as well.
* remove signer/verifier as they've been deprecated for 4.25 years (#6639)Paul Kehrer2021-12-031-1/+0
| | | | | * remove signer/verifier as they've been deprecated for 4.25 years * fix coverage
* Remove read_only_property and precisely type all these getters (#6668)Alex Gaynor2021-11-291-4/+0
| | | | | | | * Remove read_only_property and precisely type all these getters * flake8 * unused
* closes #6663 -- deprecate openssl 1.1.0 support (#6667)Alex Gaynor2021-11-281-0/+1
|
* Finally remove deprecated int_from_bytes (#6652)Alex Gaynor2021-11-251-9/+0
|
* support attributes on csrs with an iterable (#6603)Paul Kehrer2021-11-141-0/+1
|
* _ModuleWithDeprecations should inherit from types.ModuleType (#6267) (#6268)Sándor Jenei2021-09-131-1/+3
| | | | | | | | | | | | | * _ModuleWithDeprecations should inherit from types.ModuleType (#6267) Update utils.py * fix typos reported by black * flake8 fix * Test should fail when int_from_bytes will be removed. Because this test would become pointless then.
* parse certificates with pure rust (#6147)Paul Kehrer2021-07-251-0/+1
| | | | | | | | | | | * parse certificates with pure rust * fix coverage * various review comments * save the buffer * more feedback
* type annotate cryptography.utils:register_interface (#6123)Thomas Grainger2021-06-171-2/+16
|
* Use well-defined enum representation (#6042)Christian Heimes2021-05-121-0/+11
| | | | | | | | | Python 3.10 changed enum's object and string representation. PyCA cryptography now uses a custom subclass of enum.Enum() will well-defined __repr__ and __str__ from Python 3.9. Related: https://bugs.python.org/issue40066 Fixes: https://github.com/pyca/cryptography/issues/5995 Signed-off-by: Christian Heimes <cheimes@redhat.com>
* more typing (#5887)Paul Kehrer2021-03-021-2/+2
| | | | | | | | | | | * backend typing for twofactor package and more otp work * even more typing * style fixes * no generic typing for _get_backend * remove unneeded typing
* Delete unused register_interface_if (#5883)Alex Gaynor2021-03-011-10/+0
|
* Interface: Make annotation check optional (#5775)Christian Heimes2021-02-081-6/+19
| | | | | | | | | | | | | * Interface: Make annotation check optional Fixes: https://github.com/pyca/cryptography/issues/5774 Signed-off-by: Christian Heimes <cheimes@redhat.com> * Use param.replace() Co-authored-by: Stanislav Levin <slev@altlinux.org> Signed-off-by: Christian Heimes <cheimes@redhat.com> Co-authored-by: Stanislav Levin <slev@altlinux.org>
* Added typing for a bunch of methods (#5737)Alex Gaynor2021-02-011-1/+1
|
* type updates from turning on unchecked-defs on tests (#5720)Paul Kehrer2021-01-311-1/+3
| | | test changes themselves will be in a separate PR
* Apply type annotations to x509 builders (#5709)Alex Gaynor2021-01-291-4/+5
|
* Remove utils.int_from_bytes (#5609)Alex Gaynor2020-12-091-3/+9
|
* Remove __future__ import from our code (#5610)Alex Gaynor2020-12-091-1/+0
|
* Remove Python2 from CI and code that branched on it (#5607)Alex Gaynor2020-12-081-35/+7
| | | | | | | | | | | | | * 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>
* Remove unused code (#5360)Alex Gaynor2020-07-281-6/+0
|
* Paint it Black by the Rolling Stones (#5324)Alex Gaynor2020-07-201-6/+12
|
* Removed deprecated behavior in AKI.from_issuer_subject_key_identifier (#5182)Alex Gaynor2020-04-051-1/+0
|
* Drop support for OpenSSL 1.0.1 (#5178)Alex Gaynor2020-04-041-1/+0
|
* Deal with the 2.5 deprecations (#5048)Alex Gaynor2019-11-031-1/+1
| | | | | | | | | | | | * Deal with the 2.5 deprecations * pep8 + test fixes * docs typo * Why did I do this? * typo
* fix from_issuer_subject_key_identifier to take the right type (#4864)Paul Kehrer2019-05-041-0/+1
| | | | | | | | | | * fix from_issuer_subject_key_identifier to take the right type deprecate passing the old Extension wrapper object * don't use a try:except: * hilarious contortions to satisfy doc8
* Simplify string formatting (#4757)Alex Gaynor2019-02-201-6/+6
|
* Fixes #4734 -- Deal with deprecated things (#4736)Alex Gaynor2019-01-231-3/+2
| | | | | | | | | | * Fixes #4734 -- Deal with deprecated things - Make year based aliases of PersistentlyDeprecated so we can easily assess age - Removed encode/decode rfc6979 signature - Removed Certificate.serial * Unused import
* deprecate old from_encoded_point (#4640)Paul Kehrer2018-12-111-0/+1
|
* allow bytes-like for key/iv/data for symmetric encryption (#4621)Paul Kehrer2018-12-091-0/+7
| | | | | | | | | | | | | | | | | | * 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
* deprecate pythons without hmac.compare_digest (#4261)Paul Kehrer2018-05-241-0/+1
| | | | | | * deprecate the constant time bytes comparison path old python 2.7.x uses * pep8
* Fixes #4076 - simplify the implementation of int_from_bytes on python2 (#4077)Alex Gaynor2018-01-101-2/+1
| | | | | | | | * Fixes #4076 - simplify the implementation of int_from_bytes on python2 * whitespace * Added a test