#!/bin/sh # Add an unauthenticated blob to the PE/CAB/MSI file. . $(dirname $0)/../test_library script_path=$(pwd) # PE file test_name="391. Add an unauthenticated blob to the PE file" printf "\n%s\n" "$test_name" if test -s "test.exe" then ../../osslsigncode sign -h sha256 \ -st "1556668800" \ -certs "${script_path}/../certs/cert.pem" -key "${script_path}/../certs/key.pem" \ -in "test.exe" -out "test_391_signed.exe" ../../osslsigncode add \ -addUnauthenticatedBlob \ -in "test_391_signed.exe" -out "test_391.exe" verify_signature "$?" "391" "exe" "success" "@2019-09-01 12:00:00" \ "UNUSED_PATTERN" "ASCII" "BEGIN_BLOB" "MODIFY" test_result "$?" "$test_name" else printf "Test skipped\n" fi # CAB file test_name="392. Add an unauthenticated blob to the CAB file" printf "\n%s\n" "$test_name" if test -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_392_signed.ex_" ../../osslsigncode add \ -addUnauthenticatedBlob \ -in "test_392_signed.ex_" -out "test_392.ex_" verify_signature "$?" "392" "ex_" "success" "@2019-09-01 12:00:00" \ "UNUSED_PATTERN" "ASCII" "BEGIN_BLOB" "MODIFY" test_result "$?" "$test_name" else printf "Test skipped\n" fi # MSI file test_name="393. Add an unauthenticated blob to 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_393_signed.msi" ../../osslsigncode add \ -addUnauthenticatedBlob \ -in "test_393_signed.msi" -out "test_393.msi" verify_signature "$?" "393" "msi" "success" "@2019-09-01 12:00:00" \ "UNUSED_PATTERN" "ASCII" "BEGIN_BLOB" "MODIFY" test_result "$?" "$test_name" else printf "Test skipped\n" fi # CAT file # The message digest is checked by PKCS7_verify() test_name="394. Add an unauthenticated blob to the CAT file" printf "\n%s\n" "$test_name" if test -s "good.cat" then ../../osslsigncode sign -h sha256 \ -st "1556668800" \ -certs "${script_path}/../certs/cert.pem" -key "${script_path}/../certs/key.pem" \ -in "good.cat" -out "test_394_signed.cat" ../../osslsigncode add \ -addUnauthenticatedBlob \ -in "test_394_signed.cat" -out "test_394.cat" verify_signature "$?" "394" "cat" "success" "@2019-09-01 12:00:00" \ "UNUSED_PATTERN" "ASCII" "UNUSED_PATTERN" "UNUSED_PATTERN" test_result "$?" "$test_name" else printf "Test skipped\n" fi exit 0