From 4052dae78bfc9dd9f960ecf839961652ed919c0d Mon Sep 17 00:00:00 2001 From: Neale Pickett Date: Fri, 18 May 2012 22:03:53 -0600 Subject: [PATCH] Make OpenWRT work, save nonce in addteam --- doc/openwrt/README | 10 ++++++++-- packages/mcp/bin/addteam | 5 ++++- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/doc/openwrt/README b/doc/openwrt/README index ca6cdad..7e50721 100644 --- a/doc/openwrt/README +++ b/doc/openwrt/README @@ -20,7 +20,13 @@ Instructions for setting up OpenWRT After installing OpenWRT: * Change the root password -* Install the kmod-ipv6, radvd, and luci-app-radvd packages +* Install the following packages: + ip6tables + kmod-ip6tables + kmod-ipv6 + libip6tc + luci-app-radvd + radvd * Configure the LAN interface as 10.0.0.1/16 and fd84:b410:3441::1/64 * Tell DHCP to begin at 257 after the base IP: this will assure @@ -28,7 +34,7 @@ After installing OpenWRT: * Disable router solicitations on LAN * Enable WPA2, with the password "correct horse battery staple" * Turn on router advertisements (under radvd) on LAN -* Enable prefix fd84:b410:3441::1/54 under radvd +* Enable prefix fd84:b410:3441::1/64 under radvd This should be sufficient to bring up the router for running the contest. If you want to get fancy, you can scp the files in diff --git a/packages/mcp/bin/addteam b/packages/mcp/bin/addteam index e936f01..580dd55 100755 --- a/packages/mcp/bin/addteam +++ b/packages/mcp/bin/addteam @@ -20,6 +20,9 @@ www=${CTF_BASE:-/var/www} mkdir -p $base/teams/names mkdir -p $base/teams/colors +[ -f $base/teams/nonce ] || dd if=/dev/urandom count=1 | md5sum | cut -b 1-8 > $base/teams/nonce +nonce=$(cat $base/teams/nonce) + # Assign a color. I spent weeks selecting a color pallette that # wouldn't be hell on people with protanopia. Please don't change these # colors. @@ -45,7 +48,7 @@ esac # Compute hash of team name; they'll use this for everything in the # contest instead of their team name, which makes stuff much easier on # me since all team hashes are in the set /[0-9a-f]{8}/. -hash=$(dd if=/dev/urandom count=1 2>/dev/null | md5sum | cut -b 1-8) +hash=$(printf "%s:%s" $nonce "$1" | md5sum | cut -b 1-8) echo "$1" > $base/teams/names/$hash echo "$color" > $base/teams/colors/$hash