[Rt-commit] rt branch, 4.2/smime-v2, updated. rt-4.0.4-515-gc779415

Ruslan Zakirov ruz at bestpractical.com
Wed May 2 16:19:41 EDT 2012


The branch, 4.2/smime-v2 has been updated
       via  c779415f0ffdc4a01229a39c0978893b7b47fdc0 (commit)
       via  af21d061d4a00f578636385ef652286991a00147 (commit)
      from  81521f5eae00c0beb518a19f6591459f59360e8a (commit)

Summary of changes:
 lib/RT/Crypt/GnuPG.pm |    1 +
 lib/RT/Crypt/SMIME.pm |    8 ++++----
 2 files changed, 5 insertions(+), 4 deletions(-)

- Log -----------------------------------------------------------------
commit af21d061d4a00f578636385ef652286991a00147
Author: Jim Brandt <jbrandt at bestpractical.com>
Date:   Tue May 1 10:45:35 2012 -0400

    Add DECRYPTION_INFO to ignore_keywords.
    
    GnuPG added DECRYPTION_INFO in version 1.4.12.
    
    https://gitorious.org/gnupg-org/gnupg/commit/cfb193a1de2f0553ee65a19a417a885938539225

diff --git a/lib/RT/Crypt/GnuPG.pm b/lib/RT/Crypt/GnuPG.pm
index d78aa5c..da72c52 100644
--- a/lib/RT/Crypt/GnuPG.pm
+++ b/lib/RT/Crypt/GnuPG.pm
@@ -1739,6 +1739,7 @@ my %ignore_keyword = map { $_ => 1 } qw(
     BEGIN_ENCRYPTION SIG_ID VALIDSIG
     ENC_TO BEGIN_DECRYPTION END_DECRYPTION GOODMDC
     TRUST_UNDEFINED TRUST_NEVER TRUST_MARGINAL TRUST_FULLY TRUST_ULTIMATE
+    DECRYPTION_INFO
 );
 
 sub ParseStatus {

commit c779415f0ffdc4a01229a39c0978893b7b47fdc0
Author: Ruslan Zakirov <ruz at bestpractical.com>
Date:   Thu May 3 00:18:52 2012 +0400

    newlines don't survive in header fields
    
    use similar to GnuPG format

diff --git a/lib/RT/Crypt/SMIME.pm b/lib/RT/Crypt/SMIME.pm
index 7375594..711f07a 100644
--- a/lib/RT/Crypt/SMIME.pm
+++ b/lib/RT/Crypt/SMIME.pm
@@ -509,9 +509,9 @@ sub FormatStatus {
 
     my $res = '';
     foreach ( @status ) {
-        $res .= "\n" if $res;
+        $res .= "[SMIME:]\n" if $res;
         while ( my ($k, $v) = each %$_ ) {
-            $res .= $k .": ". $v ."\n";
+            $res .= "[SMIME:]". $k .": ". $v ."\n";
         }
     }
 
@@ -523,10 +523,10 @@ sub ParseStatus {
     my $status = shift;
     return () unless $status;
 
-    my @status = split /\n\n/, $status;
+    my @status = split /\s*(?:\[SMIME:\]\s*){2}/, $status;
     foreach my $block ( grep length, @status ) {
         chomp $block;
-        $block = { map { s/^\s+//; s/\s+$//; $_ } map split(/:/, $_, 2), split /\n+/, $block };
+        $block = { map { s/^\s+//; s/\s+$//; $_ } map split(/:/, $_, 2), split /\s*\[SMIME:\]/, $block };
     }
     foreach my $block ( grep $_->{'EncryptedTo'}, @status ) {
         $block->{'EncryptedTo'} = [{

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


More information about the Rt-commit mailing list