@@ -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
561561sub _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
576576sub _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
589589sub _DecryptData {
0 commit comments