cryptography/tests
Jake de8deb9e94
Enforce max number of SSH certificate principals (#8376)
* Enforce max number of SSH certificate principals

There is an undocumented limit for the maximum number of valid principals accepted by the openssh tooling, as seen at:
* 2726764269/sshkey.h (L108)
* 25c8a2bbcc/sshkey.c (L1801)
* 6180b0fa4f/ssh-keygen.c (L1833)

This change enforces that same restriction as currently a SSH certificate can be generated that is invalid against the default sshd server. Consideration might be given for any non openssh servers that accept openssh certificates, if they exist and want to allow a greater number of principals.

Of note, the 256 limit is not found in the spec for SSH certificates as defined at https://github.com/openssh/openssh-portable/blob/master/PROTOCOL.certkeys. It instead seems to be arbitrarily chosen by the project as some limit was needed.

* Address formatting error.

* Comment on valid_prinicpals size limit plus test added.

---------

Co-authored-by: Jake <jake@vaultish.com>
2023-02-23 07:03:47 -05:00
..
bench Use the ruff 'pyupgrade' checks (#8104) 2023-01-20 05:36:01 +08:00
hazmat Enforce max number of SSH certificate principals (#8376) 2023-02-23 07:03:47 -05:00
hypothesis Implement a parser for RFC4514 strings (#7055) 2022-04-16 10:21:45 +02:00
wycheproof add support for centos9-fips (#8216) 2023-02-06 16:42:54 +00:00
x509 Disallow wildcards in DNSName for name constraints (#8272) 2023-02-12 17:29:32 +00:00
__init__.py Remove __future__ import from our code (#5610) 2020-12-09 00:35:11 -06:00
conftest.py update to latest pytest-subtests and add the new flag (#8301) 2023-02-16 03:24:35 +00:00
deprecated_module.py refactor utils.deprecated to be more mypy friendly (#6923) 2022-03-03 03:46:30 +08:00
doubles.py type a test double (#6723) 2021-12-21 21:10:54 -05:00
test_cryptography_utils.py Update CI for py3.11 release (#7743) 2022-10-26 14:44:03 +09:00
test_fernet.py Switch from flake8 to ruff (#7920) 2022-12-21 09:44:47 +07:00
test_meta.py add some more mypy flags (#6751) 2021-12-23 07:55:23 -05:00
test_rust_utils.py Remove destroy from FixedPool (#7602) 2022-09-11 17:45:22 -05:00
test_utils.py Switch from flake8 to ruff (#7920) 2022-12-21 09:44:47 +07:00
test_warnings.py refactor utils.deprecated to be more mypy friendly (#6923) 2022-03-03 03:46:30 +08:00
utils.py Use the ruff 'pyupgrade' checks (#8104) 2023-01-20 05:36:01 +08:00