Skip to content

Commit

Permalink
Extend OID maps, change shortnames l=>L S=>ST
Browse files Browse the repository at this point in the history
Adds new items to the OID map and CHANGES the shortnames for
2.5.4.8 (state) and 2.5.4.7 (locality) to be compatible with
openssl and most other crypto toolkits

Makes the oid2... maps available for external modification by
raising their scope to our.
  • Loading branch information
oliwel committed Nov 8, 2019
1 parent ef56eca commit 8287513
Showing 1 changed file with 11 additions and 6 deletions.
17 changes: 11 additions & 6 deletions lib/Crypt/X509.pm
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@ our @ISA = qw(Exporter);
our %EXPORT_TAGS = ( 'all' => [qw()] );
our @EXPORT_OK = ( @{ $EXPORT_TAGS{'all'} } );
#our @EXPORT = qw(error new not_before not_after serial);
our $VERSION = '0.51';
our $VERSION = '0.52';
my $parser = undef;
my $asn = undef;
my $error = undef;
my %oid2enchash = (
our %oid2enchash = (
'1.2.840.113549.1.1.1' => { 'enc' => 'RSA' },
'1.2.840.113549.1.1.2' => { 'enc' => 'RSA', 'hash' => 'MD2' },
'1.2.840.113549.1.1.3' => { 'enc' => 'RSA', 'hash' => 'MD4' },
Expand All @@ -24,11 +24,15 @@ my %oid2enchash = (
'1.2.840.113549.1.1.13' => { 'enc' => 'RSA', 'hash' => 'SHA512' },
'1.2.840.113549.1.1.14' => { 'enc' => 'RSA', 'hash' => 'SHA224' }
);
my %oid2attr = (

our %oid2attr = (
"2.5.4.3" => "CN",
"2.5.4.4" => "SN",
"2.5.4.42" => "GN",
"2.5.4.5" => "serialNumber",
"2.5.4.6" => "C",
"2.5.4.7" => "l",
"2.5.4.8" => "S",
"2.5.4.7" => "L",
"2.5.4.8" => "ST",
"2.5.4.10" => "O",
"2.5.4.11" => "OU",
"1.2.840.113549.1.9.1" => "E",
Expand Down Expand Up @@ -690,7 +694,7 @@ If the extension is marked critical, this is also reported.
Example Output: ExtKeyUsage extension of this Certificates is: critical, serverAuth
=cut back
my %oid2extkeyusage = (
our %oid2extkeyusage = (
'1.3.6.1.5.5.7.3.1' => 'serverAuth',
'1.3.6.1.5.5.7.3.2' => 'clientAuth',
'1.3.6.1.5.5.7.3.3' => 'codeSigning',
Expand Down Expand Up @@ -1651,6 +1655,7 @@ Convert::ASN1 in 2002 by Norbert Klasen.
Mike Jackson <[email protected]>,
Alexander Jung <[email protected]>,
Duncan Segrest <[email protected]>
Oliver Welter <[email protected]>
=head1 COPYRIGHT
Expand Down

0 comments on commit 8287513

Please sign in to comment.