From: Daniel Kahn Gillmor Date: Fri, 11 Mar 2011 06:25:38 +0000 (-0500) Subject: use new upstream features of Crypt::X509 directly -- less code in MSVA X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=89339031f4ea68fdbf4493b279568e50791c7c81;p=monkeysphere-validation-agent.git use new upstream features of Crypt::X509 directly -- less code in MSVA --- diff --git a/Changelog b/Changelog index bd09040..5eef10a 100644 --- a/Changelog +++ b/Changelog @@ -12,7 +12,10 @@ msva-perl (0.9~pre) upstream; - new Crypt::Monkeysphere::Validator - unit tests and unit test harness - -- Daniel Kahn Gillmor Thu, 10 Mar 2011 00:58:11 -0500 + [ Daniel Kahn Gillmor ] + * now depending on Crypt::X509 0.50 for pubkey components directly. + + -- Daniel Kahn Gillmor Fri, 11 Mar 2011 01:24:55 -0500 msva-perl (0.8) upstream; diff --git a/Crypt/Monkeysphere/MSVA.pm b/Crypt/Monkeysphere/MSVA.pm index 9436671..e192fe2 100755 --- a/Crypt/Monkeysphere/MSVA.pm +++ b/Crypt/Monkeysphere/MSVA.pm @@ -25,9 +25,8 @@ use Crypt::Monkeysphere::Validator; - require Crypt::X509; + use Crypt::X509 0.50; use Regexp::Common qw /net/; - use Convert::ASN1; use MIME::Base64; use IO::Socket; use IO::File; @@ -70,15 +69,6 @@ return $logger; } - my $rsa_decoder = Convert::ASN1::->new(); - $rsa_decoder->prepare(q< - - SEQUENCE { - modulus INTEGER, - exponent INTEGER - } - >); - sub net_server { return 'Net::Server::MSVA'; }; @@ -448,7 +438,7 @@ $cert->PubKeyAlg(), $cert->pubkey_algorithm); } else { msvalog('debug', "decoding ASN.1 pubkey\n"); - $key = $rsa_decoder->decode($cert->pubkey()); + $key = $cert->pubkey_components(); if (! defined $key) { msvalog('verbose', "failed to decode %s\n", unpack('H*', $cert->pubkey())); $key = {error => 'failed to decode the public key'};