https://bugzilla.redhat.com/show_bug.cgi?id=2264507
--- Comment #3 from Petr Pisar <ppisar(a)redhat.com> ---
The crashing test can be reduced to:
#!/usr/bin/perl
use strict;
use warnings;
use File::Spec;
use File::Temp qw(tempfile);
use Test::More;
my ($key, $crt);
do {
my $OPENSSL = '/usr/bin/openssl';
my ($conf_fh, $conf_file) = tempfile(UNLINK => 1);
print {$conf_fh} <<'EOF';
[ req ]
distinguished_name = req_distinguished_name
attributes = req_attributes
prompt = no
[ req_distinguished_name ]
C = AU
ST = Some-State
L = Test Locality
O = Organization Name
OU = Organizational Unit Name
CN = Common Name
emailAddress = test(a)email.address
[ req_attributes ]
EOF
close $conf_fh;
my $DEVNULL = File::Spec->devnull();
my (undef, $key_file) = tempfile(UNLINK => 1);
my (undef, $csr_file) = tempfile(UNLINK => 1);
my (undef, $crt_file) = tempfile(UNLINK => 1);
system(qq{$OPENSSL genrsa -out $key_file >$DEVNULL 2>&1}) and die $!;
system(qq{$OPENSSL req -new -key $key_file -out $csr_file -config
$conf_file >$DEVNULL 2>&1}) and die $!;
system(qq{$OPENSSL x509 -in $csr_file -out $crt_file -req -signkey
$key_file -set_serial 1 >$DEVNULL 2>&1}) and die $!;
$key = do {
local $/;
open my $fh, '<', $key_file or die $!;
scalar <$fh>;
};
$crt = do {
local $/;
open my $fh, '<', $crt_file or die $!;
scalar <$fh>;
};
};
my $plain = q{From: alice(a)example.org
To: bob(a)example.org
Subject: Crypt::SMIME test
This is a test mail. Please ignore...
};
$plain =~ s/\r?\n|\r/\r\n/g;
# -----------------------------------------------------------------------------
plan tests => 5;
use Crypt::SMIME;
my $smime = Crypt::SMIME->new();
ok($smime->setPrivateKey($key, $crt), 'Set an untainted keypair');
ok($smime->setPublicKey($crt), 'Set a tainted public key');
ok($smime->sign($plain), 'Sign an untainted message');
ok(eval {$smime->setPublicKeyStore()}, 'Load the default public key store');
ok($smime->sign($plain), 'Sign an untainted message');
--
You are receiving this mail because:
You are on the CC list for the bug.
https://bugzilla.redhat.com/show_bug.cgi?id=2264507
Report this comment as SPAM:
https://bugzilla.redhat.com/enter_bug.cgi?product=Bugzilla&format=rep...