Skip to content

Commit 4f42e41

Browse files
authored
Merge pull request #9 from waterkip/GL-fixup-CI
Fix CI pipelines
2 parents 7df74f0 + 3367a90 commit 4f42e41

File tree

5 files changed

+24
-23
lines changed

5 files changed

+24
-23
lines changed

.github/workflows/linux.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,16 @@
1+
---
12
name: linux
23

34
on:
45
- push
6+
- pull_request
57

68
jobs:
79
perl:
810
runs-on: ubuntu-latest
911
strategy:
1012
matrix:
1113
perl-version:
12-
- '5.8-buster'
1314
- '5.10-buster'
1415
- '5.12-buster'
1516
- '5.14-buster'

Makefile.PL

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
use strict;
22
use warnings;
33

4-
use 5.008;
4+
use 5.010;
55

66
use ExtUtils::MakeMaker;
77

@@ -13,7 +13,7 @@ my %WriteMakefileArgs = (
1313
},
1414
"DISTNAME" => "XML-Enc",
1515
"LICENSE" => "perl",
16-
"MIN_PERL_VERSION" => "5.008",
16+
"MIN_PERL_VERSION" => "5.010",
1717
"NAME" => "XML::Enc",
1818
"PREREQ_PM" => {
1919
"Carp" => 0,

cpanfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ requires "Crypt::PRNG" => "0";
99
requires "MIME::Base64" => "0";
1010
requires "XML::LibXML" => "0";
1111
requires "feature" => "0";
12-
requires "perl" => "5.008";
12+
requires "perl" => "5.010";
1313
requires "strict" => "0";
1414
requires "vars" => "0";
1515
requires "warnings" => "0";

dist.ini

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ contributor = Timothy Legge <[email protected]>
1212

1313
[AutoPrereqs]
1414
[Prereqs / RuntimeRequires]
15-
perl = 5.008
15+
perl = 5.010
1616
Crypt::PK::RSA = 0
1717
Crypt::OpenSSL::X509 = 0
1818
MIME::Base64 = 0

lib/XML/Enc.pm

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -304,7 +304,7 @@ sub _decrypt_uri_nodes {
304304
my %options = @_;
305305

306306
my $uri_nodes = $xpc->findnodes('//dsig:KeyInfo/dsig:RetrievalMethod/@URI');
307-
my @uri_nodes = $uri_nodes->map(sub { my $v = $_->getValue; $v =~ s/^#//r });
307+
my @uri_nodes = $uri_nodes->map(sub { my $v = $_->getValue; $v =~ s/^#//; return $v; });
308308

309309
foreach my $uri (@uri_nodes) {
310310
my $encrypted_key_nodes = $self->_get_named_key_nodes(
@@ -547,43 +547,43 @@ sub _setOAEPAlgorithm {
547547
my $self = shift;
548548
my $method = shift;
549549

550-
my %methods = (
551-
'mgf1sha1' => 'http://www.w3.org/2009/xmlenc11#mgf1sha1',
552-
'mgf1sha224' => 'http://www.w3.org/2009/xmlenc11#mgf1sha224',
553-
'mgf1sha256' => 'http://www.w3.org/2009/xmlenc11#mgf1sha256',
554-
'mgf1sha384' => 'http://www.w3.org/2009/xmlenc11#mgf1sha384',
555-
'mgf1sha512' => 'http://www.w3.org/2009/xmlenc11#mgf1sha512',
556-
);
550+
state $setOAEPAlgorithm = {
551+
'mgf1sha1' => 'http://www.w3.org/2009/xmlenc11#mgf1sha1',
552+
'mgf1sha224' => 'http://www.w3.org/2009/xmlenc11#mgf1sha224',
553+
'mgf1sha256' => 'http://www.w3.org/2009/xmlenc11#mgf1sha256',
554+
'mgf1sha384' => 'http://www.w3.org/2009/xmlenc11#mgf1sha384',
555+
'mgf1sha512' => 'http://www.w3.org/2009/xmlenc11#mgf1sha512',
556+
};
557557

558-
return exists($methods{$method}) ? $methods{$method} : $methods{'mgf1sha1'};
558+
return $setOAEPAlgorithm->{$method} // $setOAEPAlgorithm->{'rsa-oaep-mgf1p'};
559559
}
560560

561561
sub _getOAEPAlgorithm {
562562
my $self = shift;
563563
my $method = shift;
564564

565-
state %OAEPAlgorithm = (
565+
state $OAEPAlgorithm = {
566566
'http://www.w3.org/2009/xmlenc11#mgf1sha1' => 'SHA1',
567567
'http://www.w3.org/2009/xmlenc11#mgf1sha224' => 'SHA224',
568568
'http://www.w3.org/2009/xmlenc11#mgf1sha256' => 'SHA256',
569569
'http://www.w3.org/2009/xmlenc11#mgf1sha384' => 'SHA384',
570570
'http://www.w3.org/2009/xmlenc11#mgf1sha512' => 'SHA512',
571-
);
571+
};
572572

573-
return $OAEPAlgorithm{$method} // 'SHA1';
573+
return $OAEPAlgorithm->{$method} // 'SHA1';
574574
}
575575

576576
sub _setKeyEncryptionMethod {
577577
my $self = shift;
578578
my $method = shift;
579579

580-
my %methods = (
581-
'rsa-1_5' => 'http://www.w3.org/2001/04/xmlenc#rsa-1_5',
582-
'rsa-oaep-mgf1p' => 'http://www.w3.org/2001/04/xmlenc#rsa-oaep-mgf1p',
583-
'rsa-oaep' => 'http://www.w3.org/2009/xmlenc11#rsa-oaep',
584-
);
580+
state $enc_methods = {
581+
'rsa-1_5' => 'http://www.w3.org/2001/04/xmlenc#rsa-1_5',
582+
'rsa-oaep-mgf1p' => 'http://www.w3.org/2001/04/xmlenc#rsa-oaep-mgf1p',
583+
'rsa-oaep' => 'http://www.w3.org/2009/xmlenc11#rsa-oaep',
584+
};
585585

586-
return exists($methods{$method}) ? $methods{$method} : $methods{'rsa-oaep-mgf1p'};
586+
return $enc_methods->{$method} // $enc_methods->{'rsa-oaep-mgf1p'};
587587
}
588588

589589
sub _DecryptData {

0 commit comments

Comments
 (0)