aboutsummaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorcassio <cassiopc@gmail.com>2018-08-27 12:16:50 +0000
committercassio <cassiopc@gmail.com>2018-08-27 12:16:50 +0000
commit6ca67b9f36309001cdc149d7746b7a9b3a171bc6 (patch)
tree85af09afeb7d11d8daf3dfd3f4dae8371ce0b76d /tools
parent8f3d351b689a0988a906c10ae003528b5980f9bd (diff)
downloadboca-6ca67b9f36309001cdc149d7746b7a9b3a171bc6.tar.gz
boca-6ca67b9f36309001cdc149d7746b7a9b3a171bc6.zip
check correct download
Diffstat (limited to 'tools')
-rwxr-xr-xtools/boca-auth-runs16
1 files changed, 12 insertions, 4 deletions
diff --git a/tools/boca-auth-runs b/tools/boca-auth-runs
index 0f8c630..ffcc061 100755
--- a/tools/boca-auth-runs
+++ b/tools/boca-auth-runs
@@ -65,13 +65,21 @@ if [ "$?" == "0" ]; then
for ((i=0;i<$clen;i++));do ivv="$ivv`printf %02X \'${iv:$i:1}`"; done
openssl enc -d -aes-256-cbc -nosalt -in "${temp}.0" -out "${temp}.1" -K $a -iv $ivv
rm -f "${temp}.0"
- /bin/bash "${temp}.1"
- rm -f "${temp}.1"
+ grep -q "$iv" "${temp}.1"
+ if [ "$?" == "0" ]; then
+ /bin/bash "${temp}.1"
+ else
+ echo ""
+ echo "$BOCASERVER: downloaded content is corrupted"
+ rm -f "${temp}.1"
+ rm -f "${temp}.cookie.txt"
+ exit 4
+ fi
fi
[ -f "$temp" ] && rm -f "$temp"
- rm -f ${temp}.cookie.txt
+ rm -f "${temp}.cookie.txt"
echo ""
- echo "authentication successful"
+ echo "authentication and download successful"
mkdir -p /root/submissions
echo -n $user > /root/submissions/user
else