mirror of
https://github.com/stefanberger/libtpms
synced 2025-12-27 15:08:24 +00:00
Add a test case testing the TPMLIB_DecodeBlob function. Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com> Acked-by: Corey Bryant <coreyb@linux.vnet.ibm.com>
19 lines
361 B
Bash
Executable File
19 lines
361 B
Bash
Executable File
#!/bin/bash
|
|
|
|
input=$(mktemp)
|
|
binary=$(mktemp)
|
|
|
|
trap "rm -f $input $binary" EXIT
|
|
|
|
for i in $(seq 1 1024) 2048 10240;
|
|
do
|
|
dd if=/dev/urandom of=$binary bs=1 count=$i &>/dev/null
|
|
echo "-----BEGIN INITSTATE-----" > $input
|
|
base64 < $binary >> $input
|
|
echo "-----END INITSTATE-----" >> $input
|
|
./base64decode $input $binary
|
|
if [ $? -ne 0 ]; then
|
|
exit 1
|
|
fi
|
|
done
|