|
From: Søren K. <sq...@dt...> - 2025-08-25 09:25:14
|
Dear all.
I have recently run into a perculiar problem with RSA::XS:
OpenSSL crashes after exactly 508 encryptions (why 508 and not 512?):
It is reproducible 100% of the time with the following script on
multiple systems:
#!/usr/bin/perl
use strict;
use warnings;
use Crypt::OpenSSL::RSA;
my $rsa = Crypt::OpenSSL::RSA->generate_key(2048);
my $count = 0;
eval {
while (1)
{
my $msg = "Test $count";
$rsa->encrypt($msg);
$count++;
}
};
if ($@)
{
print $@.": Count: $count\n";
}
Output:
perl enc_test.pl
RSA.xs:338: OpenSSL error: (null) at enc_test.pl line 13.
: Count: 508
Additionally there is no error mssage or code from OpenSSL - just 'null'
which is extremely uninformative...
I have no idea what causes the issue and the problem was not there a
year ago.....
I'm running Ubuntu 24.04 fully upgraded:
lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 24.04.3 LTS
Release: 24.04
Codename: noble
--
Søren Koch
Senior Development Engineer
Mob: +45 21325247
sq...@dt...
Fysikvej
Building 310
2800 Kgs. Lyngby
|