chiark / gitweb /
Remove `--force' from keys.new-keeper; introduce explicit delete command.
[distorted-keys] / keys.stash
index 59eeabff0738ca23add650baa5c9dcc592ba743e..ef800822cc6c3e9f05a7bd95d2feee2c059e68b1 100755 (executable)
@@ -1,4 +1,4 @@
-### -*-sh-*-
+#! /bin/sh
 ###
 ### Stash a recovery blob of a secret
 ###
@@ -28,27 +28,22 @@ case "${KEYSLIB+t}" in t) ;; *) echo >&2 "$0: KEYSLIB unset"; exit 1 ;; esac
 . "$KEYSLIB"/keyfunc.sh
 
 defhelp <<HELP
-RECOV LABEL [SECRET]
+RECOV LABEL
 Store a secret encrypted under the recovery key RECOV.
 
 The LABEL is used to identify the encrypted secret later to the \`recover'
-command.  The secret is read from SECRET, or stdin if SECRET is omitted or
-\`-'.
+command.  The secret is read from stdin.
 HELP
 
 ## Parse the command line.
-case $# in
-  2) if [ -t 0 ]; then echo >&2 "$quis: stdin is a terminal"; exit 1; fi ;;
-  3) ;;
-  *) usage_err ;;
-esac
+case $# in 2) ;; *) usage_err ;; esac
 recov=$1 label=$2; shift 2
 checkword "recovery key label" "$recov"
 checklabel "secret" "$label"
 
 ## Do the thing.
 mktmp
-cat -- "$@" >$tmp/secret
+cat >$tmp/secret
 stash $recov $label <$tmp/secret
 
 ###----- That's all, folks --------------------------------------------------