[Rt-commit] r8538 - in rt/branches/3.7-EXPERIMENTAL-TUNIS: lib/RT/Crypt

sartak at bestpractical.com sartak at bestpractical.com
Tue Aug 14 12:05:26 EDT 2007


Author: sartak
Date: Tue Aug 14 12:05:25 2007
New Revision: 8538

Modified:
   rt/branches/3.7-EXPERIMENTAL-TUNIS/   (props changed)
   rt/branches/3.7-EXPERIMENTAL-TUNIS/lib/RT/Crypt/GnuPG.pm

Log:
 r37384 at gorgoroth:  sartak | 2007-08-14 12:05:13 -0400
 Use passphrase from GnuPGOptions if necessary


Modified: rt/branches/3.7-EXPERIMENTAL-TUNIS/lib/RT/Crypt/GnuPG.pm
==============================================================================
--- rt/branches/3.7-EXPERIMENTAL-TUNIS/lib/RT/Crypt/GnuPG.pm	(original)
+++ rt/branches/3.7-EXPERIMENTAL-TUNIS/lib/RT/Crypt/GnuPG.pm	Tue Aug 14 12:05:25 2007
@@ -380,12 +380,6 @@
         @_
     );
 
-    my $entity = $args{'Entity'};
-
-    if ( $args{'Sign'} && !defined $args{'Passphrase'} ) {
-        $args{'Passphrase'} = GetPassphrase( Address => $args{'Signer'} );
-    }
-
     my $gnupg = new GnuPG::Interface;
     my %opt = RT->Config->Get('GnuPGOptions');
     $opt{'digest-algo'} ||= 'SHA1';
@@ -397,6 +391,15 @@
         meta_interactive => 0,
     );
 
+    my $entity = $args{'Entity'};
+
+    # handling passphrase in GnupGOptions
+    $args{'Passphrase'} ||= delete $opt{'passphrase'};
+
+    if ( $args{'Sign'} && !defined $args{'Passphrase'} ) {
+        $args{'Passphrase'} = GetPassphrase( Address => $args{'Signer'} );
+    }
+
     my %res;
     if ( $args{'Sign'} && !$args{'Encrypt'} ) {
         # required by RFC3156(Ch. 5) and RFC1847(Ch. 2.1)
@@ -554,10 +557,6 @@
     );
     return unless $args{'Sign'} || $args{'Encrypt'};
 
-    if ( $args{'Sign'} && !defined $args{'Passphrase'} ) {
-        $args{'Passphrase'} = GetPassphrase( Address => $args{'Signer'} );
-    }
-
     my $gnupg = new GnuPG::Interface;
     my %opt = RT->Config->Get('GnuPGOptions');
     $opt{'digest-algo'} ||= 'SHA1';
@@ -569,6 +568,13 @@
         meta_interactive => 0,
     );
 
+    # handling passphrase in GnupGOptions
+    $args{'Passphrase'} ||= delete $opt{'passphrase'};
+
+    if ( $args{'Sign'} && !defined $args{'Passphrase'} ) {
+        $args{'Passphrase'} = GetPassphrase( Address => $args{'Signer'} );
+    }
+
     if ( $args{'Encrypt'} ) {
         $gnupg->options->push_recipients( $_ )
             foreach @{ $args{'Recipients'} || [] };
@@ -638,10 +644,6 @@
     );
     return unless $args{'Sign'} || $args{'Encrypt'};
 
-    if ( $args{'Sign'} && !defined $args{'Passphrase'} ) {
-        $args{'Passphrase'} = GetPassphrase( Address => $args{'Signer'} );
-    }
-
     my $gnupg = new GnuPG::Interface;
     my %opt = RT->Config->Get('GnuPGOptions');
     $opt{'digest-algo'} ||= 'SHA1';
@@ -653,6 +655,13 @@
         meta_interactive => 0,
     );
 
+    # handling passphrase in GnupGOptions
+    $args{'Passphrase'} ||= delete $opt{'passphrase'};
+
+    if ( $args{'Sign'} && !defined $args{'Passphrase'} ) {
+        $args{'Passphrase'} = GetPassphrase( Address => $args{'Signer'} );
+    }
+
     my $entity = $args{'Entity'};
     if ( $args{'Encrypt'} ) {
         $gnupg->options->push_recipients( $_ )
@@ -1006,6 +1015,9 @@
         meta_interactive => 0,
     );
 
+    # handling passphrase in GnupGOptions
+    $args{'Passphrase'} ||= delete $opt{'passphrase'};
+
     $args{'Passphrase'} = GetPassphrase()
         unless defined $args{'Passphrase'};
 
@@ -1073,6 +1085,9 @@
         meta_interactive => 0,
     );
 
+    # handling passphrase in GnupGOptions
+    $args{'Passphrase'} ||= delete $opt{'passphrase'};
+
     $args{'Passphrase'} = GetPassphrase()
         unless defined $args{'Passphrase'};
 


More information about the Rt-commit mailing list