diff options
| author | cassio <cassiopc@gmail.com> | 2018-08-27 14:34:30 +0000 |
|---|---|---|
| committer | cassio <cassiopc@gmail.com> | 2018-08-27 14:34:30 +0000 |
| commit | e2a898ab9f88010a14da14b54a9809ba2c6e17ab (patch) | |
| tree | 4c8a953ad0d77a8ea9a9a10d016bfaaa6e811b4d /tools | |
| parent | 6ca67b9f36309001cdc149d7746b7a9b3a171bc6 (diff) | |
| download | boca-e2a898ab9f88010a14da14b54a9809ba2c6e17ab.tar.gz boca-e2a898ab9f88010a14da14b54a9809ba2c6e17ab.zip | |
bug in openssl_encrypt? options cannot take padding
Diffstat (limited to 'tools')
| -rwxr-xr-x | tools/boca-auth-runs | 26 |
1 files changed, 17 insertions, 9 deletions
diff --git a/tools/boca-auth-runs b/tools/boca-auth-runs index ffcc061..63bc6b3 100755 --- a/tools/boca-auth-runs +++ b/tools/boca-auth-runs @@ -59,15 +59,23 @@ if [ "$?" == "0" ]; then ivv="" iv=$(head -n1 "$temp" | cut -d':' -f1) clen=$(head -n1 "$temp" | cut -d':' -f2) - tail -n +2 "$temp" > "${temp}.0" - rm -f "$temp" - for ((i=0;i<32;i++));do a="$a`printf %02X \'${ress:$i:1}`"; done - 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" - grep -q "$iv" "${temp}.1" - if [ "$?" == "0" ]; then - /bin/bash "${temp}.1" + if [ "$clen" -eq "$clen" ] 2>/dev/null; then + tail -n +2 "$temp" > "${temp}.0" + rm -f "$temp" + for ((i=0;i<32;i++));do a="$a`printf %02X \'${ress:$i:1}`"; done + 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" + 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 else echo "" echo "$BOCASERVER: downloaded content is corrupted" |