Debian Codegraph @

Changes

raw
1 Revision history for Perl extension Crypt::OpenSSL::RSA.
2
3 0.41 Apr 24 2026
4
5 [Bug Fixes]
6 - PR #181: Skip OpenSSL 3.x-specific tests on LibreSSL. LibreSSL
7 reports version >= 3.0 via Crypt::OpenSSL::Guess's openssl_version()
8 but internally uses the pre-3.x code path
9 (OPENSSL_VERSION_NUMBER < 0x30000000L), causing two CPAN Testers
10 failures on OpenBSD: t/padding.t (use_sslv23_padding is still a
11 valid XS function on LibreSSL because RSA_SSLV23_PADDING exists)
12 and t/pkcs1_sign.t (RSA_verify on pre-3.x/LibreSSL ignores the
13 padding mode, so cross-padding verification succeeds). LibreSSL
14 is now detected by parsing `openssl version` output for the
15 "LibreSSL" string, using find_openssl_exec(find_openssl_prefix())
16 from Crypt::OpenSSL::Guess to locate the correct binary. The
17 earlier approach of detecting LibreSSL via an undefined patch
18 level was not reliable.
19
20 0.39 Apr 23 2026
21
22 [Bug Fixes]
23 - PR #171 GH #170: Fix macOS compile warnings. The OLD_CRUFTY_SSL_VERSION
24 macro used defined() inside a #define (undefined behavior when expanded
25 in #if directives); split into #ifdef/#else branches. Also cast
26 SvPV_nolen() result to UNSIGNED_CHAR* to silence the pointer-sign
27 mismatch in _load_rsa_key().
28 - PR #173: Reject non-RSA keys (EC, DSA, etc.) in _new_public_key_x509_der()
29 on OpenSSL 3.x. d2i_PUBKEY_bio() accepts any key type, unlike pre-3.x
30 d2i_RSA_PUBKEY_bio(); without validation a non-RSA DER key would be
31 stored in the rsaData struct and produce confusing failures later.
32 - PR #177: Check padding compatibility before message length in
33 private_encrypt() and public_decrypt(). Previously, calling these with
34 the default OAEP padding (or PSS) produced a misleading "plaintext too
35 long" error that hid the real issue (OAEP/PSS are fundamentally
36 incompatible with private_encrypt/public_decrypt). The clear
37 "OAEP/PSS padding is not supported" error is now emitted regardless of
38 data size, and the rejection extends to pre-3.x OpenSSL (previously
39 only checked on 3.x inside rsa_crypt()).
40 - PR #178: Validate key size in generate_key() before calling OpenSSL.
41 Reject negative, zero, and sub-512-bit key sizes with a clear croak
42 instead of letting OpenSSL produce cryptic errors or hang.
43 - PR #179 GH #174: Restore the lost configure_requires prereq on
44 Crypt::OpenSSL::Guess in Makefile.PL.
45 - PR #179 GH #175: Fix failing test 'Padding method pkcs1_pss is valid
46 for signing with ripemd160'.
47
48 [Improvements]
49 - PR #180: Add optional passphrase argument to new_private_key_der(),
50 enabling decryption of encrypted PKCS#8 DER (EncryptedPrivateKeyInfo)
51 private keys. On OpenSSL 3.x the passphrase is passed to the existing
52 OSSL_DECODER_CTX; on pre-3.x a d2i_PKCS8PrivateKey_bio() helper is
53 used. Previously only PEM-encoded keys supported a passphrase.
54
55 [Maintenance]
56 - PR #172: Fix 'passphase' -> 'passphrase' typo throughout the codebase
57 (RSA.xs internal names, RSA.pm POD for get_private_key_string, and the
58 test variable in t/format.t). The typo dates to the original 0.33
59 passphrase support. No functional change -- all renames are internal.
60
61 0.38 Apr 23 2026
62
63 [Bug Fixes]
64 - PR #103 GH #61: Re-enable PKCS#1 v1.5 padding for sign()/verify(). It
65 was incorrectly disabled in 0.35; the Marvin attack only affects
66 decryption, not signatures.
67 - PR #168: Fix croak message to reference use_pkcs1_oaep_padding() (not
68 use_pkcs1_padding()) when non-OAEP padding is used for encrypt/decrypt.
69 - PR #165: Fix OAEP overhead calculation that was hardcoded for SHA-1;
70 correct overhead is now computed per the configured hash algorithm.
71 - PR #141: Reject non-RSA keys (EC, DSA, RSA-PSS) loaded via
72 _load_rsa_key() on OpenSSL 3.x with a clear error instead of a
73 confusing failure later.
74 - PR #118: Fix private_encrypt() and public_decrypt() broken on OpenSSL
75 3.x with any padding except NO_PADDING; rsa_crypt() now distinguishes
76 encrypt vs. sign paths.
77 - PR #142: Free signature buffer on RSA_sign() failure on pre-3.x.
78 - PR #164 GH #152: Drain OpenSSL error queue after _get_key_parameters()
79 on OpenSSL 3.x so a failed optional-param lookup does not pollute the
80 error queue for subsequent operations.
81 - PR #161 GH #152: Cache is_private_key flag in rsaData struct to avoid a
82 per-call BIGNUM heap allocation on OpenSSL 3.x.
83 - PR #159 GH #155: Check return values of EVP_PKEY_get_bn_param() in
84 _get_key_parameters(); a failed mandatory param (n or e) now croaks
85 instead of silently returning undef.
86 - PR #160 GH #156: Use THROW macro for make_rsa_obj() result in
87 _new_key_from_parameters() to prevent resource leak on a NULL return.
88 - PR #158 GH #154: Extract setup_pss_sign_ctx() helper to deduplicate
89 PSS context setup in sign() and verify(); the two paths could previously
90 diverge silently.
91 - PR #157 GH #153: Eliminate duplicate NID-to-name table in
92 get_message_digest(); fixes whirlpool on OpenSSL 3.x where the old
93 low-level WHIRLPOOL() API path was being used instead of EVP_MD_fetch().
94 - PR #145: Fix BIO resource leak in extractBioString() error paths.
95 - PR #143: Validate that a private key is present before attempting export
96 in get_private_key_string().
97 - PR #140: NULL out BIGNUMs after freeing them in _new_key_from_parameters()
98 to prevent a double-free when make_rsa_obj() fails after they are freed.
99 - PR #137: Use BN_clear_free() (instead of BN_free()) for private key
100 BIGNUMs in _get_key_parameters() to scrub sensitive material.
101 - PR #136: Remove static buffer in get_message_digest() that caused
102 thread-safety problems under Perl ithreads.
103 - PR #134: Add Perl-level stub for use_sslv23_padding() on OpenSSL 3.x
104 where the underlying RSA_SSLV23_PADDING constant was removed.
105 - PR #133: Fix PSS MGF1 setup to inspect the correct padding fields
106 (sign_pad/verify_pad) instead of p_rsa->padding, preventing wrong
107 MGF1 hash on auto-promoted PSS operations.
108 - PR #120: Check PEM_write_bio_* return values in key export functions
109 so failures are reported rather than silently ignored.
110 - PR #119: Migrate SHA* digest calls to EVP_Q_digest() on OpenSSL 3.x,
111 replacing deprecated low-level SHA*() functions.
112 - PR #109: Drain the full OpenSSL error queue in croakSsl() and report
113 the last (most specific) error rather than the oldest one.
114 - PR #104: Guard croakSsl() against a NULL error string from
115 ERR_reason_error_string() to prevent a NULL-deref croak.
116 - PR #76: Do not include whrlpool.h when whirlpool support is disabled.
117 - Memory leak fixes across OpenSSL 3.x code paths (PR #75, PR #77, PR #78,
118 PR #79, PR #80, PR #81, PR #83, PR #87, PR #90, PR #99, PR #101, PR #108,
119 PR #112, PR #114, PR #127, PR #128, PR #129, PR #131): plugged leaks in
120 generate_key(), sign(), verify(), rsa_crypt(), check_key(),
121 get_public_key_string(), _new_key_from_parameters(), and
122 _get_key_parameters() across success and error paths.
123
124 [Improvements]
125 - PR #169: Make Crypt::OpenSSL::Bignum a hard runtime requirement (moved
126 from recommended to required in Makefile.PL and added hard import in
127 RSA.pm); it was already required in practice for get_key_parameters().
128 - PR #126: new_public_key() now accepts DER-encoded public keys in addition
129 to PEM; format is detected automatically via ASN.1 OID inspection.
130 - PR #124: Add get_private_key_pkcs8_string() to export private keys in
131 PKCS#8 PEM format.
132 - PR #110: Add get_public_key_pkcs1_string() as an alias for
133 get_public_key_string() for API symmetry with the X.509/PKCS#1 naming.
134 - PR #111: Add optional check=>1 parameter to new_key_from_parameters()
135 to validate the constructed key via check_key() before returning it.
136 - PR #135: Add plaintext length pre-validation in rsa_crypt() with a
137 descriptive croak before attempting the OpenSSL operation.
138 - PR #151: Reject invalid (even-numbered) RSA exponents before passing
139 them to OpenSSL, preventing a potential hang during key generation.
140
141 [Maintenance]
142 - PR #163: Add CONTRIBUTING.md and SECURITY.md to satisfy CPANTS
143 experimental kwalitee metrics.
144 - PR #144: Clean up Makefile.PL metadata: remove dead -DPERL5 and
145 -DOPENSSL_NO_KRB5 defines; derive version dynamically from RSA.pm.
146 - PR #130: Add test coverage for generate_key() with custom public
147 exponents and exponent validation.
148 - PR #121: Add test coverage for private_encrypt() and public_decrypt().
149 - PR #148: Add PKCS#1 v1.5 signing regression tests (PR #148).
150 - PR #95: Add error-path and edge-case test coverage (t/error.t).
151 - PR #115, PR #116: Add encrypt/decrypt and sign/verify edge-case tests.
152 - PR #85, PR #86, PR #88, PR #91: Improve test assertions — replace bare
153 ok() calls with is()/like() and add descriptive test names throughout.
154 - PR #84: Add macOS CI job covering both system LibreSSL and Homebrew
155 OpenSSL 3.x.
156 - PR #123: Add Valgrind memory-leak detection CI job on Debian bookworm.
157 - PR #73: Fix META URLs, remove duplicate .gitignore entries, fix
158 build_requires; add Debian trixie (OpenSSL 3.4.x) to CI matrix.
159 - PR #72: Bump actions/checkout from v4 to v6.
160 - PR #82: Bump perl-actions/perl-versions from 1 to 2.
161 - PR #70: Add Dependabot for automatic GitHub Actions version updates.
162 - PR #69: Remove Debian buster from CI matrix (EOL).
163
164 0.37 Oct 29 2025
165 - Fix libressl bitwise logic error in RSA.xs
166
167 0.36 Oct 29 2025
168 - Fix old openssl on strawberry does not include whrlpool.h
169 - libressl message digest functions md cannot be NULL
170 - Don't support whirlpool in libressl
171 - Add support for use_pkcs1_pss_padding with fatal error if RSA-PSS is used for encryption operations
172
173 0.35 May 7 2025
174 - Disable PKCS#1 v1.5 padding. It's not practical to mitigate marvin attacks so we will instead disable this and require alternatives to address the issue.
175 - Resolves #42 - CVE-2024-2467.
176
177 0.34 May 5 2025
178 - Production release.
179
180 0.34_03 May 4 2025
181 - Fix bug in rsa_crypt. Need to pass NULL
182
183 0.34_02 May 4 2025
184 - t/rsa.t needs to tolerate sha1 being disabled on rhel.
185
186 0.34_01 May 3 2025
187 - docs - plaintext = decrypt(cyphertext)
188 - #44 - Fix issue when libz is not linked on AIX
189 - #50 - Correct openssl version may not be found
190 - #52 - Out of memory on openssl 1.1.1w hpux
191 - #47 - Update FSF address and LGPL name in LICENSE
192 - #55 - stop using AutoLoader
193 - #48 - Whirlpool is missing the header
194 - Move github repo to cpan-authors
195 - Fully support openSSL 3.x API
196
197 0.33 July 7 2022
198 - Update for windows github CI
199 - Remove duplicit 'LICENSE' key
200 - Remove EUMM Remove version check
201 - #31 by removing reference to RSA_SSLV23_PADDING (removed from OpenSSL starting from v3.0.0)
202 - support passphase protected private key load
203 - fix 'unsupported encryption' error on old library versions
204 - Clarify croak message for missing passphrase on older cyphers
205 - More structs opaqued in LibreSSL 3.5
206 - Use a macro for dealing with older SSL lacking macros
207 - more CI fixups. Drop testing for 5.10 and 5.8. Something is broken upstream.
208
209 0.32 Wed Sep 8 2021
210 - Prefix internal bn2sv function so it doesn't collide with Net::SSLeay
211 - Ensure that verify() leaves openssl error stack clean on failure
212 - Fixed broken SEE ALSO links.
213 - prevent outer $SIG{__DIE__} handler from being called during optional require.
214 - omit done_testing since it does not work for older perl versions
215
216 0.31 Mon Sep 24 2018
217 - Remove default of SHA256 for RSA keys. This has caused significant
218 problems with downstream modules and it has always been possible to
219 do $key->use_sha256_hash()
220
221 0.30 Tue May 1 2018
222 - Working windows library detection
223 - Actively testing on appveyor for windows now.
224 - work correctly on LibreSSL
225
226 0.29_03 Mon Apr 16 2018
227 - Add whirlpool hash support.
228 - Crypt::OpenSSL::Random is now required at comnpile-time.
229 - Use the new interface to RSA_generate_key if available
230 - Add library paths to LIBS from Crypt::OpenSSL::Guess
231
232 0.29_02 Sun Apr 15 2018
233 - Add missing require of Config::OpenSSL::Guess
234
235 0.29_01 Fri Apr 13 2018
236 - Adapt to OpenSSL 1.1.0 (dur-randir)
237 - Move issue tracker to github.
238 - Modernization as in Crypt::OpenSSL::Random.
239 - better MSWin32 hints, fixes MSVC libraries,
240 - more meta tests,
241 - prefer hash mode NID_sha256 over NID_sha1 for sign
242
243 0.28 Thu Aug 25 2011 - Moritz Onken (PERLER)
244 - RT 56454 - Win32 compatibility patch ([email protected])
245
246 0.27 Wed Jun 29 2011 - Todd Rinaldo (TODDR)
247 - RT 65947 - Fix RSA.pm break with perl 5.14+
248
249 0.26 Sun Nov 22 2009 11:01:13
250 - Change subclassing test to generate a 512 bit key in order to work
251 around an odd issue seen on some 64-bit redhat systems. (CPAN bug 45498)
252
253 0.25 Sun May 20 2007 12:56:11
254 - Add a LICENSE file.
255 - Fix a bug (reported by many) in rsa.t - we were incorrectly counting
256 the number of tests in situations where use_sha512_hash was
257 not available.
258
259 0.24 Mon Nov 13 2006 08:21:14
260 - Fix a bug reported by Mark Martinec <[email protected]>
261 where encrypt could segfault if called with insufficient
262 data; it now informatively croaks instead.
263 - Fix a bug reported by Mark Martinec where check_key would
264 segfault instead of croaking when called on a public key.
265 - Fix decrypt and private_encrypt to croak instead of segfault when
266 called on a public key.
267 - Add an is_private method.
268 - Silence a few compiler warnings about ignoring return values
269 from certain BIO_* methods.
270
271 0.23 Wed Apr 12 2006 00:06:10
272 - Provide 32 bytes of seeding in tests, up from 19.
273 - Stop relying on implicit includes, which disappeared in the 0.98
274 release of OpenSSL.
275 - Apply patch from Jim Radford <[email protected]> to add support
276 for SHA{224,256,384,512}
277
278 0.22 Mon Nov 15 2005 21:13:20
279 - Add public_decrypt, private_encrypt methods, contributed
280 by Paul G. Weiss <[email protected]>
281 - Some changes to help builds on Redhat9
282 - Remove deprecated methods:
283 * the no-arg new constructor - use new_from_public_key,
284 new_from_private_key or Crypt::OpenSSL::RSA->generate_key instead
285 * load_public_key - use new_from_public_key
286 * load_private_key - use new_from_private_key
287 * generate_key as an instance method - use it as a class constructor
288 method instead.
289 * set_padding_mode - use use_no_padding, use_pkcs1_padding,
290 use_pkcs1_oaep_padding, or use_sslv23_padding instead.
291 * get_padding_mode
292 - Eliminate all(most all) memory leaks.
293 - fix email address
294 - Stop returning true from methods just to indicate success.
295 - Change default public exponent from 65535 to 65537
296
297
298 0.21 Sun Feb 15 2004 21:13:45
299 - Include t/format.t in the MANIFEST file, so that it is
300 actually included in the distribution.
301
302 0.20 Sun Feb 15 2004 15:21:40
303 - Finally add support for the public key format produced by
304 "openssl rsa -pubout".
305 - Add comment in readme about locating kerberos files on redhat systems
306
307 0.19 Sun Apr 27 2003 18:33:48
308 - Revert back to old declaration style so that we no longer
309 break under perl 5.005 (spotted by Rob Brown <[email protected]>).
310 - Add some needed use statements in legacy.t and rsa.t (patch
311 submitted by Rob Brown).
312 - Fix typo in docs spotted by Daniel Drown <[email protected]>
313 - Update copyright dates.
314
315 0.18 Sun Feb 23 2003 20:44:35
316 - Add two new methods, new_key_from_parameters and
317 get_key_parameters, which, working with
318 Crypt::OpenSSL::Bignum, allow working directly with the
319 paramaters of an rsa key.
320
321 0.17 Mon Jan 06 2003 22:43:31
322 - Workaround for gcc 3.2 compile problems:
323 "/usr/include/openssl/des.h:193: parse error before '&' token"
324 (Patch by Rob Brown <[email protected]>)
325 - Deprecate no-arg constructor, load_*_key methods and the
326 instance method generate_key; switch to three constructors:
327 new_public_key, new_private_key and generate_key (as a class
328 method)
329 - Deprecate set_padding_mode method; replace with
330 use_xxx_padding.
331 - move tests into t directory, use Test as a framework
332
333 0.16 Tue Jun 11 22:01:45
334 - Fix bug reported by Rob McMillin <[email protected]> which
335 prevented subclassing.
336
337 0.15 Fri Jun 07 09:13:12
338 - Fix two bugs reported by Gordon Lack <[email protected]>: use
339 IV, not I32, for pointers, and cast the right-hand, not
340 left-hand, value when doing an assignment from an SV to an HV
341
342 0.14 Sun May 19 12:35:21
343 - Fix bug reported by Charles Jardine <[email protected]>: use
344 Safefree, not free, to release memory allocated by New
345
346 0.13 Thu Mar 21 00:10:30
347 - Incorporating patch from Matthias Bauer
348 <[email protected]>, which provides
349 signing and verification, as well as uses OpenSSL's internal
350 error reporting system. This patch also fixes a bug with the
351 RSA_NO_PADDING_MODE. Thanks, Matthias!
352 - Deprecate set_padding_mode in favor of use_xxx_padding.
353 - Rather than returning true on success, false on failure, just
354 croak when there are problems.
355 - Plug memory leaks.
356 - Fix my email address (it's cpan.org, not cpan.com)
357
358 0.12 Thu Sep 06 22:44:17
359 - Fixing bug with Crypt::OpenSSL::Random interoperability
360 - Implementing patch from Thomas Linden <[email protected]>
361 fixing a keysize bug
362 - Fixing email address in docs.
363
364 0.11 Tue Apr 10 22:45:31
365 - Fixing bug in test.pl.
366
367 0.10 Mon Apr 09 18:25:41
368 - Moving random routines into Crypt::OpenSSL::Random
369 - Use New instead of malloc
370
371 0.09 Mon Apr 02 12:27:10
372 - Typo fix, and always exercise test random_seed in testing.
373
374 0.08 Sun Apr 01 23:04:31
375 - Changing method names to match convention
376
377 0.07 Thu Mar 08 3:31:41 2001
378 - Allow seeding of the PRNG
379
380 0.06 Thu Mar 08 12:40:04 2001
381 - Adding a readme file.
382
383 0.05 Mon Feb 26 10:50:43 2001
384 - Removing signing and verification, due to bizarre bugs
385
386 0.04 Fri Feb 23 10:41:33 2001
387 - Removing Base64 functionality and dependence
388
389 0.01 Wed Feb 14 11:21:42 2001
390 - original version; created by h2xs 1.19