X-Git-Url: https://codewiz.org/gitweb?a=blobdiff_plain;f=src%2Fsubcommands%2Fmh%2Fgen-key;h=72b913823761d1d099da1df7c5a9817d6a999fe6;hb=585b1c823e7b72f610fb23aeb4fc09f0287a0bdb;hp=37469c712857683e52bfe4dec01255f52c321be3;hpb=53fdf9b3e431d9f3538c1b2196276492bec2fc7e;p=monkeysphere.git diff --git a/src/subcommands/mh/gen-key b/src/subcommands/mh/gen-key index 37469c7..72b9138 100755 --- a/src/subcommands/mh/gen-key +++ b/src/subcommands/mh/gen-key @@ -10,11 +10,12 @@ # They are Copyright 2008, and are all released under the GPL, version 3 # or later. +gen_key() { + local keyType="RSA" local keyLength="2048" local keyUsage="auth" local keyExpire -local revoker local hostName=$(hostname -f) local userID local keyParameters @@ -28,10 +29,6 @@ fingerprint_server_key >/dev/null \ # get options while true ; do case "$1" in - -h|--hostname) - hostName="$2" - shift 2 - ;; -l|--length) keyLength="$2" shift 2 @@ -40,15 +37,13 @@ while true ; do keyExpire="$2" shift 2 ;; - -r|--revoker) - revoker="$2" - shift 2 - ;; *) if [ "$(echo "$1" | cut -c 1)" = '-' ] ; then failure "Unknown option '$1'. Type '$PGRM help' for usage." fi + hostName="$1" + shift; break ;; esac @@ -67,15 +62,6 @@ Key-Usage: $keyUsage Name-Real: $userID Expire-Date: $keyExpire" -# add the revoker field if specified -# FIXME: the "1:" below assumes that $REVOKER's key is an RSA key. -# FIXME: key is marked "sensitive"? is this appropriate? -if [ "$revoker" ] ; then - keyParameters=\ -"${keyParameters} -Revoker: 1:${revoker} sensitive" -fi - echo "The following key parameters will be used for the host private key:" echo "$keyParameters" @@ -115,4 +101,6 @@ gpg_authentication "--export-options export-minimal --armor --export 0x${fingerp log info "SSH host public key in OpenPGP form: ${SYSDATADIR}/ssh_host_rsa_key.pub.gpg" # show info about new key -show_server_key +show_key + +}