chiark
/
gitweb
/
~mdw
/
distorted-keys
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
keyfunc.sh.in, keys.reveal: Factor out sharing parameter file parsing.
[distorted-keys]
/
keys.stash
diff --git
a/keys.stash
b/keys.stash
index baf6f22773b1215055d93a216e096813afcaf633..ef800822cc6c3e9f05a7bd95d2feee2c059e68b1 100755
(executable)
--- a/
keys.stash
+++ b/
keys.stash
@@
-28,27
+28,22
@@
case "${KEYSLIB+t}" in t) ;; *) echo >&2 "$0: KEYSLIB unset"; exit 1 ;; esac
. "$KEYSLIB"/keyfunc.sh
defhelp <<HELP
. "$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'
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.
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
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 --------------------------------------------------
stash $recov $label <$tmp/secret
###----- That's all, folks --------------------------------------------------