Skip to content

Commit 90d3c51

Browse files
committed
Fix CryptX version comparison for 0.081
1 parent 8409f27 commit 90d3c51

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

lib/XML/Enc.pm

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -775,7 +775,7 @@ sub _decrypt_key {
775775
if ($algo eq 'http://www.w3.org/2001/04/xmlenc#rsa-oaep-mgf1p') {
776776
return _decrypt(
777777
sub {
778-
if ($CryptX::VERSION le 0.081) {
778+
if ($CryptX::VERSION lt 0.081) {
779779
#print "Caller: _decrypt_key rsa-oaep-mgf1p\n";
780780
$self->{key_obj}->decrypt(
781781
$key, 'oaep',
@@ -800,7 +800,7 @@ sub _decrypt_key {
800800
if ($algo eq 'http://www.w3.org/2009/xmlenc11#rsa-oaep') {
801801
return _decrypt(
802802
sub {
803-
if ($CryptX::VERSION le 0.081) {
803+
if ($CryptX::VERSION lt 0.081) {
804804
$self->{key_obj}->decrypt(
805805
$key, 'oaep',
806806
$self->_getOAEPAlgorithm($mgf),
@@ -833,7 +833,7 @@ sub _EncryptKey {
833833
${$key} = $rsa_pub->encrypt(${$key}, 'v1.5');
834834
}
835835
elsif ($keymethod eq 'http://www.w3.org/2001/04/xmlenc#rsa-oaep-mgf1p') {
836-
if ($CryptX::VERSION le 0.081) {
836+
if ($CryptX::VERSION lt 0.081) {
837837
${$key} = $rsa_pub->encrypt(${$key}, 'oaep', 'SHA1', $self->{oaep_params});
838838
} else {
839839
my $oaep_label_hash = (defined $self->{oaep_label_hash} && $self->{oaep_label_hash} ne '') ?
@@ -844,7 +844,7 @@ sub _EncryptKey {
844844
elsif ($keymethod eq 'http://www.w3.org/2009/xmlenc11#rsa-oaep') {
845845
my $mgf_hash = defined $self->{oaep_mgf_alg} ?
846846
$self->_getOAEPAlgorithm($self->{oaep_mgf_alg}) : undef;
847-
if ($CryptX::VERSION le 0.081) {
847+
if ($CryptX::VERSION lt 0.081) {
848848
${$key} = $rsa_pub->encrypt(${$key}, 'oaep', $mgf_hash, $self->{oaep_params});
849849
} else {
850850
my $oaep_label_hash = (defined $self->{oaep_label_hash} && $self->{oaep_label_hash} ne '') ?

0 commit comments

Comments
 (0)