From: Daniel Kahn Gillmor Date: Mon, 12 Jan 2009 04:05:44 +0000 (-0500) Subject: pem2openpgp: cleaning up some comments, not fetching unnecessary parameters from... X-Git-Tag: monkeysphere_0.23~163^2~9 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=c2e9fab1b3e8f0c254a41e7875d4aaf9bb5b2419;p=monkeysphere.git pem2openpgp: cleaning up some comments, not fetching unnecessary parameters from OpenSSL. --- diff --git a/src/keytrans/pem2openpgp b/src/keytrans/pem2openpgp index c74ca25..4cc6f1d 100755 --- a/src/keytrans/pem2openpgp +++ b/src/keytrans/pem2openpgp @@ -275,18 +275,18 @@ sub make_rsa_sec_key_body { my $timestamp = shift; # we're not using $a and $b, but we need them to get to $c. - my ($n, $e, $d, $p, $q, $a, $b, $c) = $key->get_key_parameters(); + my ($n, $e, $d, $p, $q) = $key->get_key_parameters(); my $secret_material = mpi_pack($d). mpi_pack($p). mpi_pack($q). mpi_pack(modular_multi_inverse($p, $q)); - # FIXME: according to Crypt::OpenSSL::RSA, $c is 1/q mod p; but - # according to sec 5.5.3 of RFC 4880, this last argument should - # instead be: u, the multiplicative inverse of p, mod q. i don't - # see a simple way to generate this number from the perl module - # directly yet. + # according to Crypt::OpenSSL::RSA, the closest value we can get out + # of get_key_parameters is 1/q mod p; but according to sec 5.5.3 of + # RFC 4880, we're actually looking for u, the multiplicative inverse + # of p, mod q. This is why we're calculating the value directly + # with modular_multi_inverse. return pack('CN', 4, $timestamp).