Skip to content

tests: Try to not fail negative key tests if support is not there#1605

Merged
jku merged 1 commit into
sigstore:mainfrom
jku:safer-crypto-tests
Nov 6, 2025
Merged

tests: Try to not fail negative key tests if support is not there#1605
jku merged 1 commit into
sigstore:mainfrom
jku:safer-crypto-tests

Conversation

@jku

@jku jku commented Nov 6, 2025

Copy link
Copy Markdown
Member

We want to test the _get_key_details() with some unexpected cryptographic material, but we don't want the test suite to fail while collecting tests if cryptography itself does not support these keys (since we're only testing failure cases here).

Delay the key generation code with a lambda so we can handle cryptography exception and skip the test in these negative tests.


I decided to jump through the hoops of skipping instead of just removing the problematic SECT163 curve -- we don't care about SECT163 as such but I figured it's good to test at least one "unsupported ec curve"

fixes #1603

We want to test the _get_key_details() with some unexpected
cryptographic material, but we don't want the test suite to fail
while collecting tests if cryptography itself does not support
these keys (since we're only testing failure cases here).

Delay the key generation code with a lambda so we can handle
cryptography exception and skip the test in these negative tests.

Signed-off-by: Jussi Kukkonen <jkukkonen@google.com>
@jku jku force-pushed the safer-crypto-tests branch from eed1143 to 49ff3d9 Compare November 6, 2025 11:26

@di di left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice solution!

@jku jku merged commit da5a919 into sigstore:main Nov 6, 2025
42 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

FTBFS: test/unit/internal/test_key_details.py cryptography.exceptions.UnsupportedAlgorithm: Curve secp192r1 is not supported

2 participants