Commit graph

69 commits

Author SHA1 Message Date
William Woodruff
f89ce7bcc5
tests, ci: plumb x509-limbo-root (#9871)
Signed-off-by: William Woodruff <william@trailofbits.com>
2023-11-13 19:48:28 +00:00
Alex Gaynor
cb8c68fbe1
always run the backend error checks (#9014) 2023-06-02 10:36:12 +08:00
Alex Gaynor
22759dbab0
Switch from pytest-subtests to a mini-version that's faster (#8613) 2023-03-29 02:28:17 +00:00
Paul Kehrer
b5170bf26d
drop python 3.6 support (#8448)
* drop python 3.6 support

* Update tests/hazmat/bindings/test_openssl.py

Co-authored-by: Alex Gaynor <alex.gaynor@gmail.com>

---------

Co-authored-by: Alex Gaynor <alex.gaynor@gmail.com>
2023-03-24 13:15:13 +00:00
Alex Gaynor
45a5100e4e
Simplify/unify Rust and Python OpenSSL error handling (#8552) 2023-03-20 09:41:48 +08:00
Paul Kehrer
f59a7d42fb
update to latest pytest-subtests and add the new flag (#8301)
* update to latest pytest-subtests and add the new flag

* crimez

* lol
2023-02-16 03:24:35 +00:00
Alex Gaynor
5d3db676cf
Use the ruff 'pyupgrade' checks (#8104) 2023-01-20 05:36:01 +08:00
Paul Kehrer
01687d63a5
add unsafe_skip_rsa_key_validation (#7667)
* add unsafe_skip_rsa_key_validation

This allows users to skip RSA key validation when calling
load_pem_private_key, load_der_private_key, and
RSAPrivateNumbers.private_key. This is a significant performance
improvement but is **only safe if you know the key is valid**. If you
use this when the key is invalid OpenSSL makes no guarantees about what
might happen. Infinite loops, crashes, and all manner of terrible things
become possible if that occurs. Beware, beware, beware.

* Apply suggestions from code review

Co-authored-by: Alex Gaynor <alex.gaynor@gmail.com>

* remove unneeded variable

Co-authored-by: Alex Gaynor <alex.gaynor@gmail.com>
2022-10-03 14:29:45 +00:00
Alex Gaynor
1a8098b1a6
Ensure there's nothing on the error stack after tests (#5997)
* Ensure there's nothing on the error stack after tests

* Update binding.py

* Simplify

* Be sure it's clear at teh start of the test

* update for libressl version

* Workaround for OpenSSL 3.0

* Workaround for OpenSSL 3.0

* Link to issue
2021-09-26 12:07:24 +08:00
Paul Kehrer
27374c62c7
FIPS 3.0.0 support (#6012)
* FIPS 3.0.0 support

* comments

* remove unneeded error clear

* review comments

* small refactor

* black

* flake8 too

* review feedback

* oops

* fix
2021-08-29 10:05:32 -04:00
Paul Kehrer
b93f405c07
Speed up RSA tests in 3.0.0 (#6206)
* Speed up RSA tests in 3.0.0

RSA_check_key is slower in OpenSSL 3.0.0 due to improved
primality checking. In normal use this is unlikely to be a problem
since users don't load new keys constantly, but we do in our tests.
This adds some private flags to allow skipping those checks for
performance reasons.

On my laptop with this patch it takes 16s to run test_rsa.py. The
previous commit takes 72s.

* black

* different approach

* skip rsa key checks in wycheproof

wycheproof's tets don't rely on broken keys
2021-08-11 22:47:25 -04:00
Alex Gaynor
245d15b563
Remove requires_backend_interface from tests because it was useless (#5884) 2021-03-01 11:59:24 -06:00
Alex Gaynor
057a9fcf34
fixes #5611 -- use subtests for wycheproof tests for speed (#5616) 2020-12-09 10:04:47 -06:00
Alex Gaynor
e0477596f7
Remove __future__ import from our code (#5610) 2020-12-09 00:35:11 -06:00
Alex Gaynor
2b85c4d915
Simplify wycheproof pytest code (#5579) 2020-11-20 11:22:47 -06:00
Alex Gaynor
60aa04481f
Paint it Black by the Rolling Stones (#5324) 2020-07-20 13:06:29 -05:00
Paul Kehrer
4a245a657a
test FIPS mode on centos8 (#5323)
* test FIPS mode on centos8

* remove branch we don't take

* simpler

* better comment

* rename

* revert some things that don't matter

* small cleanups
2020-07-20 12:10:29 -04:00
Alex Gaynor
ac1d13f43d Simplify string formatting (#4757) 2019-02-20 12:38:32 +08:00
Paul Kehrer
0322962e14 update pytest config (#4463)
* update pytest config

pytest 3.8.0 was just released and officially deprecates some of the way
we do pytest marks. They introduced a new way to do this in 3.6 so this
PR switches to that mechanism and updates our minimum pytest requirement

* update the stubs

* also update wycheproof test config to remove deprecated paths

* don't need this any more
2018-09-06 23:56:46 -04:00
Alex Gaynor
2e85a925b4 Refs #3331 -- added initial wycheproof integration, starting with x25519, rsa, and keywrap (#4310)
* Refs #3331 -- added initial wycheproof integration, starting with x25519 tests
2018-07-16 20:48:33 +05:30
Alex Gaynor
e6055fbfb2 call check_backend_support directly from backend fixture (#3666) 2017-06-03 16:02:50 -10:00
Alex Gaynor
133a17971a Switched our backend to be a normal fixture in tests (#3665) 2017-06-03 14:38:22 -10:00
Alex Gaynor
f9b3b1592d Delete some code (#3563)
* Delete some code

* removed import

* delete more code
2017-05-20 18:36:19 -07:00
Paul Kehrer
a4668c6593 remove multibackend (#3555)
* remove multibackend

* oops

* goodbye pointless tests
2017-05-20 13:25:47 -07:00
Alex Gaynor
e85797b3d1 py26 2016-03-19 16:51:05 -04:00
Alex Gaynor
5930305592 oops, flake8 2016-03-19 16:48:18 -04:00
Alex Gaynor
b8b1d72005 Instead of running a python -c, use pytest_report_header to indicate OpenSSL version 2016-03-19 16:47:30 -04:00
Alex Gaynor
3adb839c9d Don't try to load backends if the test doesn't need it 2015-07-12 11:44:04 -05:00
Alex Gaynor
9bbd4900bc Fixed #1689 -- correctly handle code with multiple requires_backend_itnerface 2015-07-01 22:26:28 -04:00
Alex Gaynor
52c15642b1 Hoist this logic out of the loop, since it's used after the end of the loop 2014-12-18 08:08:36 -08:00
Alex Gaynor
5951f46be6 Update the license header for every source file, as well as the documentation.
Fixes #1209
2014-11-16 09:08:42 -08:00
Paul Kehrer
8d10a1366a fix coverage for backend parametrization
Any test that takes a backend is required to provide the
requires_backend_interface decorator.
2014-10-25 21:39:35 -07:00
Paul Kehrer
902d8cfd58 move skip_if_empty to separate function for test coverage 2014-10-25 12:22:10 -07:00
Paul Kehrer
56f1a0ae53 add comment explaining some weirdness 2014-10-24 10:30:25 -07:00
Paul Kehrer
daefd3fbff reorganize try block for test generation 2014-10-24 07:48:37 -07:00
Paul Kehrer
f93d8244ea filter backends during initial generation to elide tests entirely 2014-10-24 07:38:59 -07:00
Alex Gaynor
2607ab5b93 public API only 2014-10-23 11:34:10 -07:00
Alex Gaynor
276ba5a1bc flatten line 2014-10-23 11:31:10 -07:00
Alex Gaynor
055631d7f7 Fix to handle multiple instances of @pytest.mark_requires_backend_interface 2014-10-23 11:25:51 -07:00
Alex Gaynor
7aab8b4ae4 Change how we represented that a test requires a backend.
This way is more extensible and requires less maintaince
2014-10-23 11:01:25 -07:00
Alex Gaynor
e53677a149 fixes 2014-09-08 12:43:02 -07:00
Alex Stapleton
e47bafb9b6 ECDSA backend 2014-06-07 19:04:27 +01:00
Alex Stapleton
00c580cca9 Add pkcs8_serialization mark 2014-05-27 21:50:30 +01:00
Alex Stapleton
458c09bdb2 Rename OpenSSLSerializationBackend 2014-04-25 21:30:57 +01:00
Ayrx
3f695110b2 Fix pep8 errors 2014-04-22 12:12:41 +08:00
Ayrx
b5bb0653b9 Added CMAC tests 2014-04-22 12:11:34 +08:00
Mohammed Attia
97c27c698d Add DSABackend 2014-04-04 19:15:07 +02:00
Paul Kehrer
afc1ccdcc8 import order fixes for future automated checking 2014-03-19 11:49:32 -04:00
Alex Stapleton
01de3ef02b s/available_backends/_available_backends/ 2014-03-16 16:42:47 +00:00
Alex Stapleton
24dc98c7fd Fix circular imports with available_backends() 2014-03-16 16:32:50 +00:00