From: Daniel Kahn Gillmor Date: Sun, 1 Mar 2009 01:36:46 +0000 (-0500) Subject: test for presence of User ID in pem2openpgp. X-Git-Tag: monkeysphere_0.24~51^2 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=a4375ee022de3c6ac6b3be371e1372bb8d720bb3;p=monkeysphere.git test for presence of User ID in pem2openpgp. --- diff --git a/src/keytrans/pem2openpgp b/src/keytrans/pem2openpgp index 37b372a..73becfe 100755 --- a/src/keytrans/pem2openpgp +++ b/src/keytrans/pem2openpgp @@ -724,6 +724,14 @@ for (basename($0)) { if (/^pem2openpgp$/) { my $rsa; my $stdin; + + my $uid = shift; + defined($uid) or die "You must specify a user ID string.\n"; + + # FIXME: fail if there is no given user ID; or should we default to + # hostname_long() from Sys::Hostname::Long ? + + if (defined $ENV{PEM2OPENPGP_NEWKEY}) { $rsa = Crypt::OpenSSL::RSA->generate_key($ENV{PEM2OPENPGP_NEWKEY}); } else { @@ -735,11 +743,6 @@ for (basename($0)) { $rsa = Crypt::OpenSSL::RSA->new_private_key($stdin); } - my $uid = shift; - - # FIXME: fail if there is no given user ID; or should we default to - # hostname_long() from Sys::Hostname::Long ? - print pem2openpgp($rsa, $uid, { timestamp => $ENV{PEM2OPENPGP_TIMESTAMP},