Unverified Commit 5183d929 authored by IKEDA Soji's avatar IKEDA Soji Committed by GitHub
Browse files

Merge pull request #1112 from ikedas/issue-1110 by ikedas

bulk.pl daemon crashes if it failed to load private key (#1110)
parents 16222846 4088157e
......@@ -1236,9 +1236,17 @@ sub smime_sign {
my $smime = Crypt::SMIME->new();
#FIXME: Add intermediate CA certificates if any.
if (length $key_passwd) {
$smime->setPrivateKey($key, $cert, $key_passwd);
unless (eval { $smime->setPrivateKey($key, $cert, $key_passwd) }) {
$log->syslog('err', 'Unable to S/MIME sign message: %s',
$EVAL_ERROR);
return undef;
}
} else {
$smime->setPrivateKey($key, $cert);
unless (eval { $smime->setPrivateKey($key, $cert) }) {
$log->syslog('err', 'Unable to S/MIME sign message: %s',
$EVAL_ERROR);
return undef;
}
}
my $msg_string = eval {
$smime->sign($dup_head->as_string . "\n" . $self->body_as_string);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment