[Rt-commit] r18451 - rt/3.8/trunk/lib/RT/Crypt
    ruz at bestpractical.com 
    ruz at bestpractical.com
       
    Wed Feb 18 14:24:34 EST 2009
    
    
  
Author: ruz
Date: Wed Feb 18 14:24:29 2009
New Revision: 18451
Modified:
   rt/3.8/trunk/lib/RT/Crypt/GnuPG.pm
Log:
* don't detect and decrypt blocks which contains GPG header
  in the middle of a string instead of the beginning
Modified: rt/3.8/trunk/lib/RT/Crypt/GnuPG.pm
==============================================================================
--- rt/3.8/trunk/lib/RT/Crypt/GnuPG.pm	(original)
+++ rt/3.8/trunk/lib/RT/Crypt/GnuPG.pm	Wed Feb 18 14:24:29 2009
@@ -897,7 +897,7 @@
             return ();
         }
         while ( defined($_ = $io->getline) ) {
-            next unless /-----BEGIN PGP (SIGNED )?MESSAGE-----/;
+            next unless /^-----BEGIN PGP (SIGNED )?MESSAGE-----/;
             my $type = $1? 'signed': 'encrypted';
             $RT::Logger->debug("Found $type inline part");
             return {
@@ -1267,7 +1267,7 @@
 
     my %res;
     while ( defined(my $str = $io->getline) ) {
-        if ( $in_block && $str =~ /-----END PGP (?:MESSAGE|SIGNATURE)-----/ ) {
+        if ( $in_block && $str =~ /^-----END PGP (?:MESSAGE|SIGNATURE)-----/ ) {
             print $block_fh $str;
             $in_block--;
             next if $in_block > 0;
@@ -1292,7 +1292,7 @@
             binmode $block_fh, ':raw';
             $in_block = 0;
         }
-        elsif ( $str =~ /-----BEGIN PGP (SIGNED )?MESSAGE-----/ ) {
+        elsif ( $str =~ /^-----BEGIN PGP (SIGNED )?MESSAGE-----/ ) {
             $in_block++;
             print $block_fh $str;
         }
    
    
More information about the Rt-commit
mailing list