Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Projets publics
Sympa
Commits
80d4d291
Commit
80d4d291
authored
Feb 04, 2021
by
IKEDA Soji
Browse files
bulk.pl daemon crashes if it failed to load private key (#1110)
There is also a case with public key.
parent
3a644d49
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/lib/Sympa/Message.pm
View file @
80d4d291
...
...
@@ -962,7 +962,11 @@ sub smime_encrypt {
# encrypt the incoming message parse it.
my
$smime
=
Crypt::
SMIME
->
new
();
#FIXME: Add intermediate CA certificates if any.
$smime
->
setPublicKey
(
$cert
);
unless
(
eval
{
$smime
->
setPublicKey
(
$cert
)
})
{
$log
->
syslog
('
err
',
'
Unable to S/MIME encrypt message: %s
',
$EVAL_ERROR
);
return
undef
;
}
# don't; cf RFC2633 3.1. netscape 4.7 at least can't parse encrypted
# stuff that contains a whole header again... since MIME::Tools has
...
...
@@ -1055,9 +1059,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
);
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment