#!/bin/sh # Verify PE/MSI file signature after the cert has been expired. . $(dirname $0)/../test_library # PE file test_name="511. Verify PE file signature after the cert has been expired" printf "\n%s\n" "$test_name" if [ -s "test.exe" ] then TZ=GMT faketime -f '@2019-05-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_511.exe" 2>> "results.log" 1>&2' verify_signature "$?" "511" "exe" "fail" "@2025-01-01 12:00:00" \ "UNUSED_PATTERN" "UNUSED_PATTERN" "UNUSED_PATTERN" "UNUSED_PATTERN" test_result "$?" "$test_name" else printf "Test skipped\n" fi # CAB file # Command is not supported for non-PE/non-MSI files # MSI file test_name="513. Verify MSI file signature after the cert has been expired" printf "\n%s\n" "$test_name" if [ -s "sample.msi" ] then TZ=GMT faketime -f '@2019-05-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_513.msi"' verify_signature "$?" "513" "msi" "fail" "@2025-01-01 12:00:00" \ "UNUSED_PATTERN" "UNUSED_PATTERN" "UNUSED_PATTERN" "UNUSED_PATTERN" test_result "$?" "$test_name" else printf "Test skipped\n" fi exit 0