[Rt-commit] rt branch, 4.4/per-queue-outgoing-encryption-protocol, repushed
? sunnavy
sunnavy at bestpractical.com
Thu Nov 19 09:30:51 EST 2020
The branch 4.4/per-queue-outgoing-encryption-protocol was deleted and repushed:
was fbba824a43deb70fac770af7b3e61344d244b761
now 216f0a66497deb317b0c2bbd7b2970aa491479c0
1: ec632e3b53 ! 1: 5275ed4237 Merge RT::Test::GnuPG and RT::Test::SMIME into a single package RT::Test::Crypt
@@ -49,8 +49,8 @@
- unless GnuPG::Interface->require;
- RT::Test::plan( skip_all => 'gpg executable is required.' )
- unless RT::Test->find_executable('gpg');
-+ $UsingGnuPG = 1;
+ if ($args{GnuPG}) {
++ $UsingGnuPG = 1;
+ RT::Test::plan( skip_all => 'ENV SKIP_GPG_TESTS is set to true.' )
+ if $ENV{'SKIP_GPG_TESTS'};
+ RT::Test::plan( skip_all => 'GnuPG required.' )
@@ -121,7 +121,7 @@
+ Set(\%GnuPGOptions => \%{ $dumped_gnupg_options });
+ };
+ }
-+
+
+ if ($args->{SMIME}) {
+ my $openssl = $self->find_executable('openssl');
+
@@ -130,8 +130,10 @@
+
+ my $ca = $self->smime_key_path("demoCA", "cacert.pem");
+
++ if (!$args->{GnuPG}) {
++ print $handle qq{ Set(\%GnuPG, Enable => 0); };
++ }
+ print $handle qq{
-+ Set(\%GnuPG, Enable => 0);
+ Set(\%SMIME =>
+ Enable => 1,
+ Passphrase => {
@@ -150,7 +152,7 @@
+sub smime_keyring_path {
+ return File::Spec->catfile( RT::Test->temp_directory, "smime" );
+}
-
++
+sub smime_key_path {
+ my $self = shift;
+ my $keys = RT::Test::find_relocatable_path(
@@ -463,6 +465,19 @@
my $bad_user;
+diff --git a/t/crypt/smime/extract-email-address.t b/t/crypt/smime/extract-email-address.t
+--- a/t/crypt/smime/extract-email-address.t
++++ b/t/crypt/smime/extract-email-address.t
+@@
+ use strict;
+ use warnings;
+
+-use RT::Test::SMIME tests => undef;
++use RT::Test::Crypt SMIME => 1, tests => undef;
+
+ sub extract_email_address
+ {
+
diff --git a/t/crypt/smime/other-certs.t b/t/crypt/smime/other-certs.t
--- a/t/crypt/smime/other-certs.t
+++ b/t/crypt/smime/other-certs.t
@@ -471,7 +486,7 @@
use warnings;
-use RT::Test::SMIME tests => undef;
-+use RT::Test::Crypt SMIME=>1, tests => undef;
++use RT::Test::Crypt SMIME => 1, tests => undef;
use IPC::Run3 'run3';
-RT::Test::SMIME->import_key( 'sender at example.com' );
2: fbba824a43 ! 2: 216f0a6649 Allow specification of outbound signing/encryption protocol on a per-queue basis
@@ -1,6 +1,6 @@
Author: Dianne Skoll <dianne at bestpractical.com>
- Allow specification of outbound signing/encryption protocol on a per-queue basis.
+ Allow specification of outbound signing/encryption protocol on a per-queue basis
diff --git a/lib/RT/Attachment.pm b/lib/RT/Attachment.pm
--- a/lib/RT/Attachment.pm
@@ -37,7 +37,7 @@
-email; this defaults to the first enabled protocol. You many specify it
-explicitly via:
+RT can currently only use one protocol per queue to encrypt and sign
-+outgoing email; this defaults to the first enabled protocol. You many
++outgoing email; this defaults to the first enabled protocol. You may
+specify it explicitly via:
Set( %Crypt,
@@ -80,11 +80,12 @@
+ my $self = shift;
+ my %args = (
+ Queue => undef,
-+ @_);
++ @_
++ );
+ my $outgoing = RT->Config->Get('Crypt')->{'Outgoing'};
+
+ # Old-style config: Crypt->{'Outgoing'} is a scalar to use for all queues
-+ if ( (ref($outgoing) || '') ne 'HASH' ) {
++ if ( ( ref($outgoing) || '' ) ne 'HASH' ) {
+ return $outgoing;
+ }
+
@@ -180,7 +181,7 @@
+ if ( $proto eq 'SMIME' ) {
$trust = sub { $_[0]->{'TrustLevel'} > 0 or RT->Config->Get('SMIME')->{AcceptUntrustedCAs} };
- } elsif ( $self->UseForOutgoing eq 'GnuPG' ) {
-+ } elsif ( $proto eq 'GnuPG' ) {
++ } elsif ( $proto eq 'GnuPG' ) {
$trust = sub { $_[0]->{'TrustLevel'} > 0 };
}
@@ -216,6 +217,28 @@
Returns the list of keys which are suitable for signing mail from the
given C<Signer>. Generally this is equivalent to L</GetKeysInfo>
+@@
+ return %res;
+ }
+
+-=head2 GetKeysInfo Protocol => NAME, Type => ('public'|'private'), Key => EMAIL
++=head2 GetKeysInfo Protocol => NAME, Queue => QUEUE, Type => ('public'|'private'), Key => EMAIL
+
+ Looks up information about the public or private keys (as determined by
+ C<Type>) for the email address C<Key>. As each protocol has its own key
+@@
+
+ The name of the protocol of this key
+
++=item Queue
++
++An L<RT::Queue> or queue name. This is to infer the protocol to use from
++C<Outgoing> in L</%Crypt> configuration, only needed if Protocol is not
++provided.
++
+ =item Created
+
+ An L<RT::Date> of the date the key was created; undef if unset.
diff --git a/lib/RT/Interface/Email.pm b/lib/RT/Interface/Email.pm
--- a/lib/RT/Interface/Email.pm
@@ -231,22 +254,6 @@
return $res unless $res > 0;
}
-diff --git a/lib/RT/Test/Crypt.pm b/lib/RT/Test/Crypt.pm
---- a/lib/RT/Test/Crypt.pm
-+++ b/lib/RT/Test/Crypt.pm
-@@
-
- my $ca = $self->smime_key_path("demoCA", "cacert.pem");
-
-+ if (!$args->{GnuPG}) {
-+ print $handle qq{ Set(\%GnuPG, Enable => 0); };
-+ }
- print $handle qq{
-- Set(\%GnuPG, Enable => 0);
- Set(\%SMIME =>
- Enable => 1,
- Passphrase => {
-
diff --git a/lib/RT/User.pm b/lib/RT/User.pm
--- a/lib/RT/User.pm
+++ b/lib/RT/User.pm
More information about the rt-commit
mailing list