Skip to content

fix: clear deprecation message for use_sslv23_padding on 3.x#134

Merged
timlegge merged 1 commit into
cpan-authors:mainfrom
atoomic:koan.atoomic/sslv23-deprecation-stub
Mar 22, 2026
Merged

fix: clear deprecation message for use_sslv23_padding on 3.x#134
timlegge merged 1 commit into
cpan-authors:mainfrom
atoomic:koan.atoomic/sslv23-deprecation-stub

Conversation

@Koan-Bot
Copy link
Copy Markdown
Contributor

@Koan-Bot Koan-Bot commented Mar 21, 2026

What

Add a Perl-level stub for use_sslv23_padding() that croaks with a clear
deprecation message on OpenSSL 3.x.

Why

The XS implementation is compiled out by #if OPENSSL_VERSION_NUMBER < 0x30000000L
(RSA.xs:1085-1093). On 3.x, callers get a confusing "Can't locate object method"
error instead of anything actionable.

How

After XSLoader runs, check if use_sslv23_padding was defined by XS. If not,
install a Perl sub that croaks with a message explaining the removal and suggesting
use_pkcs1_oaep_padding() or use_pkcs1_pss_padding() as alternatives.

Pre-3.x builds are unaffected — the XS function takes precedence.

Testing

  • padding.t: added assertion that the error message contains "SSLv23 padding was removed"
  • Full suite: 463 tests pass (OpenSSL 3.6.1, macOS)

🤖 Generated with Claude Code


Quality Report

Changes: 2 files changed, 17 insertions(+), 4 deletions(-)

Code scan: clean

Tests: passed (OK)

Branch hygiene: clean

Generated by Kōan post-mission quality pipeline

On OpenSSL 3.x, the XS implementation of use_sslv23_padding() is
compiled out by a preprocessor guard (#if OPENSSL_VERSION_NUMBER <
0x30000000L). This left callers with a confusing "Can't locate
object method" error instead of a helpful message.

Add a Perl-level fallback that croaks with a clear deprecation
message explaining SSLv23 padding was removed and suggesting
use_pkcs1_oaep_padding() or use_pkcs1_pss_padding() as alternatives.

The stub is only installed when the XS function is absent (pre-3.x
builds retain the native implementation). Updated padding.t to
verify the error message content.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@atoomic atoomic requested a review from toddr-bot March 21, 2026 06:12
Copy link
Copy Markdown
Collaborator

@atoomic atoomic left a comment

Choose a reason for hiding this comment

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

LGTM

@atoomic atoomic marked this pull request as ready for review March 21, 2026 06:37
@atoomic atoomic requested a review from timlegge March 21, 2026 06:38
@timlegge timlegge merged commit 2349ee0 into cpan-authors:main Mar 22, 2026
28 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.

3 participants