diff options
author | Jameson Graef Rollins <jrollins@finestructure.net> | 2009-02-19 15:19:02 -0500 |
---|---|---|
committer | Jameson Graef Rollins <jrollins@finestructure.net> | 2009-02-19 15:19:02 -0500 |
commit | bd64869a3b68ff8a020c381371a8ab1e24a5a0e4 (patch) | |
tree | b790ed7dc580224304386ac1d2c98d07248eaf3c /src/share/mh | |
parent | c073811aa573d0e3486c39ed9514c46e0a7a077f (diff) |
The monkeysphere {import,gen}_subkey functions were not up-to-date.
did a lot of work to bring them up-to-date, and better handle argument
checking. also updated man page, changelog, and tests/basic.
Diffstat (limited to 'src/share/mh')
-rw-r--r-- | src/share/mh/import_key | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/share/mh/import_key b/src/share/mh/import_key index 6394ad7..040b41c 100644 --- a/src/share/mh/import_key +++ b/src/share/mh/import_key @@ -21,6 +21,11 @@ local userID sshKeyFile="$1" hostName="$2" +# check that key file specified +if [ -z "$sshKeyFile" ] ; then + failure "Must specify ssh key file to import, or specify '-' for stdin." +fi + # use the default hostname if not specified if [ -z "$hostName" ] ; then hostName=$(hostname -f) || failure "Could not determine hostname." @@ -45,9 +50,7 @@ mkdir -p "${GNUPGHOME_HOST}" chmod 700 "${GNUPGHOME_HOST}" # import ssh key to a private key -if [ -z "$sshKeyFile" ] ; then - failure "Must specify ssh key file to import, or specify '-' for stdin." -elif [ "$sshKeyFile" = '-' ] ; then +if [ "$sshKeyFile" = '-' ] ; then log verbose "importing ssh key from stdin..." PEM2OPENPGP_USAGE_FLAGS=authenticate pem2openpgp "$userID" \ | gpg_host --import |