summaryrefslogtreecommitdiff
path: root/src/cryptography
Commit message (Collapse)AuthorAgeFilesLines
* Converted DER parsing of SPKIs to rust (#5963)Alex Gaynor2021-04-111-25/+2
|
* Port a tiny tiny bit of the ASN.1 parsing to Rust (#5357)Alex Gaynor2021-04-111-16/+7
|
* Update annotation for key (#5951)Sam Bull2021-04-031-1/+5
| | | | | | | * Update annotation for key * Update fernet.py * Update fernet.py
* fix XTS less than one block length. fixes #5885 (#5925)Paul Kehrer2021-03-211-1/+7
| | | | | * fix XTS less than one block length. fixes #5885 * make XTS test key happy
* make get_extension_for_class a generic function (#5923)Mathias Ertl2021-03-201-2/+2
|
* typehint x509.base (#5899)Mathias Ertl2021-03-154-31/+95
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * start typing x509.base * statically type x509.base * typehint X509Backend interface * typehint at least the X509Backend interface * make _CertificateRevocationList/_CertificateSigningRequest actual subclasses of the interface (as done before for Certificate in f16bff2cb) * tell mypy to ignore lines with deliberately wrong types * signature_hash_algorithm always returns a hash algorithm (it's not optional) * Revert "signature_hash_algorithm always returns a hash algorithm (it's not optional)" This reverts commit f6a5b172b416f8ddea561203c0cf03b55e4ec50e. * hash algorithm is actually optional * fix import style * typehint parsed_version to int, which it de facto always is * minimize changes * break import cycle with conditional imports * ignore access to private members of openssl implementation * reformat code with Black * test check for missing public key
* Typehint x509.base (only) (#5904)Mathias Ertl2021-03-112-23/+54
| | | | | | | | | | | | | | | | | * typehint x509.base * cast extension class * don't use string in typecast * use lists as default argument values (see #5904) * restore import since this is now re-exported * ignore linting errors * empty commit to trigger github actions * fix formatting issue
* Bugfix/issue 5889 typehint get values for types (#5900)Mathias Ertl2021-03-073-34/+258
| | | | | | | | | | | | | | | | | | | | | * add type alias for IP addresses * Re-export module attributes in cryptography.x509.oid Without exporting attributes via `__all__` mypy will consider typehints of classes imported from `cryptography.x509.oid` as type Any. Example: from cryptography.x509.oid import ObjectIdentifier oid = ObjectIdentifier("1.2.3") # Any, if we do not re-export Note that while the canonical location of ObjectIdentifier is in `crytography.x509`, it is imported many times from `crytography.x509.oid` instead * add return type annotiations to constructors * overload GeneralNames.get_values_for_type * overload all implementations
* Generic extension value/typehint x509.Name (#5897)Mathias Ertl2021-03-062-4/+22
| | | | | | | * make value property return the generic value * typehint x509.Name * also ignore overloaded functions
* more typing (#5887)Paul Kehrer2021-03-0234-154/+326
| | | | | | | | | | | * 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
|
* changes to support typing backend (#5882)Paul Kehrer2021-02-282-16/+24
| | | this gets rid of the conditional backend type registration
* keep on typing (#5881)Paul Kehrer2021-02-283-40/+33
| | | | | * keep on typing * swear i did this
* fix pkcs12 parse ordering. fixes #5872 (#5879)Paul Kehrer2021-02-281-4/+4
| | | | | | | | | | | | | | | | | * fix pkcs12 parse ordering. fixes #5872 * remove an unneeded print * simplify the test a bit more * index * black * Update tests/hazmat/primitives/test_pkcs12.py Co-authored-by: Alex Gaynor <alex.gaynor@gmail.com> Co-authored-by: Alex Gaynor <alex.gaynor@gmail.com>
* Add SM4 symmetric block cipher (#5834)tobyp2021-02-282-0/+18
| | | Co-authored-by: Tobias Peter <tobias.peter@infineon.com>
* Add SM3 hash algorithm (#5833)tobyp2021-02-281-0/+6
| | | Co-authored-by: Tobias Peter <tobias.peter@infineon.com>
* Type a bunch of random functions (#5875)Alex Gaynor2021-02-273-15/+23
|
* Annotate asymetric contexts (#5874)Alex Gaynor2021-02-271-4/+4
|
* consistently typecast to list (#5873)Mathias Ertl2021-02-271-3/+6
|
* Strict typehints for extensions and OIDs (#5870)Mathias Ertl2021-02-272-224/+263
| | | | | | | | | | | | | | | | | | | | | | | | | * add typehint for name * strictly type ObjectIdentifier * explicit reexport for mypy * type (most) of extensions.py * minor cleanup * more consistently return None in constructors * revert explicit reexport, as requested * use _make_sequence_methods for now (#5870) * mark oid as normal type-hinted property so that classes can access it * fix spelling (upper case) use short form for reference * annotate as ClassVar * add type ignore for special extension class
* Remove unused X509 verification flags bindings (#5868)David Benjamin2021-02-261-15/+0
| | | | These don't appear to be used in pyopenssl or cryptography.io. One less source of conditionals.
* Convert unpadding code to Rust (#5668)Alex Gaynor2021-02-211-5/+8
|
* add typehint for name (#5856)Mathias Ertl2021-02-211-1/+1
|
* Add key_identifier property to SubjectKeyIdentifier (#5849)Arnaud Durand2021-02-211-0/+4
| | | Fix #5848
* make Extension a generic class (fixes #5830) (#5831)Mathias Ertl2021-02-202-6/+11
|
* Fix typo in error messages: can not => cannot (#5851)Robert Martin2021-02-203-3/+3
|
* add typehints for read only properties (#5826)Mathias Ertl2021-02-1510-86/+252
| | | | | | | | | | | | | | | | | | | | | | | | | | | * add typehints for read only properties * fix typing in test cases * fix last missing assertion * add typehints to all read_only_properties where type hints are already available * check for isnot None instead, as per PR suggestion * convert read_only_property to @property decorators * remove unused import * use List instead of Iterable for return values * use @property instead of read_only_property * fix type errors * remove last occurance of annotated read_only_property * use is not None check (works because we now return list) * fix unused import
* Start replacing read_only_property with dedicated functions (#5824)Alex Gaynor2021-02-135-35/+38
| | | read_only_property is basically impossible for mypy to check
* change to a new version scheme (#5825)Alex Gaynor2021-02-131-1/+1
| | | | | | | | | | | | | * change to a new version scheme fixes #5801 * Update docs/api-stability.rst Co-authored-by: Paul Kehrer <paul.l.kehrer@gmail.com> * line length Co-authored-by: Paul Kehrer <paul.l.kehrer@gmail.com>
* part 2 of typing x509 extensions (#5815)Alex Gaynor2021-02-112-31/+68
|
* Start typing a bunch of stuff from x509 extensions (#5812)masterAlex Gaynor2021-02-112-36/+45
|
* Name: update get_attributes_for_oid return type (#5809)Dan Halperin2021-02-101-1/+1
| | | | | | | | `List` gives more power to the caller. Note that `RelativeDistinguishedName`, the same function returns a `List`. Is there a reason this was `Iterable` only for `Name`? If we don't want to promise `List`, `Sequence` is another alternative.
* fix signature of EllipticCurvePublicKey.verify() (#5808)Markus Wamser2021-02-101-1/+1
| | | The signature change was introduced in https://github.com/pyca/cryptography/pull/5729 but is inconsistent with respect to related methods, breaks backward compatibility and compatibility with the OpenSSL backend (and maybe other backends) when named arguments are used.
* Added a py.typed so mypy prefers us to typeshed (#5802)Alex Gaynor2021-02-091-0/+0
| | | closes #5796
* fixed a circular import error (due to type hints) (#5800)Alex Gaynor2021-02-091-2/+2
| | | | fixes #5794 closes #5795
* 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>
* fix import cycle with asymmetricpadding (#5758)Paul Kehrer2021-02-073-10/+19
| | | | | * fix import cycle with asymmetricpadding * Update src/cryptography/hazmat/primitives/_asymmetric.py
* reopen master for 3.5 (#5752)Paul Kehrer2021-02-071-1/+1
| | | | | | | | | * reopen master for 3.5 * Update CHANGELOG.rst Co-authored-by: Alex Gaynor <alex.gaynor@gmail.com> Co-authored-by: Alex Gaynor <alex.gaynor@gmail.com>
* 3.4 release (#5749)3.4Alex Gaynor2021-02-071-1/+1
|
* port changelog and fix back to master for CVE-2020-36242 (#5748)Paul Kehrer2021-02-071-1/+1
|
* Added typing for a bunch of random stuff (#5743)Alex Gaynor2021-02-047-27/+42
|
* Added typing for more of ciphers (#5738)Alex Gaynor2021-02-015-29/+43
|
* Added typing for a bunch of methods (#5737)Alex Gaynor2021-02-018-24/+27
|
* rsa type hinting (#5733)Paul Kehrer2021-02-013-68/+182
| | | | | | | | | | | | | | | | | | | * rsa type hinting * remove unused import * missed return type * type fixes * ignores no longer required * black gets me every time * Update src/cryptography/hazmat/backends/openssl/rsa.py Co-authored-by: Alex Gaynor <alex.gaynor@gmail.com> Co-authored-by: Alex Gaynor <alex.gaynor@gmail.com>
* KDF type hinting (#5735)Paul Kehrer2021-02-017-67/+115
| | | | | | | * KDF type hinting * more types * less contortions
* add optional block_size to the HashAlgorithm interface (#5736)Paul Kehrer2021-02-011-0/+14
| | | This makes typing ConcatKDF easier
* type hints for asym utils (#5734)Paul Kehrer2021-02-011-3/+5
|
* x25519/x448 type hints (#5731)Paul Kehrer2021-01-314-36/+68
| | | | | * x25519 type hints * x448 type hints
* poly1305 type hints (#5732)Paul Kehrer2021-01-311-6/+6
|
* add type hinting for ed25519 (#5728)Paul Kehrer2021-01-312-20/+37
|