[Rt-commit] rt branch, smime, updated. rt-3.8.7-193-g37f3e55
Ruslan Zakirov
ruz at bestpractical.com
Fri Apr 16 18:00:11 EDT 2010
The branch, smime has been updated
via 37f3e55d95ef826354635d26bcbd5e7c2384813f (commit)
from 2676fa0e5a771b9e6abcb06f568c4aff07d55c4e (commit)
Summary of changes:
lib/RT/Crypt/SMIME.pm | 11 ++++++++---
1 files changed, 8 insertions(+), 3 deletions(-)
- Log -----------------------------------------------------------------
commit 37f3e55d95ef826354635d26bcbd5e7c2384813f
Author: Ruslan Zakirov <ruz at bestpractical.com>
Date: Sat Apr 17 01:59:36 2010 +0400
if passphrase is empty then we shouldn't use -passin
diff --git a/lib/RT/Crypt/SMIME.pm b/lib/RT/Crypt/SMIME.pm
index d292f5b..4ca9405 100644
--- a/lib/RT/Crypt/SMIME.pm
+++ b/lib/RT/Crypt/SMIME.pm
@@ -173,9 +173,12 @@ sub SignEncrypt {
unless defined $args{'Passphrase'};
push @command, join ' ', shell_quote(
- $self->OpenSSLPath, qw(smime -sign -passin env:SMIME_PASS),
+ $self->OpenSSLPath, qw(smime -sign),
-signer => $opts->{'Keyring'} .'/'. $args{'Signer'} .'.pem',
-inkey => $opts->{'Keyring'} .'/'. $args{'Signer'} .'.pem',
+ (defined $args{'Passphrase'} && length $args{'Passphrase'})
+ ? (qw(-passin env:SMIME_PASS))
+ : (),
);
}
if ( $args{'Encrypt'} ) {
@@ -398,8 +401,10 @@ sub DecryptRFC3851 {
local $SIG{CHLD} = 'DEFAULT';
my $cmd = join( ' ', shell_quote(
$self->OpenSSLPath,
- qw(smime -decrypt -passin env:SMIME_PASS),
- -recip => $key_file,
+ qw(smime -decrypt), '-recip' => $key_file,
+ (defined $ENV{'SMIME_PASS'} && length $ENV{'SMIME_PASS'})
+ ? (qw(-passin env:SMIME_PASS))
+ : (),
) );
safe_run_child { run3( $cmd, \$msg, \$buf, \$res{'stderr'} ) };
unless ( $? ) {
-----------------------------------------------------------------------
More information about the Rt-commit
mailing list