Subject: | [PATCH] Check for definedness in pubkey_components sub |
Hi,
we get warnings on console when using pubkey_components sub on certificate data that returns nothing from PubKeyAlg method. The attached patch checks for definedness before calling PubKeyAlg method.
Regards,
Subject: | crypt-x509.patch |
diff -pur Crypt-X509-0.51/lib/Crypt/X509.pm Crypt-X509-0.51.patched/lib/Crypt/X509.pm
--- Crypt-X509-0.51/lib/Crypt/X509.pm 2011-07-06 09:53:48.000000000 +0200
+++ Crypt-X509-0.51.patched/lib/Crypt/X509.pm 2018-07-01 17:13:25.873988477 +0200
@@ -300,7 +300,7 @@ For other pubkey types, it returns undef
sub pubkey_components {
my $self = shift;
- if ($self->PubKeyAlg() eq 'RSA') {
+ if (defined($self->PubKeyAlg()) && $self->PubKeyAlg() eq 'RSA') {
my $parser = _init('RSAPubKeyInfo');
my $values = $parser->decode($self->{tbsCertificate}{subjectPublicKeyInfo}{subjectPublicKey}[0]);
return $values;
Only in Crypt-X509-0.51.patched/lib/Crypt: X509.pm.rej