summaryrefslogtreecommitdiff
path: root/src/cryptography/exceptions.py
Commit message (Collapse)AuthorAgeFilesLines
* Use pyo3's facilities for exceptions (#8785)Alex Gaynor2023-04-221-15/+2
|
* Use from __future__ import annotations everywhere (#8643)Alex Gaynor2023-03-311-1/+2
|
* Simplify/unify Rust and Python OpenSSL error handling (#8552)Alex Gaynor2023-03-201-4/+2
|
* Use the ruff 'pyupgrade' checks (#8104)Alex Gaynor2023-01-201-2/+2
|
* Expand typing coverage to exceptions (#6717)Alex Gaynor2021-12-211-2/+13
| | | | | | | * Expand typing coverage to exceptions Involves making _OpenSSLErrorWithText a typing.NamedTuple * Poke for CI
* Use well-defined enum representation (#6042)Christian Heimes2021-05-121-2/+2
| | | | | | | | | 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>
* Remove __future__ import from our code (#5610)Alex Gaynor2020-12-091-1/+0
|
* poly1305 support (#4802)Paul Kehrer2019-03-091-0/+1
| | | | | | | | | | | | | | | | | | | | * poly1305 support * some more tests * have I mentioned how bad the spellchecker is? * doc improvements * EVP_PKEY_new_raw_private_key copies the key but that's not documented Let's assume that might change and be very defensive * review feedback * add a test that fails on a tag of the correct length but wrong value * docs improvements
* OpenSSL DH backend implementation [Second attempt] (#2914)Aviv Palivoda2016-11-261-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Start of OpenSSL DH backend implementation * Supporting DH in MultiBackend * DHBackend has dh_parameters_supported method * Removed DHParametersWithNumbers and DHPrivateKeyWithNumbers from documentation * Removed ExchangeContext. exchange is a method of DHPrivateKeyWithSerialization * PEP8 fixes * Fixed TestDH.test_bad_tls_exchange * Fixed generate_private_key reference in dh documentation * test DH multibackend support * testing DH coversion to serialized * Validating that we receive serialized class in test_generate_dh * Testing DH exchange symmetric key padding * struct DH is now opaqued * PEP8 fixes * Testing load_dh_private_numbers throws ValueError when DH_check fails * Using openssl_assert * Passing keywords arguments in DH key exchange example * test_dh::test_bad_tls_exchange now uses pre calculated parameters * TestDH - Add test that the computed secret is equivalent to the definition by comparing with secret computed in pure python * Add missing generator parameter to DHBackend interface docs. * Include parameter type in DHBackend abc docs. * Add docs for dh.generate_parameters function * Remove the dh Numbers section, and move the DHNumbers class docs to where they are first used. * Add note of big endian byte packing to DH exchange method. * DH documentation updates. Add single sentence overview with wikipedia link. Add paragraph on assembling using Numbers objects. Add link to backend interface docs. First section was all indented, I think by mistake. * Add exchange method to DHPrivateKey abstract base class. * Small tweaks to DH documentation - remove Provider. * Add endian to dictionary * Use utils.int_from_bytes in test_tls_exchange_algorithm * Removed duplicate line * Change dh.rst exchange algorithm from doctest to code-block The example in the Diffie-Hellman exhange algorithm is using 2048 bits key. Generating the parameters of 2048 takes long time. This caused the automated tests to fail. In order to pass the tests we change the example to code-block so it will not run in the doc tests. * Fix dh docs * Document the generator in DHBackend relevant methods * Fix dh tests * use DHparams_dup * Fix key type to unsigned char as expected by DH_compute_key * Validate that DH generator is 2 or 5 * test dh exchange using botan vectors * group all numbers classes * Simplify _DHPrivateKey * Rename test with serialized to numbers * Move bad exchange params to external vector file * update exchange versionadded to 1.7 * Make key_size bit accurate * Change botan link * Added CHANGELOG entry
* oh right pep8 is a thingPaul Kehrer2015-10-291-3/+0
|
* do the deprecation dance for the twelfth releasePaul Kehrer2015-10-291-11/+0
|
* Add an Elliptic Curve Key Exchange Algorithm(ECDH)Simo Sorce2015-10-171-0/+1
| | | | | | | | | The ECDH Key Exchange algorithm as standardized in NIST publication 800-56A Revision 2 Includes tests with vectors from NIST. Signed-off-by: Simo Sorce <simo@redhat.com>
* Use InternalError for stuffAlex Gaynor2015-09-261-1/+3
|
* InvalidToken is deprecated in 09, not 08Steven Buss2015-04-131-1/+1
|
* Move cryptography.exceptions.InvalidToken to ↵Steven Buss2015-04-131-2/+12
| | | | cryptography.hazmat.primitives.twofactor
* made the internal _Reasons an enum, since we already depend on enum34Alex Gaynor2014-12-181-11/+13
| | | | fixes #854
* add X509Backend support to multibackendPaul Kehrer2014-11-261-0/+1
|
* Update the license header for every source file, as well as the documentation.Alex Gaynor2014-11-161-12/+3
| | | | Fixes #1209
* Move the cryptography package into a src/ subdirectoryDonald Stufft2014-11-131-0/+63
Due to differences in how py.test determines which module to ``import`` the test suite actually runs against the cryptography which is in the *current* directory instead of the cryptography which is installed. The problem essentially boils down to when there is a tests/__init__.py then py.test adds the current directory to the front of the sys.path, causing it to take precedence over the installed location. This means that running the tests relies on the implicit compile that CFFI does instead of testing against what people will actually be runnning, which is the module compiled by setup.py.