aboutsummaryrefslogtreecommitdiffstats
path: root/tests/hazmat/backends/test_openssl.py
Commit message (Collapse)AuthorAgeFilesLines
* fix coverage, small cleanups in tests (#4990)Paul Kehrer2019-09-091-0/+10
|
* we don't have these mac builders any more (#4892)Paul Kehrer2019-05-251-7/+1
| | | | | | | | | | * we don't have these mac builders any more let's see if we get coverage from azure like we should! * remove a branch we can't cover in tests * remove unused import
* reduce our engine bindings even more (#4768)Paul Kehrer2019-02-251-0/+19
|
* support NO_ENGINE (#4763)Paul Kehrer2019-02-251-0/+3
| | | | | | | | * support OPENSSL_NO_ENGINE * support some new openssl config args * sigh
* why did we have these variables (#4764)Paul Kehrer2019-02-241-7/+7
|
* remove freebsd11 builder (#4401)Paul Kehrer2018-08-151-2/+0
| | | | | | | | | | | | * remove freebsd11 builder it's out of date, we can't update it, and it is unreliable * we don't test against freebsd for now * what did case sensitivity ever do for me * don't assert on bsd since we don't test on for now
* Fixed #4380 -- do not assume TLSv1 is available in OpenSSL (#4389)Alex Gaynor2018-08-121-1/+1
| | | | | | | | * Fixed #4380 -- do not assume TLSv1 is available in OpenSSL Hallelujah! It's starting to become the case that some OpenSSLs are disabling it. * cover this file as well
* Expose `BN_clear_free` in the OpenSSL backend (#4071)Tux2018-01-051-1/+1
| | | | | | * Expose BN_clear_free * Use BN_clear_free in test_int_to_bn
* Fixed #4058 -- use the thread-safe API from OpenSSL, not the danger one (#4059)Alex Gaynor2017-12-181-3/+3
|
* Inline calls to bit_length now that it's trivial (#3966)Alex Gaynor2017-10-121-3/+3
| | | | | | | | * Inline calls to bit_length now that it's trivial * unused imports * An comment
* RSA OAEP label support for OpenSSL 1.0.2+ (#3897)Paul Kehrer2017-09-081-12/+0
| | | | | | | | | | * RSA OAEP label support for OpenSSL 1.0.2+ * changelog * move around tests, address review feedback, use backend supported method * unsupported padding catches this now
* move x509 tests into a module (#3889)Paul Kehrer2017-09-061-1/+1
| | | | | | | | | | | * move x509 tests into a module This is just to make grouping things like test_ocsp, etc a bit simpler in the future * fix path * pep8
* remove deprecated items (#3794)Paul Kehrer2017-07-201-33/+3
| | | | | | | | | | * remove deprecated items whirlpool, ripemd160, unsupportedextension, and the old interfaces * flake8 and remove a test generator we no longe use * make it clear we warned you about these things
* Dh parameters serialization (#3504)Aviv Palivoda2017-06-241-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Support DH parameter serizalization - no X9.42 * Support X9.42 serialization - DER not working * Fix dhp_rfc5114_2.der Changing the DER parameters serialization after the fix in openssl commit a292c9f1b835 * DH parameters X9.42 DER serialization fixed * fix _skip_dhx_unsupported * document DH parameter_bytes * PEP8 fixes * Document load_pem_parameters * Document load_der_parameters * document ParameterFormat * Increase test coverage * Increase test covrage * Remove unneeded check * Fix typo * Fix error in load_der_parameters * Add load_pem_parameters and load_der_parameters to interfaces * CR fixes * Removed unverified phrase * Update version to 2.0 * Fix pep8 * Rename ParameterFormat.ASN1 to ParameterFormat.DHParameter * link pkcs3 * Add new line at end of file to serialization.rst * Rename DHparameters to PKCS3 * doc CR fix
* fix libressl error/refactor some error handling (#3609)Paul Kehrer2017-05-261-4/+1
| | | | | | | | | | | | | | | | | | | | | | | * add libre so I can see the error * add the libre error needed and refactor error handling a bit We were historically matching on lib + func + reason, but func is somewhat unstable so now we match on lib + reason only. Of course, in this case libressl changed both lib and reason so it wouldn't have mattered. All error handling from the error queue in openssl is an illusion * fix a typo, probably an unneeded branch * review feedback * refactor tests to support libressl insert additional rant about libre here, although admittedly these tests were assuming stability where openssl itself guarantees none * better assert, fix flake8
* Attempt to simplify the libressl checing (#3482)Alex Gaynor2017-03-261-4/+1
| | | | | | | | | | * Attempt to simplify the libressl checing * SHENANGINS * Attempted fix * More simplification
* Ec is a thing (#3453)Alex Gaynor2017-03-151-23/+1
| | | | | | | | | | | | | | | | * We always have EC * We always have ECDH * We always have ECDSA * We always have EC codes * This can go as well * And this * unused import
* reverts a change to our exceptions (#3429)Paul Kehrer2017-03-091-5/+3
| | | | | Trying to be too specific about why key loading fails is very difficult when you're using the same logic across DH, EC, RSA, and DSA. This makes it less fancy.
* DH subgroup order (q) (#3369)Aviv Palivoda2017-03-051-3/+80
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Support DH q (subgroup order) * Change RFC5114.txt to NIST format * Add tests for DH q * Update docs for DH q * Fix pep8 * Improve test covergae for DH q * Create _dh_params_dup that copy q if DHparams_dup don't On OpenSSL < 1.0.2 DHparams_dup don't copy q. _dh_params_dup call DHparams_dup and if the version is smaller than 1.0.2 copy q manually * Copy q manually on libressl * Add to test vectors serialized RFC5114 2048 bit DH parameters with 224 bit subgroup * Support serialization of DH with q * Add tests for serialization of DH with q * Support DH serialization with q only if Cryptography_HAS_EVP_PKEY_DHX is true * Raise exception when trying to serialize DH X9.42 when not supported * raise unsupported key type when deserilizing DH X9.42 if not supported * pep8 fixes * Fix test_serialization * Add dhx_serialization_supported method to DHBacked * document q in dh_parameters_supported * Rename dhx_serialization_supported to dh_x942_serialization_supported
* switch the PEM password callback to a C implementation (#3382)Paul Kehrer2017-02-131-15/+24
| | | | | | | | | | | | | | | * switch the PEM password callback to a C implementation Calling from C to Python is fraught with edge cases, especially in subinterpreter land. This commit moves the PEM password callback logic into a small C function and then removes all the infrastructure for the cffi callbacks (as we no longer have any) * review feedback and update tests * rename the struct * aaand one more fix
* enforce password must be bytes when loading PEM/DER asymmetric keys (#3383)Paul Kehrer2017-02-081-1/+1
| | | | | | | | | | * enforce password must be bytes when loading PEM/DER asymmetric keys Previously we were using an ffi.buffer on the Python string, which was allowing text implicitly, but our documentation explicitly requires bytes. * add changelog entry
* add openssl_version_number & doc openssl_version_text (#3329)Paul Kehrer2016-12-211-0/+3
| | | | | | | | | | * add openssl_version_number & doc openssl_version_text fixes #3315 * more docs + actually assert on the test... * text
* Drop 1.0.0 (#3312)Alex Gaynor2016-12-131-151/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * delete the 1.0.0 support * drop the version check * drop the AES-CTR stuff * Update the example * openssl truncates for us now * delete unused test * unused imports * Remove a bunch of conditional bindings for NPN * no more 1.0.0 builders * libressl fix * update the docs * remove dead branches * oops * this is a word, damnit * spelling * try removing this * this test is not needed * unused import
* New osrandom_engine in C (#3229)Christian Heimes2016-12-091-13/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * New osrandom_engine in C Inspired by Python/random.c and the old implementation. Signed-off-by: Christian Heimes <christian@python.org> * osrandom_engine * Fix naming bug caused by search 'n replace mistake * Make it easier to override osrandom auto-detection * Add engine ctrl and backend API to get implementation from ENGINE Signed-off-by: Christian Heimes <christian@python.org> * Better test coverage, documentation, LICENSE Signed-off-by: Christian Heimes <christian@python.org> * Coverage is hard. Signed-off-by: Christian Heimes <christian@python.org> * * enable win32 check * read() returns size_t Signed-off-by: Christian Heimes <christian@python.org> * Add macOS to spelling list. Remove dead code from header file. Signed-off-by: Christian Heimes <christian@python.org> * remove CCRandomGenerateBytes path and update getentropy to work on macOS This change allows us to test all the engines in our CI: * getentropy (tested by macOS sierra) * getrandom (tested on several linux builders) * /dev/urandom (tested on FreeBSD, OS X 10.11 and below, & older linux) * CryptGenRandom (tested on windows builders) I also fixed bugs preventing compilation in the getentropy code * getentropy() returns int and is restricted to 256 bytes on macOS, too. Signed-off-by: Christian Heimes <christian@python.org> * add versionadded * Re-add import of os module * Fixes related to Alex's recent review. Signed-off-by: Christian Heimes <christian@python.org> * Add error reporting and fail for EAGAIN Add error reporting strings for various error cases. This gives us much nicer and understandable error messages. SYS_getrandom() EAGAIN is now an error. Cryptography refuses to initialize its osrandom engine when the Kernel's CPRNG hasn't been seeded yet. Signed-off-by: Christian Heimes <christian@python.org>
* 1.0.2i changed the way COMP_METHOD is exported if NO_COMP is set (#3162)Paul Kehrer2016-09-221-1/+1
| | | | | | | | | | * 1.0.2i changed the way COMP_METHOD is exported if NO_COMP is set * add a comment explaining why we changed this * 1.0.2i handles NUMERICSTRING properly now so need only test < 1.0.2i * needs to be visible
* fix warnings in cffi 1.8.3 due to wrong buffer types (#3155)Paul Kehrer2016-09-211-2/+2
|
* OpenSSL 1.1.0 support (#2826)Paul Kehrer2016-08-261-7/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * make pre5 work * add a blank line to make the diff happier * 1.1.0-pre6 working * support the changes since 1.1.0-pre6 * fixes * add 1.1.0 to travis * expose the symbol * better testing for numericstring * handle libre... * actually use the 1.1.0 we compile * cache the ossl-110 dir on travis * add some newlines * changelog entry for 1.1.0 support * note that we test on 1.1.0 * proper skip on this test * reorder
* Use a series of constants for OpenSSL version checks (#3037)Alex Gaynor2016-07-111-8/+8
| | | | | | | | | | | | | | | | | | | | | | | | * Use a series of constants for OpenSSL version checks. N.B. I removed several qualifiers that were being used to express beta vs. release in OpenSSL version numbers. Reviewers please look closely! * Convert some python as well, also add the file * flake8 * Simplify code, remove functionality that can be expressed more simply * clean up the tests as well * more constants * wrap long lines * reflect feedback * unused * add this back?
* Complete the removal of the string '0.9.8' (#3005)Alex Gaynor2016-06-201-1/+1
| | | We have always been at war with OpenSSL 0.9.8
* Remove a binding and comments that reference 0.9.8 (#2984)Alex Gaynor2016-06-181-1/+1
|
* Drop OpenSSL 0.9.8 (#2978)Alex Gaynor2016-06-181-25/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Drop OpenSSL 0.9.8 * Drop this test, it's not relevant any longer * unused import * Remove CRYPTOGRAPHY_ALLOW_OPENSSL_098=1 from our tox * removed unused code for Cryptography_HAS_PKEY_CTX * return unused code for _AESCTRCipherContext * syntax :-( * remove some unused tests and skips * remove unused code for Cryptography_HAS_PBKDF2_HMAC * Revert "return unused code for _AESCTRCipherContext" This reverts commit 7d149729205aa4c9735eb322414b167a75b302df. * Remove unused RSA code * Remove unused test code for conditional bindings * Remove unused dsa code * unused import * Remove unused x509 extension code * Remove unused EC code * Attempt to remove unused DER key loading code * document this * grammar * Added back this paragraph * Update docs
* RSA OAEP SHA2 Support (#2956)Paul Kehrer2016-06-041-2/+74
| | | | | | | | | | | | | | | | | | | | * some rsa oaep sha2 support * various improvements * fix a thing * simplify * update the test * styyyyyle * more styyyyle * fix libre, remove a skip that should never be hit * OAEP version check fixes
* Use teardown since we ignore the method arg anyways (#2928)Alex Gaynor2016-05-301-2/+1
|
* Replacing test_osrandom_engine_is_default. (#2905)Andreas Moser2016-05-291-0/+12
| | | | | | | | | | | | | | | | | | | * Removing test_osrandom_engine_is_default. test_osrandom_engine_is_default depends on having a valid sys.executable. This attribute is not always set (see https://docs.python.org/2/library/sys.html#sys.executable ) so, in some environments, this test fails. I moved the functionality of the test into the setup and teardown methods so the correct behavior is still tested. * Fixing some style issues. * Removing an unnecessary newline. * Putting back the test. * Moving the assert from teardown to setup.
* py3 is a thingPaul Kehrer2016-03-121-1/+1
|
* move NUMERICSTRING certificate test to test_openssl & make it more specificPaul Kehrer2016-03-121-0/+21
|
* Un-double the test doublesAlex Gaynor2016-03-051-40/+13
|
* Send stderr someplaceAlex Gaynor2016-02-271-1/+2
| | | | Otherwise there's noise in the test output on python 2.6
* Actually allocate a buffer that is the correct size.Tristan Seligmann2016-02-081-2/+3
|
* give a real EVP_PKEY with an invalid default key type to the testPaul Kehrer2016-01-071-2/+0
|
* opaque EVP_PKEY since EVP_PKEY_id existsPaul Kehrer2016-01-071-1/+1
|
* Support EC and DSA signing of CRLs in the OpenSSL backendPaul Kehrer2015-12-271-0/+37
|
* move two tests to the openssl backend tests where they belongPaul Kehrer2015-12-261-1/+51
|
* RevokedCertificateBuilderPaul Kehrer2015-12-251-2/+2
|
* add create_x509_revoked_certificate to x509backend interfacePaul Kehrer2015-12-251-0/+6
|
* Merge pull request #2567 from alex/this-is-americaPaul Kehrer2015-12-241-1/+1
|\ | | | | Spell serialization consistently
| * Spell serialization consistentlyAlex Gaynor2015-12-241-1/+1
| |
* | CertificateRevocationListBuilderPaul Kehrer2015-12-241-3/+6
|/ | | | | RSA keys only. Currently does not support CRL extensions or CRLEntry extensions.
* coveragePaul Kehrer2015-12-241-0/+5
|
* Change password callback to use userdata pointerChristian Heimes2015-12-201-2/+15
| | | | | | | | | Instead of a closure the pem_password_cb now uses the void *userdata argument to exchange data with the callback function. It's a necessary step to port all callbacks to new static callbacks. See: #2477 Signed-off-by: Christian Heimes <christian@python.org>