Verified Commit 96d161a5 authored by Silvio Rhatto's avatar Silvio Rhatto
Browse files

Feat(test-keys): symlink tested keys (Closes #21)

parent 9f3ffcc8
......@@ -29,6 +29,7 @@ WAIT="${3:-60}"
NOUNCE="$(echo $RANDOM | sha512sum | awk '{ print $1 }')"
DAEMON_DIR="$POOL/daemon"
SOCKET="$DAEMON_DIR/nc.socket"
TESTED="$POOL/tested"
# Use a random TCP port for the Onion Service
PORT="$(echo $RANDOM)"
......@@ -79,6 +80,13 @@ if [ -z "$CANDIDATE" ]; then
echo ""
ls -1 $CANDIDATES | sed -e 's/^/ /'
echo ""
if [ -d "$TESTED" ]; then
echo "Tested candidates in pool $CONFIG: "
echo ""
ls -1 $TESTED | sed -e 's/^/ /'
echo ""
fi
exit 1
fi
......@@ -136,6 +144,11 @@ fi
# Check if secrets match
if [ "$NOUNCE_OFFERED" == "$NOUNCE" ]; then
echo "Secret sharing matched, Onion Service candidate $CANDIDATE validated!"
# Mark it as tested
mkdir -p $TESTED
cd $TESTED && ln -sf ../candidates/$CANDIDATE
teardown 0
else
echo "Cannot check secrets; expected: $NOUNCE, offered: $NOUNCE_OFFERED"
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment