Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Kernel/Config/Defaults.pm
Original file line number Diff line number Diff line change
Expand Up @@ -1127,6 +1127,7 @@ sub LoadDefaults {

# $Self->{'SMIME::CertPath'} = '/etc/ssl/certs';
# $Self->{'SMIME::PrivatePath'} = '/etc/ssl/private';
# $Self->{'SMIME::NoDefaultCA'} = 0;

# --------------------------------------------------- #
# system permissions
Expand Down
7 changes: 7 additions & 0 deletions Kernel/Config/Files/XML/Framework.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3095,6 +3095,13 @@
<Item ValueType="Checkbox">0</Item>
</Value>
</Setting>
<Setting Name="SMIME::NoDefaultCA" Required="0" Valid="0">
<Description Translatable="1">When enabled, no default CA certificates on S/MIME verification will be used.</Description>
<Navigation>Core::Crypt::SMIME</Navigation>
<Value>
<Item ValueType="Checkbox">0</Item>
</Value>
</Setting>
<Setting Name="NotificationSenderName" Required="1" Valid="1">
<Description Translatable="1">Specifies the name that should be used by the application when sending notifications. The sender name is used to build the complete display name for the notification master (i.e. "OTRS Notifications" otrs@your.example.com).</Description>
<Navigation>Core::Email</Navigation>
Expand Down
17 changes: 15 additions & 2 deletions Kernel/System/Crypt/SMIME.pm
Original file line number Diff line number Diff line change
Expand Up @@ -541,8 +541,21 @@ sub Verify {
$NoVerifyOption = '-noverify';
}

my $Options = "smime -verify $NoVerifyOption -in $SignedFile -out $VerifiedFile -signer $SignerFile "
. "-CApath $Self->{CertPath} $CertificateOption $SignedFile";
# Don't use default CA certs on S/MIME verification if SMIME::NoDefaultCA is enabled.
# See also https://docs.openssl.org/master/man1/openssl-verification-options/#trusted-certificate-options
my $NoDefaultCAOptions = '';
if ( $ConfigObject->Get('SMIME::NoDefaultCA') ) {
$NoDefaultCAOptions = '-no-CAfile -no-CApath';
if ( $Self->{OpenSSLMajorVersion} >= 3 ) {

# Disable also default certificates store (option available in OpenSSL 3+).
$NoDefaultCAOptions = $NoDefaultCAOptions . ' -no-CAstore';
}
}

my $Options
= "smime -verify $NoVerifyOption $NoDefaultCAOptions -in $SignedFile -out $VerifiedFile -signer $SignerFile "
. "-CApath $Self->{CertPath} $CertificateOption";

my @LogLines = qx{$Self->{Cmd} $Options 2>&1};
for my $LogLine (@LogLines) {
Expand Down
Loading