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
# Attach the signature to the PE/MSI file.
# Attach the signature to the PE/CAB/MSI file.
. $(dirname $0)/../test_library
script_path=$(pwd)
@ -21,18 +21,31 @@ if test -s "test.exe"
fi
# CAB file
# Command is not supported for non-PE/non-MSI files
test_name="322. Attach the signature to the CAB file"
printf "\n%s\n" "$test_name"
if [ -s "test.ex_" ]
then
../../osslsigncode attach-signature -sigin "sign_cab.pem" \
-CAfile "${script_path}/../certs/CACert.pem" \
-CRLfile "${script_path}/../certs/CACertCRL.pem" \
-in "test.ex_" -out "test_322.ex_"
verify_signature "$?" "322" "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="322. Attach the signature to the MSI file"
test_name="323. Attach the signature to the MSI file"
printf "\n%s\n" "$test_name"
if test -s "sample.msi"
then
../../osslsigncode attach-signature -sigin "sign_msi.pem" \
-CAfile "${script_path}/../certs/CACert.pem" \
-CRLfile "${script_path}/../certs/CACertCRL.pem" \
-in "sample.msi" -out "test_322.msi"
verify_signature "$?" "322" "msi" "success" "@2019-09-01 12:00:00" \
-in "sample.msi" -out "test_323.msi"
verify_signature "$?" "323" "msi" "success" "@2019-09-01 12:00:00" \
"sha256sum" "ASCII" "osslsigncode" "UNUSED_PATTERN"
test_result "$?" "$test_name"
else