aboutsummaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2022-07-31 10:54:00 +0200
committerSven Gothel <[email protected]>2022-07-31 10:54:00 +0200
commitee1dfc1770e45cc7f69e6689d9e901e5693fa1a2 (patch)
tree4b9acebb49504b88b3ee23fc124a533347aae05b /scripts
parent6a2f2b58c3800645dc0027f17020bc41a144b460 (diff)
Adopt to jaulib changes and resolve decrypting error for late zero-size'd is_final no-content-size aware streams using double-buffered read_stream() ...
In contrast to using other buffered solutions, jau::io::read_stream() utilizes the given buffers and hence does not need to copy the data. Further .. cipherpack::hash_util::calc() Use new jau::io::ByteInStream_File(dirfd, path), being robust against directory manipulations and reducing OS lookup ops. Status: - Handling of content-size aware streams and lack thereof is covered - Detection and using file/chr/fifo stream nature is supported.
Diffstat (limited to 'scripts')
-rw-r--r--scripts/build.sh1
-rwxr-xr-xscripts/test_cipherpack_cmdline.sh24
2 files changed, 19 insertions, 6 deletions
diff --git a/scripts/build.sh b/scripts/build.sh
index 71e51a3..68e6fd5 100644
--- a/scripts/build.sh
+++ b/scripts/build.sh
@@ -43,6 +43,7 @@ buildit() {
# cmake $CLANG_ARGS -DCMAKE_INSTALL_PREFIX=$rootdir/$dist_dir -DBUILDJAVA=ON -DBUILDEXAMPLES=ON -DUSE_LIBUNWIND=ON ..
# cmake $CLANG_ARGS -DCMAKE_INSTALL_PREFIX=$rootdir/$dist_dir -DBUILDJAVA=ON -DBUILDEXAMPLES=ON -DBUILD_TESTING=ON -DTEST_WITH_SUDO=ON ..
cmake $CLANG_ARGS -DCMAKE_INSTALL_PREFIX=$rootdir/$dist_dir -DBUILDJAVA=ON -DBUILDEXAMPLES=ON -DBUILD_TESTING=ON -DTEST_WITH_SUDO=ON -DUSE_LIBCURL=ON ..
+ # cmake $CLANG_ARGS -DCMAKE_INSTALL_PREFIX=$rootdir/$dist_dir -DBUILDJAVA=ON -DBUILDEXAMPLES=ON -DBUILD_TESTING=ON -DTEST_WITH_SUDO=ON -DUSE_LIBCURL=ON -DUSE_LIBUNWIND=ON ..
# cmake $CLANG_ARGS -DCMAKE_INSTALL_PREFIX=$rootdir/$dist_dir -DBUILDJAVA=ON -DBUILDEXAMPLES=ON -DBUILD_TESTING=ON -DTEST_WITH_SUDO=ON -DUSE_LIBCURL=ON -DDEBUG=ON ..
make -j $CPU_COUNT install
diff --git a/scripts/test_cipherpack_cmdline.sh b/scripts/test_cipherpack_cmdline.sh
index 8751297..b7b3f17 100755
--- a/scripts/test_cipherpack_cmdline.sh
+++ b/scripts/test_cipherpack_cmdline.sh
@@ -1,9 +1,9 @@
#!/bin/bash
-data_dir_in=../cipherpack_test_data_local
+# export cipherpack_debug=true
+# export cipherpack_verbose=true
-infile=${data_dir_in}/deploy.sqfs
-#infile=${data_dir_in}/data-382MB.bin
+data_dir_in=../cipherpack_test_data_local
sdir=`dirname $(readlink -f $0)`
rootdir=`dirname $sdir`
@@ -41,6 +41,7 @@ cmp_hash_value() {
}
run_test_file01() {
+ infile=$1
#scripts/cipherpack hash -out ${data_dir_out}/test_data_local.phash ${data_dir_in}
#if [ $? -ne 0 ] ; then echo "ERROR test $LINENO"; return 1; fi
@@ -60,6 +61,7 @@ run_test_file01() {
}
run_test_pipe01() {
+ infile=$1
cat ${infile} | scripts/cipherpack pack -epk test_keys/terminal_rsa1.pub.pem -ssk test_keys/host_rsa1 -hashout ${data_dir_out}/t2.orig.phash > ${data_dir_out}/t2.enc
if [ $? -ne 0 ] ; then echo "ERROR test $LINENO"; return 1; fi
cat ${data_dir_out}/t2.enc | scripts/cipherpack unpack -spk test_keys/host_rsa1.pub.pem -dsk test_keys/terminal_rsa1 -hashout ${data_dir_out}/t2.dec.phash > ${data_dir_out}/t2.dec
@@ -75,6 +77,7 @@ run_test_pipe01() {
}
run_test_pipe02() {
+ infile=$1
cat ${infile} | scripts/cipherpack pack -epk test_keys/terminal_rsa1.pub.pem -ssk test_keys/host_rsa1 -hashout ${data_dir_out}/t3.orig.phash | scripts/cipherpack unpack -spk test_keys/host_rsa1.pub.pem -dsk test_keys/terminal_rsa1 -hashout ${data_dir_out}/t3.dec.phash > ${data_dir_out}/t3.dec
if [ $? -ne 0 ] ; then echo "ERROR test $LINENO"; return 1; fi
cmp ${data_dir_out}/t3.dec ${infile}
@@ -83,6 +86,15 @@ run_test_pipe02() {
if [ $? -ne 0 ] ; then echo "ERROR test $LINENO"; return 1; fi
}
-run_test_file01 2>&1 | tee $logfile
-run_test_pipe01 2>&1 | tee $logfile
-run_test_pipe02 2>&1 | tee $logfile
+#${data_dir_in}/data-10kiB.bin
+#${data_dir_in}/data-32752B.bin
+#=${data_dir_in}/data-32768B.bin
+#infile=${data_dir_in}/deploy.sqfs
+#infile=${data_dir_in}/data-382MB.bin
+
+for i in ${data_dir_in}/data-10kiB.bin ${data_dir_in}/data-32752B.bin ${data_dir_in}/data-32768B.bin ${data_dir_in}/deploy.sqfs ; do
+ run_test_file01 $i 2>&1 | tee $logfile
+ run_test_pipe01 $i 2>&1 | tee $logfile
+ run_test_pipe02 $i 2>&1 | tee $logfile
+done
+