[Rt-commit] rt branch, 4.4/crypt-minor-fixes, created. rt-4.4.4-239-g0e15eb9e5f

Dianne Skoll dianne at bestpractical.com
Tue Feb 2 11:52:14 EST 2021


The branch, 4.4/crypt-minor-fixes has been created
        at  0e15eb9e5f4fb42bcca62ad32f64eb3a071b9b93 (commit)

- Log -----------------------------------------------------------------
commit 124db83e80913c661fda4e53ba7730bf0f4696ca
Author: Dianne Skoll <dianne at bestpractical.com>
Date:   Tue Feb 2 11:14:23 2021 -0500

    Keep entire GnuPG fingerprint; don't truncate to 8 characters

diff --git a/lib/RT/Crypt/GnuPG.pm b/lib/RT/Crypt/GnuPG.pm
index 1117c43094..9e4bd2e45b 100644
--- a/lib/RT/Crypt/GnuPG.pm
+++ b/lib/RT/Crypt/GnuPG.pm
@@ -1698,7 +1698,7 @@ sub GetKeysInfo {
     for my $key (@{$res{info}}) {
         $key->{Formatted} =
             join("; ", map {$_->{String}} @{$key->{User}})
-                . " (".substr($key->{Fingerprint}, -8) . ")";
+                . " (" . $key->{Fingerprint} . ")";
     }
 
     return %res;

commit be4f8214a957c3a7a0a514f6c77e912804aa9eff
Author: Dianne Skoll <dianne at bestpractical.com>
Date:   Tue Feb 2 11:14:57 2021 -0500

    Include S/MIME certificate serial number in tooltip

diff --git a/lib/RT/Crypt/SMIME.pm b/lib/RT/Crypt/SMIME.pm
index 3b3373f7ae..e7540bb558 100644
--- a/lib/RT/Crypt/SMIME.pm
+++ b/lib/RT/Crypt/SMIME.pm
@@ -524,6 +524,7 @@ sub Verify {
             $res{'status'} = $self->FormatStatus({
                 Operation => "Verify", Status => "BAD",
                 Message => "The signing CA was not trusted",
+                Serial => $signer->{'Serial Number'} || 'unknown',
                 UserString => $signer->{User}[0]{String},
                 ExpireTimestamp => $signer->{Expire}->Unix(),
                 CreatedTimestamp => $signer->{Created}->Unix(),
@@ -560,6 +561,7 @@ sub Verify {
             Message => "The signature is good, unknown signer",
             ExpireTimestamp => $signer->{Expire}->Unix(),
             CreatedTimestamp => $signer->{Created}->Unix(),
+            Serial => $signer->{'Serial Number'} || 'unknown',
             Trust => "UNKNOWN",
         });
         return %res;
@@ -574,6 +576,7 @@ sub Verify {
     $res{'status'} = $self->FormatStatus({
         Operation => "Verify", Status => "DONE",
         Message => "The signature is good, signed by ".$signer->{User}[0]{String}.", assured by " . $signer->{Issuer}[0]{String} . ", trust is ".$signer->{TrustTerse},
+        Serial => $signer->{'Serial Number'} || 'unknown',
         UserString => $signer->{User}[0]{String},
         Trust => uc($signer->{TrustTerse}),
         Issuer => $signer->{Issuer}[0]{String},
diff --git a/share/html/Elements/CryptStatus b/share/html/Elements/CryptStatus
index a608d7ca62..362a9c1570 100644
--- a/share/html/Elements/CryptStatus
+++ b/share/html/Elements/CryptStatus
@@ -90,6 +90,7 @@ sub VerifyTooltip {
     $tooltip .= "\n" . loc('Signature Created') . ': ' . DisplayDate($line->{Timestamp}) if $line->{Timestamp};                 # GNUPG
     $tooltip .= "\n" . loc('Signer') . ': ' . $line->{UserString} if $line->{UserString};                                       # SMIME
     $tooltip .= "\n" . loc('Issuer') . ': ' . $line->{Issuer} if $line->{Issuer};                                               # SMIME
+    $tooltip .= "\n" . loc('Serial Number') . ': ' . $line->{Serial} if $line->{Serial};                                         # SMIME
     $tooltip .= "\n" . loc('Certificate Created') . ': ' . DisplayDate($line->{CreatedTimestamp}) if $line->{CreatedTimestamp}; # SMIME
     if ($protocol eq 'SMIME') {
         $tooltip .= "\n" . loc('Certificate Expires') . ': ';

commit 0e15eb9e5f4fb42bcca62ad32f64eb3a071b9b93
Author: Dianne Skoll <dianne at bestpractical.com>
Date:   Tue Feb 2 11:15:36 2021 -0500

    Update tests for newly-included S/MIME certificate serial number

diff --git a/t/mail/smime/incoming.t b/t/mail/smime/incoming.t
index 82249d1c52..625b441661 100644
--- a/t/mail/smime/incoming.t
+++ b/t/mail/smime/incoming.t
@@ -151,6 +151,7 @@ RT::Test->close_mailgate_ok($mail);
             {   Status           => 'DONE',
                 UserString       => '"Enoch Root" <root at example.com>',
                 Trust            => 'FULL',
+                Serial           => '9974010075738841110',
                 Issuer           => '"CA Owner" <ca.owner at example.com>',
                 CreatedTimestamp => re('^\d+$'),
                 Message =>
@@ -208,6 +209,7 @@ RT::Test->close_mailgate_ok($mail);
                     Protocol         => 'SMIME',
                     Operation        => 'Verify',
                     Status           => 'DONE',
+                    Serial           => '9974010075738841110',
                     Message =>
                         'The signature is good, signed by "Enoch Root" <root at example.com>, assured by "CA Owner" <ca.owner at example.com>, trust is full',
                     UserString => '"Enoch Root" <root at example.com>',
diff --git a/t/web/smime/outgoing.t b/t/web/smime/outgoing.t
index fd85917516..227a923025 100644
--- a/t/web/smime/outgoing.t
+++ b/t/web/smime/outgoing.t
@@ -222,7 +222,7 @@ foreach my $mail ( map cleanup_headers($_), @{ $mail{'signed_encrypted'} } ) {
         'Signature status correctly displayed'
     );
     $m->content_like(
-        qr{<span title="Signer: "sender" <sender\@example.com>\nIssuer: "CA Owner" <ca.owner\@example.com>\nCertificate Created: .* 2013\nCertificate Expires: .* 2023">}m,
+        qr{<span title="Signer: "sender" <sender\@example.com>\nIssuer: "CA Owner" <ca.owner\@example.com>\nSerial Number: 9974010075738841109\nCertificate Created: .* 2013\nCertificate Expires: .* 2023">}m,
         'Tooltip correctly displayed'
     );
 

-----------------------------------------------------------------------


More information about the rt-commit mailing list