CAB file tests

This commit is contained in:
olszomal
2020-02-21 14:10:21 +01:00
parent 94f5e0c1bf
commit a56aee3c8f
21 changed files with 297 additions and 97 deletions

View File

@ -1,5 +1,5 @@
#!/bin/sh
# Extract the signature from the PE/MSI file.
# Extract the signature from the PE/CAB/MSI file.
. $(dirname $0)/../test_library
script_path=$(pwd)
@ -23,20 +23,35 @@ if test -s "test.exe"
fi
# CAB file
# Command is not supported for non-PE/non-MSI files
test_name="312. Extract the signature from the CAB file"
printf "\n%s\n" "$test_name"
if [ -s "test.ex_" ]
then
../../osslsigncode sign -h sha256 \
-st "1556668800" \
-certs "${script_path}/../certs/cert.pem" -key "${script_path}/../certs/key.pem" \
-in "test.ex_" -out "test_312.ex_" && \
../../osslsigncode extract-signature -pem \
-in "test_312.ex_" -out "sign_cab.pem"
verify_signature "$?" "312" "ex_" "success" "@2019-09-01 12:00:00" \
"sha256sum" "ASCII" "osslsigncode" "UNUSED_PATTERN"
test_result "$?" "$test_name"
else
printf "Test skipped\n"
fi
# MSI file
test_name="312. Extract the signature from the MSI file"
test_name="313. Extract the signature from the MSI file"
printf "\n%s\n" "$test_name"
if test -s "sample.msi"
then
../../osslsigncode sign -h sha256 \
-st "1556668800" \
-certs "${script_path}/../certs/cert.pem" -key "${script_path}/../certs/key.pem" \
-in "sample.msi" -out "test_312.msi" && \
-in "sample.msi" -out "test_313.msi" && \
../../osslsigncode extract-signature -pem \
-in "test_312.msi" -out "sign_msi.pem"
verify_signature "$?" "312" "msi" "success" "@2019-09-01 12:00:00" \
-in "test_313.msi" -out "sign_msi.pem"
verify_signature "$?" "313" "msi" "success" "@2019-09-01 12:00:00" \
"sha256sum" "ASCII" "osslsigncode" "UNUSED_PATTERN"
test_result "$?" "$test_name"
else