Commit 0d728bb7 authored by Nils Goroll's avatar Nils Goroll

bite the bullet and declare all generated test input files to automake

This will leave a bit less of a mess, yet the build system is still
not entirely connect, for instance, out-of-tree builds will not work.
parent bbe1d269
...@@ -44,8 +44,6 @@ VARNISH_VMODS([crypto]) ...@@ -44,8 +44,6 @@ VARNISH_VMODS([crypto])
AC_CONFIG_FILES([ AC_CONFIG_FILES([
Makefile Makefile
src/Makefile src/Makefile
src/vtc/sigs/Makefile
src/vtc/data/Makefile
]) ])
AC_OUTPUT AC_OUTPUT
......
This diff is collapsed.
...@@ -2,6 +2,8 @@ ...@@ -2,6 +2,8 @@
set -eux set -eux
cd $(dirname $0)
typeset -air sz=( typeset -air sz=(
11 11
83 83
...@@ -17,15 +19,32 @@ typeset -air sz=( ...@@ -17,15 +19,32 @@ typeset -air sz=(
for i in ${sz[@]} ; do for i in ${sz[@]} ; do
blk=$(((i + 16) & ~15)) blk=$(((i + 16) & ~15))
[[ -f ${i} ]] || \
if [[ -f ${i} ]] ; then
touch ${i}
else
dd if=/dev/zero bs=${blk} count=1 | \ dd if=/dev/zero bs=${blk} count=1 | \
openssl aes-128-cbc -k $i -nosalt -nopad | \ openssl aes-128-cbc -k $i -nosalt -nopad | \
dd of=${i} bs=${i} count=1 dd of=${i} bs=${i} count=1
[[ -f ${i}.b64 ]] || \ fi
if [[ -f ${i}.b64 ]] ; then
touch ${i}.b64
else
base64 ${i} >${i}.b64 base64 ${i} >${i}.b64
fi
j=$((i / 2)) j=$((i / 2))
[[ -f ${i}_${j} ]] || \
if [[ -f ${i}_${j} ]] ; then
touch ${i}_${j}
else
dd if=${i} of=${i}_${j} bs=${j} count=1 dd if=${i} of=${i}_${j} bs=${j} count=1
[[ -f ${i}_${j}.b64 ]] || \ fi
if [[ -f ${i}_${j}.b64 ]] ; then
touch ${i}_${j}.b64
else
base64 ${i}_${j} >${i}_${j}.b64 base64 ${i}_${j} >${i}_${j}.b64
fi
done done
...@@ -35,7 +35,9 @@ function gensig() { ...@@ -35,7 +35,9 @@ function gensig() {
d=${alg}_${bits}.pem d=${alg}_${bits}.pem
e=${alg}_${bits}.pub.pem e=${alg}_${bits}.pub.pem
f=${alg}_${bits}_${md}_${len}.sig f=${alg}_${bits}_${md}_${len}.sig
if ! [[ -f ${f} ]] ; then if [[ -f ${f} ]] ; then
touch ${f}
else
if ! ( rm -f ${f}.b64; if ! ( rm -f ${f}.b64;
openssl dgst -${md} -sign ../keys/${d} -out ${f} \ openssl dgst -${md} -sign ../keys/${d} -out ${f} \
../data/${len} && \ ../data/${len} && \
...@@ -46,21 +48,27 @@ function gensig() { ...@@ -46,21 +48,27 @@ function gensig() {
return 1 return 1
fi fi
fi fi
[[ -f ${f}.b64 ]] || \ if [[ -f ${f}.b64 ]] ; then
touch ${f}.b64
else
base64 ${f} >${f}.b64 base64 ${f} >${f}.b64
fi
} }
function genvtc { function genvtc {
f=../${alg}_${bits}_${md}_${l1}.vtc f=../${alg}_${bits}_${md}_${l1}.vtc
half=$((l1 / 2)) half=$((l1 / 2))
[[ -f ${f} ]] || \ if [[ -f ${f} ]] ; then
touch ${f}
else
sed <../vmod_crypto.tpl >${f} \ sed <../vmod_crypto.tpl >${f} \
-e "s:§{ALG}:${alg}:g" \ -e "s:§{ALG}:${alg}:g" \
-e "s:§{BITS}:${bits}:g" \ -e "s:§{BITS}:${bits}:g" \
-e "s:§{MD}:${md}:g" \ -e "s:§{MD}:${md}:g" \
-e "s:§{LEN}:${l1}:g" \ -e "s:§{LEN}:${l1}:g" \
-e "s:§{HALF}:${half}:g" -e "s:§{HALF}:${half}:g"
fi
} }
for l1 in ${lens[@]} ; do for l1 in ${lens[@]} ; do
for md in ${mds[@]} ; do for md in ${mds[@]} ; do
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment