X-Git-Url: https://codewiz.org/gitweb?a=blobdiff_plain;f=src%2Fsubcommands%2Fmh%2Fgen-key;h=aad213a3cbe272f2a9bc120d7451d99d607de3c3;hb=8001b4523c665ee7d9ded64cbdb7081b023b75c1;hp=da2e40d3f84b43250ef0f482101aff40869d14de;hpb=a0747749cbc7445e0cadaf0fbf1c92a2e86d1369;p=monkeysphere.git diff --git a/src/subcommands/mh/gen-key b/src/subcommands/mh/gen-key old mode 100755 new mode 100644 index da2e40d..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" @@ -116,3 +103,5 @@ log info "SSH host public key in OpenPGP form: ${SYSDATADIR}/ssh_host_rsa_key.pu # show info about new key show_key + +}