[Rt-commit] rt branch, 4.2/defaults-in-signencrypt, created. rt-4.2.10-236-g385b84c

Brian Duggan brian at bestpractical.com
Tue May 23 17:07:28 EDT 2017


The branch, 4.2/defaults-in-signencrypt has been created
        at  385b84c68de8e35b2b021e27f4c0d102bf9c8e08 (commit)

- Log -----------------------------------------------------------------
commit 385b84c68de8e35b2b021e27f4c0d102bf9c8e08
Author: Alex Vandiver <alexmv at bestpractical.com>
Date:   Fri Mar 14 15:04:37 2014 -0400

    Default to sign, encrypt when calling bare SignEncrypt method
    
    All callsites within RT pass both Sign and Encrypt parameters when
    calling RT::Crypt->SignEncrypt. But there were no defaults for when
    this method is called from a script or extension. The
    RT::Crypt::GnuPG->SignEncrypt and RT::Crypt::SMIME->SignEncrypt
    methods both default to signing and encrypting on their own. But
    RT::Crypt->SignEncrypt would fail to set message senders and
    recipients before calling the GnuPG or SMIME versions if it was called
    without Sign and Encrypt parameters. These defaults ensure that the
    method maintains signers/senders and encryption targets/recipients,
    regardless of how it is called.

diff --git a/lib/RT/Crypt.pm b/lib/RT/Crypt.pm
index cad86d2..98d5020 100644
--- a/lib/RT/Crypt.pm
+++ b/lib/RT/Crypt.pm
@@ -430,7 +430,11 @@ An un-localized error message desribing the problem.
 
 sub SignEncrypt {
     my $self = shift;
-    my %args = (@_);
+    my %args = (
+        Sign => 1,
+        Encrypt => 1,
+        @_,
+    );
 
     my $entity = $args{'Entity'};
     if ( $args{'Sign'} && !defined $args{'Signer'} ) {

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


More information about the rt-commit mailing list