mirror of
https://github.com/saymrwulf/cryptography.git
synced 2026-05-14 20:37:55 +00:00
* 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>
17 lines
515 B
Python
17 lines
515 B
Python
from ..utils import load_wycheproof_tests
|
|
|
|
|
|
def wycheproof_tests(*paths):
|
|
def wrapper(func):
|
|
def run_wycheproof(backend, subtests, pytestconfig):
|
|
wycheproof_root = pytestconfig.getoption(
|
|
"--wycheproof-root", skip=True
|
|
)
|
|
for path in paths:
|
|
for test in load_wycheproof_tests(wycheproof_root, path):
|
|
with subtests.test():
|
|
func(backend, test)
|
|
|
|
return run_wycheproof
|
|
|
|
return wrapper
|