mirror of
https://github.com/mtrojnar/osslsigncode.git
synced 2025-07-02 11:12:49 -05:00
New tests for osslsigncode (#11)
This commit is contained in:

committed by
Michał Trojnara

parent
4c44cfdd76
commit
3645ba7357
49
tests/recipes/36_add_signature_blob
Normal file
49
tests/recipes/36_add_signature_blob
Normal file
@ -0,0 +1,49 @@
|
||||
#!/bin/sh
|
||||
# Moving the authenticode signing with addUnauthenticatedBlob to the PE/MSI file.
|
||||
|
||||
. $(dirname $0)/../test_library
|
||||
|
||||
# PE file
|
||||
test_name="361. Moving the authenticode signing with addUnauthenticatedBlob to the PE file"
|
||||
printf "\n%s\n" "$test_name"
|
||||
if [ -s "test.exe" ]
|
||||
then
|
||||
cat "test.exe" > "test_361.exe"
|
||||
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_361_signed.exe" && \
|
||||
../../osslsigncode add \
|
||||
-addUnauthenticatedBlob \
|
||||
-in "test_361_signed.exe" -out "test_361.exe"'
|
||||
verify_text "$?" "361" "exe" "BEGIN_BLOB" "ASCII" "UNUSED_PATTERN" "MODIFY"
|
||||
test_result "$?" "$test_name"
|
||||
else
|
||||
printf "Test skipped\n"
|
||||
fi
|
||||
|
||||
# CAB file
|
||||
# Command is not supported for non-PE
|
||||
|
||||
# MSI file
|
||||
test_name="362. Moving the authenticode signing with addUnauthenticatedBlob to the MSI file"
|
||||
printf "\n%s\n" "$test_name"
|
||||
if [ -s "sample.msi" ]
|
||||
then
|
||||
cat "sample.msi" > "test_362.msi"
|
||||
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_362_signed.msi" && \
|
||||
../../osslsigncode add \
|
||||
-addUnauthenticatedBlob \
|
||||
-in "test_362_signed.msi" -out "test_362.msi"'
|
||||
verify_text "$?" "362" "msi" "BEGIN_BLOB" "ASCII" "UNUSED_PATTERN" "MODIFY"
|
||||
test_result "$?" "$test_name"
|
||||
else
|
||||
printf "Test skipped\n"
|
||||
fi
|
||||
|
||||
exit 0
|
Reference in New Issue
Block a user