diff options
author | Jameson Graef Rollins <jrollins@finestructure.net> | 2009-02-08 23:59:35 -0500 |
---|---|---|
committer | Jameson Graef Rollins <jrollins@finestructure.net> | 2009-02-08 23:59:35 -0500 |
commit | 770f45b0c1d72a1bb89fd98fe070a6dfdcc4c0bf (patch) | |
tree | bdc3d81acc860b08f07e00695c9c1206fe1b3247 /src/keytrans/pem2openpgp | |
parent | 9cc92238a9a9b21d37b983932d5a6a012cf80aba (diff) | |
parent | 7485d66be9e4aebaf273b8b4082caa4c2404f6e7 (diff) |
Merge commit 'dkg/master'
Diffstat (limited to 'src/keytrans/pem2openpgp')
-rwxr-xr-x | src/keytrans/pem2openpgp | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/src/keytrans/pem2openpgp b/src/keytrans/pem2openpgp index e905644..2631da6 100755 --- a/src/keytrans/pem2openpgp +++ b/src/keytrans/pem2openpgp @@ -347,13 +347,16 @@ sub fingerprint { return Digest::SHA1::sha1(pack('Cn', 0x99, length($rsabody)).$rsabody); } -# we're just not dealing with newline business right now. slurp in -# the whole file. -undef $/; -my $buf = <STDIN>; - -my $rsa = Crypt::OpenSSL::RSA->new_private_key($buf); +my $rsa; +if (defined $ENV{PEM2OPENPGP_NEWKEY}) { + $rsa = Crypt::OpenSSL::RSA->generate_key($ENV{PEM2OPENPGP_NEWKEY}); +} else { + # we're just not dealing with newline business right now. slurp in + # the whole file. + undef $/; + $rsa = Crypt::OpenSSL::RSA->new_private_key(<STDIN>); +} $rsa->use_sha1_hash(); @@ -495,11 +498,8 @@ my $datatosign = $sig_data_to_be_hashed. $trailer; -print STDERR $datatosign; - my $data_hash = Digest::SHA1::sha1_hex($datatosign); - my $issuer_packet = pack('CCa8', 9, $subpacket_types->{issuer}, $keyid); my $sig = Crypt::OpenSSL::Bignum->new_from_bin($rsa->sign($datatosign)); |