X-Git-Url: https://codewiz.org/gitweb?a=blobdiff_plain;f=src%2Fsubcommands%2Fmh%2Fgen-key;h=aad213a3cbe272f2a9bc120d7451d99d607de3c3;hb=8001b4523c665ee7d9ded64cbdb7081b023b75c1;hp=37469c712857683e52bfe4dec01255f52c321be3;hpb=f5916bc01d76a54d9c2b1738c15da588021c63f3;p=monkeysphere.git diff --git a/src/subcommands/mh/gen-key b/src/subcommands/mh/gen-key old mode 100755 new mode 100644 index 37469c7..aad213a --- a/src/subcommands/mh/gen-key +++ b/src/subcommands/mh/gen-key @@ -1,20 +1,22 @@ -#!/usr/bin/env bash +# -*-shell-script-*- +# This should be sourced by bash (though we welcome changes to make it POSIX sh compliant) # Monkeysphere host gen-key subcommand # # The monkeysphere scripts are written by: -# Jameson Rollins +# Jameson Rollins # Jamie McClelland # Daniel Kahn Gillmor # -# They are Copyright 2008, and are all released under the GPL, version 3 -# or later. +# They are Copyright 2008-2009, 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 +30,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 +38,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 +63,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 +102,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 + +}