X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~mdw/git/distorted-keys/blobdiff_plain/ae0eb8989b3100de7b410f0cbffbee48495b9591..f8e6a4ac12a167cdcc07efd086fdbb870b72d89f:/keys.reveal diff --git a/keys.reveal b/keys.reveal index 9270b55..c0b2a58 100755 --- a/keys.reveal +++ b/keys.reveal @@ -51,12 +51,12 @@ checkword "recovery key" "$recov" checkword "keeper set label" "$keeper" ## Check that this is a sensible thing to do. -kdir=$KEYS/keeper/$keeper -if [ ! -f $kdir/meta ]; then +keepdir=$KEYS/keeper/$keeper +if [ ! -f $keepdir/meta ]; then echo >&2 "$quis: unknown keeper set \`$keeper'" exit 1 fi -if [ ! -l $KEYS/recov/$recov/current ]; then +if [ ! -h $KEYS/recov/$recov/current ]; then echo >&2 "$quis: unknown recovery key \`$recov'" exit 1 fi @@ -74,17 +74,17 @@ cat >$tmp/secret t=$(sharethresh $rdir/$keeper.param) ## Find out which keeper index it corresponds to. -read n hunoz <$kdir/meta +read n hunoz <$keepdir/meta i=0 -foundp=nil +foundnubp=nil while [ $i -lt $n ]; do - c_sysprepare $kdir/$i + c_sysprepare $keepdir/$i nubbin=$(nubid <$tmp/secret) - nubid=$(cat $kdir/$i/nubid) - case "$nubbin" in "$nubid") foundp=t; break ;; esac + nubid=$(cat $keepdir/$i/nubid) + case "$nubbin" in "$nubid") foundnubp=t; break ;; esac i=$(( $i + 1 )) done -case $foundp in +case $foundnubp in nil) echo >&2 "$quis: nub doesn't match keeper \`$keeper'"; exit 1 ;; esac @@ -106,7 +106,7 @@ umask 077 if [ -f $keeper.$i.share ]; then echo >&2 "$quis: share $i already revealed" else - c_sysdecrypt $kdir/$i $tmp/secret \ + c_sysdecrypt $keepdir/$i $tmp/secret \ <$rdir/$keeper.$i.share \ >$keeper.$i.new mv $keeper.$i.new $keeper.$i.share