-
Notifications
You must be signed in to change notification settings - Fork 263
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Migrate to RT::Test::Crypt for code that still uses deprecated RT::Te…
…st::SMIME
- Loading branch information
Showing
1 changed file
with
6 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
use strict; | ||
use warnings; | ||
|
||
use RT::Test::SMIME tests => undef; | ||
use RT::Test::Crypt SMIME => 1, tests => undef; | ||
|
||
use IPC::Run3 'run3'; | ||
use Test::Warn; | ||
|
@@ -25,7 +25,7 @@ my $key_ring = RT->Config->Get('SMIME')->{'Keyring'}; | |
for my $key ( keys %signing ) { | ||
diag "Testing signing with $key"; | ||
|
||
RT::Test::SMIME->import_key('[email protected]'); | ||
RT::Test::Crypt->smime_import_key('[email protected]'); | ||
if ( $key ne '[email protected]' ) { | ||
rename File::Spec->catfile( $key_ring, '[email protected]' ), File::Spec->catfile( $key_ring, $key ) | ||
or die $!; | ||
|
@@ -47,7 +47,7 @@ END | |
like( $mails[0], qr'Content-Type: application/x-pkcs7-signature', 'Sent message contains signature' ); | ||
|
||
my ( $buf, $err ); | ||
run3( [ qw(openssl smime -verify), '-CAfile', RT::Test::SMIME->key_path . "/demoCA/cacert.pem", ], | ||
run3( [ qw(openssl smime -verify), '-CAfile', RT::Test::Crypt->smime_key_path . "/demoCA/cacert.pem", ], | ||
\$mails[0], \$buf, \$err ); | ||
|
||
like( $err, qr'Verification successful', 'Verification output' ); | ||
|
@@ -73,12 +73,12 @@ my %encryption = ( | |
my $root = RT::Test->load_or_create_user( Name => 'root' ); | ||
( $ret, $msg ) = $root->SetEmailAddress('[email protected]'); | ||
ok( $ret, 'set root email to [email protected]' ); | ||
RT::Test::SMIME->import_key( '[email protected]', $root ); | ||
RT::Test::Crypt->smime_import_key( '[email protected]', $root ); | ||
|
||
for my $key ( keys %encryption ) { | ||
diag "Testing decryption with $key"; | ||
|
||
RT::Test::SMIME->import_key('[email protected]'); | ||
RT::Test::Crypt->smime_import_key('[email protected]'); | ||
if ( $key ne '[email protected]' ) { | ||
rename File::Spec->catfile( $key_ring, '[email protected]' ), File::Spec->catfile( $key_ring, $key ) | ||
or die $!; | ||
|
@@ -90,7 +90,7 @@ for my $key ( keys %encryption ) { | |
-from => '[email protected]', | ||
-to => '[email protected]', | ||
-subject => "Encrypted message for queue", | ||
RT::Test::SMIME->key_path('[email protected]'), | ||
RT::Test::Crypt->smime_key_path('[email protected]'), | ||
], | ||
\"\nthis is content", | ||
\$buf, | ||
|