mirror of
https://github.com/mtrojnar/osslsigncode.git
synced 2025-04-13 03:48:05 -05:00

* removed pvk keys tests * new 11_sign_nest test * improved verify_signature() * new tests of timestamping with the add command
55 lines
1.9 KiB
Bash
55 lines
1.9 KiB
Bash
#!/bin/sh
|
|
# Signing a PE/CAB/MSI file with the certificate and private key files in the PEM format.
|
|
|
|
. $(dirname $0)/../test_library
|
|
|
|
# PE file
|
|
test_name="011. Signing a PE file with the certificate and private key files in the PEM format"
|
|
printf "\n%s\n" "$test_name"
|
|
if [ -s "test.exe" ]
|
|
then
|
|
faketime -f '@2019-01-01 00:00:00' /bin/bash -c '
|
|
script_path=$(pwd)
|
|
../../osslsigncode sign -h sha256 \
|
|
-certs "${script_path}/../certs/cert.pem" -key "${script_path}/../certs/key.pem" \
|
|
-in "test.exe" -out "test_011.exe"'
|
|
verify_signature "$?" "011" "exe" "UNUSED_PATTERN" "sha256sum" "ASCII" "osslsigncode" "UNUSED_PATTERN"
|
|
test_result "$?" "$test_name"
|
|
else
|
|
printf "Test skipped\n"
|
|
fi
|
|
|
|
# CAB file
|
|
test_name="012. Signing a CAB file with the certificate and private key files in the PEM format"
|
|
printf "\n%s\n" "$test_name"
|
|
if [ -s "test.ex_" ]
|
|
then
|
|
faketime -f '@2019-01-01 00:00:00' /bin/bash -c '
|
|
script_path=$(pwd)
|
|
../../osslsigncode sign -h sha256 \
|
|
-certs "${script_path}/../certs/cert.pem" -key "${script_path}/../certs/key.pem" \
|
|
-in "test.ex_" -out "test_012.ex_"'
|
|
verify_signature "$?" "012" "ex_" "UNUSED_PATTERN" "sha256sum" "ASCII" "osslsigncode" "UNUSED_PATTERN"
|
|
test_result "$?" "$test_name"
|
|
else
|
|
printf "Test skipped\n"
|
|
fi
|
|
|
|
# MSI file
|
|
test_name="013. Signing a MSI file with the certificate and private key files in the PEM format"
|
|
printf "\n%s\n" "$test_name"
|
|
if [ -s "sample.msi" ]
|
|
then
|
|
faketime -f '@2019-01-01 00:00:00' /bin/bash -c '
|
|
script_path=$(pwd)
|
|
../../osslsigncode sign -h sha256 \
|
|
-certs "${script_path}/../certs/cert.pem" -key "${script_path}/../certs/key.pem" \
|
|
-in "sample.msi" -out "test_013.msi"'
|
|
verify_signature "$?" "013" "msi" "UNUSED_PATTERN" "sha256sum" "ASCII" "osslsigncode" "UNUSED_PATTERN"
|
|
test_result "$?" "$test_name"
|
|
else
|
|
printf "Test skipped\n"
|
|
fi
|
|
|
|
exit 0
|