#!/bin/sh
# Generate page hashes for a PE file

. $(dirname $0)/../test_library
script_path=$(pwd)

# PE file
test_name="091. Generate page hashes for a PE file"
printf "\n%s\n" "$test_name"
if test -s "test.exe"
  then
    ../../osslsigncode sign -h sha256 -ph \
        -st "1556668800" \
        -certs "${script_path}/../certs/cert.pem" -key "${script_path}/../certs/key.pem" \
        -in "test.exe" -out "test_091.exe"
    verify_signature "$?" "091" "exe" "success" "@2019-09-01 12:00:00" \
	"UNUSED_PATTERN" "ASCII" "osslsigncode" "UNUSED_PATTERN"
    test_result "$?" "$test_name"
  else
    printf "Test skipped\n"
  fi

# CAB file
# Warning: -ph option is only valid for PE files

# MSI file
# Warning: -ph option is only valid for PE files

exit 0
