chiark / gitweb /
profile.d/00base: Make `%FOO-secrecy' include the right base sections.
[distorted-keys] / keys.reveal
index a93ec9050ff6d43e821c8549bc000aed5cee9bdc..f11a59b7bbe12c8651853adc8b6eda3500297361 100755 (executable)
@@ -28,19 +28,15 @@ case "${KEYSLIB+t}" in t) ;; *) echo >&2 "$0: KEYSLIB unset"; exit 1 ;; esac
 . "$KEYSLIB"/keyfunc.sh
 
 defhelp <<HELP
-RECOV KEEPER [NUB]
+RECOV KEEPER
 Reveal a share of a recovery key distributed among keepers.
 
 If enough shares have been revealed, reconstruct the recovery private key.
-The keeper nub is read from NUB, or stdin if NUB is omitted or \`-'.
+The keeper nub 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 keeper=$2; shift 2
 checklabel "recovery key" "$recov"
 case "$recov" in
@@ -65,7 +61,7 @@ fi
 
 ## Grab the key, because we'll need to read it several times.
 mktmp
-cat -- "$@" >$tmp/secret
+cat >$tmp/secret
 
 ## Read the threshold from the recovery metadata.
 read param <$KEYS/recov/$recov/$keeper.param
@@ -133,7 +129,7 @@ if [ $n -lt $t ]; then
   echo >&2 "$quis: share $i revealed; $(( $t - $n )) more required"
 else
   cat $KEYS/recov/$recov/$keeper.param $keeper.*.share >$keeper.shares
-  shamir recover <$keeper.shares >nub.new
+  $bindir/shamir recover <$keeper.shares >nub.new
   c_sysprepare $KEYS/recov/$recov/store
   nubbin=$(nubid <nub.new)
   nubid=$(cat $KEYS/recov/$recov/store/nubid)