test: generate_key() with custom exponents + fix MANIFEST#130
Conversation
|
@Koan-Bot Redhat (almalinux) has disabled sha1 please review the other tests to see what was done to not test sha1 on redhat |
|
@toddr-bot the alma9linux test is failing because of sha1 is disabled: The test should be something like: @toddr you may need to ping the bot |
|
@timlegge you have to address the right bot. it'd be @toddr-bot |
Summary of changes: - **Wrapped SHA1 hash tests in SKIP block with eval guard** in `t/keygen.t`: The SHA1 sign and verify operations in the "hash mode switching" section are now wrapped in `eval` and a `SKIP` block, so they are gracefully skipped on systems where SHA1 is disabled (e.g. AlmaLinux 9 / RHEL 9 with FIPS-like restrictions). This follows the same pattern used in `t/sign_verify.t`. Per reviewer @timlegge's feedback about the alma9linux CI failure.
7b07fdc to
7b9f45b
Compare
Rebase: test: generate_key() with custom exponents + fix MANIFESTBranch Diff: 2 files changed, 150 insertions(+) Review feedback was analyzed and applied. ChangesSummary of changes:
Actions
CICI still failing after 2 fix attempts. Last failure logsAutomated by Kōan |
|
@toddr-bot rebase |
Summary of changes: - **Wrapped SHA1 hash tests in SKIP block with eval guard** in `t/keygen.t`: The SHA1 sign and verify operations in the "hash mode switching" section are now wrapped in `eval` and a `SKIP` block, so they are gracefully skipped on systems where SHA1 is disabled (e.g. AlmaLinux 9 / RHEL 9 with FIPS-like restrictions). This follows the same pattern used in `t/sign_verify.t`. Per reviewer @timlegge's feedback about the alma9linux CI failure.
da08dd5 to
a71204a
Compare
All changes applied. Here's a summary: - **Changed all key sizes from 1024-bit to 2048-bit** in `t/keygen.t` per reviewer @timlegge's suggested code: `generate_key(1024, ...)` → `generate_key(2048, ...)` for all exponent tests (65537, 3, 17, 257) and invalid exponent tests (2, 1). Updated the size assertion from `128` to `256` bytes accordingly. - **Removed the comment block** (lines 19-22) explaining the rationale for using 1024-bit keys, since 2048-bit keys are now used throughout. - The SHA1 SKIP handling was already in place and matches the pattern used in other test files (`sign_verify.t`), so no changes needed there.
Rebase: test: generate_key() with custom exponents + fix MANIFESTBranch Diff: 2 files changed, 143 insertions(+) Review feedback was analyzed and applied. ChangesAll changes applied. Here's a summary:
Actions
CICI still failing after 2 fix attempts. Last failure logsAutomated by Kōan |
|
@toddr-bot rebase from main |
Exercise the explicit exponent parameter of generate_key() which was previously untested — only the default 65537 was ever used. Tests cover: - Valid exponents: 3, 17, 257, 65537 (explicit) - Invalid exponents: 1, 2 (even) — rejected by OpenSSL - Exponent value verification via get_key_parameters() - Key usability (sign/verify, encrypt/decrypt) with non-default exponents - Key object resilience after caught errors - Hash mode switching on a single key object Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
check_param.t, crypto.t, error_queue.t, key_lifecycle.t, keygen.t, padding.t, private_crypt.t, and sign_verify.t were all present in t/ but missing from MANIFEST. This would cause them to be excluded from the distribution tarball. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Summary of changes: - **Wrapped SHA1 hash tests in SKIP block with eval guard** in `t/keygen.t`: The SHA1 sign and verify operations in the "hash mode switching" section are now wrapped in `eval` and a `SKIP` block, so they are gracefully skipped on systems where SHA1 is disabled (e.g. AlmaLinux 9 / RHEL 9 with FIPS-like restrictions). This follows the same pattern used in `t/sign_verify.t`. Per reviewer @timlegge's feedback about the alma9linux CI failure.
All changes applied. Here's a summary: - **Changed all key sizes from 1024-bit to 2048-bit** in `t/keygen.t` per reviewer @timlegge's suggested code: `generate_key(1024, ...)` → `generate_key(2048, ...)` for all exponent tests (65537, 3, 17, 257) and invalid exponent tests (2, 1). Updated the size assertion from `128` to `256` bytes accordingly. - **Removed the comment block** (lines 19-22) explaining the rationale for using 1024-bit keys, since 2048-bit keys are now used throughout. - The SHA1 SKIP handling was already in place and matches the pattern used in other test files (`sign_verify.t`), so no changes needed there.
That's the key change. The SHA1 handling already has proper SKIP blocks with eval guards — the `use_sha1_hash()` call just sets a mode flag and doesn't fail, while the actual `sign()` call is wrapped in eval with a skip on failure, which correctly handles AlmaLinux 9's SHA1 restriction. **Summary of changes:** - **Changed RSA key size from 1024 to 2048 bits in `t/keygen.t`** per reviewer @timlegge's feedback: AlmaLinux 9 (and other FIPS-like systems) enforce a minimum 2048-bit RSA key size via crypto policy, causing test failures with 1024-bit keys. The SHA1 SKIP blocks were already correctly guarded with eval.
Rebase: test: generate_key() with custom exponents + fix MANIFESTBranch Diff: 2 files changed, 164 insertions(+) Review feedback was analyzed and applied. ChangesThat's the key change. The SHA1 handling already has proper SKIP blocks with eval guards — the Summary of changes:
Actions
CICI will be checked asynchronously. Automated by Kōan |
aec415d to
c6af6b3
Compare
What
Add test coverage for
generate_key()with explicit exponent parameter, and fix 8 test files missing from MANIFEST.Why
The exponent parameter was completely untested — every existing test used the default 65537. Custom exponents (3, 17, 257) exercise different OpenSSL key generation paths and are used in real-world applications. The MANIFEST gap meant these tests would be excluded from CPAN distribution tarballs.
How
t/keygen.t(24 tests): valid exponents (3, 17, 257, 65537), invalid exponents (1, 2), exponent value verification viaget_key_parameters(), key usability with non-default exponents, key object resilience after caught errors, and hash mode switching.Testing
Full suite: 522 tests pass (498 existing + 24 new).
🤖 Generated with Claude Code
Quality Report
Changes: 2 files changed, 145 insertions(+)
Code scan: clean
Tests: passed (OK)
Branch hygiene: clean
Generated by Kōan post-mission quality pipeline