@@ -304,7 +304,7 @@ sub _decrypt_uri_nodes {
304
304
my %options = @_ ;
305
305
306
306
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 ; });
308
308
309
309
foreach my $uri (@uri_nodes ) {
310
310
my $encrypted_key_nodes = $self -> _get_named_key_nodes(
@@ -547,43 +547,43 @@ sub _setOAEPAlgorithm {
547
547
my $self = shift ;
548
548
my $method = shift ;
549
549
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
+ } ;
557
557
558
- return exists ( $methods {$method }) ? $methods { $method } : $methods { ' mgf1sha1 ' };
558
+ return $setOAEPAlgorithm -> {$method } // $setOAEPAlgorithm -> { ' rsa-oaep-mgf1p ' };
559
559
}
560
560
561
561
sub _getOAEPAlgorithm {
562
562
my $self = shift ;
563
563
my $method = shift ;
564
564
565
- state % OAEPAlgorithm = (
565
+ state $ OAEPAlgorithm = {
566
566
' http://www.w3.org/2009/xmlenc11#mgf1sha1' => ' SHA1' ,
567
567
' http://www.w3.org/2009/xmlenc11#mgf1sha224' => ' SHA224' ,
568
568
' http://www.w3.org/2009/xmlenc11#mgf1sha256' => ' SHA256' ,
569
569
' http://www.w3.org/2009/xmlenc11#mgf1sha384' => ' SHA384' ,
570
570
' http://www.w3.org/2009/xmlenc11#mgf1sha512' => ' SHA512' ,
571
- ) ;
571
+ } ;
572
572
573
- return $OAEPAlgorithm {$method } // ' SHA1' ;
573
+ return $OAEPAlgorithm -> {$method } // ' SHA1' ;
574
574
}
575
575
576
576
sub _setKeyEncryptionMethod {
577
577
my $self = shift ;
578
578
my $method = shift ;
579
579
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
+ } ;
585
585
586
- return exists ( $methods {$method }) ? $methods { $method } : $methods {' rsa-oaep-mgf1p' };
586
+ return $enc_methods -> {$method } // $enc_methods -> {' rsa-oaep-mgf1p' };
587
587
}
588
588
589
589
sub _DecryptData {
0 commit comments