From 683980933599a4c68b771ee4fac69de8d67d98e6 Mon Sep 17 00:00:00 2001 From: rjaeckel Date: Sun, 31 Jan 2016 23:17:09 +0100 Subject: [PATCH] force to read last line of encrypted file --- ocdec.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ocdec.sh b/ocdec.sh index cd648e2..3ba919c 100755 --- a/ocdec.sh +++ b/ocdec.sh @@ -130,7 +130,7 @@ function decryptFile() { # --- Decrypt the file --- # OC writes the encrypted file in 8K chunks, each containing it's own iv in the end chunkSize=8192 - while read -d '' -n $chunkSize CHUNK; do + while read -d '' -n $chunkSize CHUNK || [ -n "$CHUNK" ]; do #split chunk into payload an iv string (strip padding from iv) read payload iv <<<`echo $CHUNK | sed -r 's/(.*)00iv00(.{16})xx/\1 \2/'` # convert base64 iv into hex