projects
/
monkeysphere.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (from parent 1:
e7108ef
)
pem2openpgp now supports generating the key as an alternative to reading it from...
author
Daniel Kahn Gillmor
<dkg@fifthhorseman.net>
Thu, 5 Feb 2009 19:11:04 +0000
(14:11 -0500)
committer
Daniel Kahn Gillmor
<dkg@fifthhorseman.net>
Thu, 5 Feb 2009 19:11:04 +0000
(14:11 -0500)
src/keytrans/pem2openpgp
patch
|
blob
|
history
diff --git
a/src/keytrans/pem2openpgp
b/src/keytrans/pem2openpgp
index c765002b2a1cec100b95476589e105e06d51dfd0..2631da6e99b8bb04bb2a91b5df6be69171f7bea6 100755
(executable)
--- a/
src/keytrans/pem2openpgp
+++ b/
src/keytrans/pem2openpgp
@@
-347,13
+347,16
@@
sub fingerprint {
return Digest::SHA1::sha1(pack('Cn', 0x99, length($rsabody)).$rsabody);
}
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();
$rsa->use_sha1_hash();