Skip OpenSSL 3.x-specific tests on LibreSSL#181
Merged
timlegge merged 2 commits intocpan-authors:mainfrom Apr 24, 2026
Merged
Conversation
LibreSSL reports version >= 3.0 via openssl_version() but uses the pre-3.x code path (OPENSSL_VERSION_NUMBER < 0x30000000L). This caused two test failures on OpenBSD: - t/padding.t: use_sslv23_padding is a valid XS function on LibreSSL (RSA_SSLV23_PADDING still exists) so it does not croak - t/pkcs1_sign.t: RSA_verify on pre-3.x/LibreSSL ignores the padding mode setting, so cross-padding verification succeeds Detect LibreSSL via the third return value of openssl_version() which is undef for LibreSSL (no letter suffix) and defined for OpenSSL. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
timlegge
reviewed
Apr 23, 2026
| # sslv23 is unsupported on OpenSSL 3.x | ||
| # sslv23 is unsupported on OpenSSL 3.x but LibreSSL still supports it | ||
| # openssl_version() returns undef for the third element on LibreSSL | ||
| my $is_libressl = !defined $patch; |
Member
There was a problem hiding this comment.
I don't think the lack of a patch level is indicative of it being libressl
Member
|
@toddr-bot rebase |
Changes look good. Here's the summary: - Replaced `!defined $patch` LibreSSL detection with explicit `openssl version` output check for "LibreSSL" string, per @timlegge's review that the lack of a patch level is not reliably indicative of LibreSSL - Used `find_openssl_exec(find_openssl_prefix())` from `Crypt::OpenSSL::Guess` to locate the correct OpenSSL binary (same approach the module uses internally) - Moved `$is_libressl` detection to the top of each file alongside other version detection, removed inline declarations and stale comments - Applied to both `t/padding.t` and `t/pkcs1_sign.t`
Contributor
Author
Rebase with requested adjustmentsBranch Changes applied
StatsActions performed
CI statusCI will be checked asynchronously. Automated by Kōan |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Skip two OpenSSL 3.x-specific tests that fail on LibreSSL (OpenBSD).
Why
CPAN Testers FAIL on OpenBSD 7.4 (Perl 5.36.1, LibreSSL 3.8.x).
Crypt::OpenSSL::Guess::openssl_version()returns$major="3.8"for LibreSSL, which satisfies the>= 3.0checks meant for real OpenSSL 3.x. But LibreSSL uses the pre-3.x code path internally (OPENSSL_VERSION_NUMBER < 0x30000000L), so:use_sslv23_paddingis a valid XS function (not the Perl croak stub)RSA_verifyignores the padding mode setting (no cross-padding rejection)How
Detect LibreSSL via the third return value of
openssl_version(), which isundeffor LibreSSL (no letter suffix in version string) and defined (""or a letter) for OpenSSL. Skip the two affected tests when LibreSSL is detected.Testing
Full test suite passes on OpenSSL 3.5 (619 tests). The SSLv23 croak test and cross-padding test still run correctly on real OpenSSL 3.x.
🤖 Generated with Claude Code
Quality Report
Changes: 2 files changed, 10 insertions(+), 5 deletions(-)
Code scan: clean
Tests: passed (OK)
Branch hygiene: clean
Generated by Kōan post-mission quality pipeline