From c2e9fab1b3e8f0c254a41e7875d4aaf9bb5b2419 Mon Sep 17 00:00:00 2001 From: Daniel Kahn Gillmor Date: Sun, 11 Jan 2009 23:05:44 -0500 Subject: [PATCH] pem2openpgp: cleaning up some comments, not fetching unnecessary parameters from OpenSSL. --- src/keytrans/pem2openpgp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) 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). -- 2.25.1