~mdw
/
distorted-keys
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
extract-profile: Add manpage.
[distorted-keys]
/
keys.stash
diff --git
a/keys.stash
b/keys.stash
index
59eeabf
..
ef80082
100755
(executable)
--- a/
keys.stash
+++ b/
keys.stash
@@
-1,4
+1,4
@@
-#
## -*-sh-*-
+#
! /bin/sh
###
### Stash a recovery blob of a secret
###
###
### 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
. "$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 --------------------------------------------------