Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,13 @@
- fixed heap out-of-bounds reads when parsing malformed APPX ZIP64 extra fields
- fixed heap out-of-bounds reads when verifying malformed PKCS#7 signature attributes
- fixed undefined behavior when copying an empty MSI signature blob
- fixed RFC 3161 timestamp verification accepting tokens whose message
imprint is empty or shorter than its digest, which did not bind them to
the signature
- added multiple timestamp support: `add` preserves existing timestamps and
`-timestamp-all` requires every specified Authenticode/RFC 3161 server
- verification now tries all timestamps and accepts any trusted timestamp for
which the Authenticode signature also validates at the timestamp's time

### 2.14 (2026.07.20)

Expand Down
14 changes: 14 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,20 @@ or if you want to add a timestamp as well:
-t http://timestamp.digicert.com \
-in yourapp.exe -out yourapp-signed.exe
```
To require multiple timestamps, use `-timestamp-all` with repeated `-ts` or
`-t` options (both protocols may be combined):
```
osslsigncode add -timestamp-all \
-ts https://tsa1.example.com/ -ts https://tsa2.example.com/ \
-in yourapp-signed.exe -out yourapp-multistamped.exe
```
Every requested server must succeed. Without `-timestamp-all`, repeated URLs
remain fallback servers, stopping after the first success. `add` preserves
existing timestamps. Verification succeeds if at least one trusted timestamp
and the signing certificate/signature validate at that timestamp's time;
invalid alternatives do not invalidate a valid pair. Use `-ignore-timestamp`
to verify at the requested/current time instead.

You can use a certificate and key stored in a PKCS#12 container:
```
osslsigncode sign -pkcs12 <pkcs12-file> -pass <pkcs12-password> \
Expand Down
27 changes: 27 additions & 0 deletions cmake/CMakeTest.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -544,6 +544,20 @@ if(Python3_FOUND AND NOT cryptography_error)
endforeach(cert ${pem_certs})
endforeach(ext ${extensions_all})

# Append two more RFC3161 timestamps to the existing one
add_test(NAME "add_ts_all_exe"
COMMAND ${Python3_EXECUTABLE} ${EXEC} ${OSSLSIGNCODE} "add"
"-timestamp-all"
"-ts" "FILE ${LOGS}/url.log"
"-ts" "FILE ${LOGS}/url.log"
"-in" "${FILES}/ts_cert.exe"
"-out" "${FILES}/ts_all.exe")
set_tests_properties("add_ts_all_exe" PROPERTIES
ENVIRONMENT "HTTP_PROXY=;http_proxy="
DEPENDS "sign_ts_cert_exe"
RESOURCE_LOCK "tsa")
list(APPEND ALL_TESTS "add_ts_all_exe")


### Verify Time-Stamp Authority ###

Expand All @@ -561,6 +575,18 @@ if(Python3_FOUND AND NOT cryptography_error)
list(APPEND ALL_TESTS "verify_ts_cert_${ext}")
endforeach(ext ${extensions_all})

# Verify a signature with multiple timestamps
add_test(NAME "verify_ts_all_exe"
COMMAND ${Python3_EXECUTABLE} ${EXEC} ${OSSLSIGNCODE} "verify"
"-time" "1567296000" # Signature verification time: Sep 1 00:00:00 2019 GMT
"-CAfile" "${CERTS}/CACert.pem"
"-TSA-CAfile" "${CERTS}/TSACA.pem"
"-in" "${FILES}/ts_all.exe")
set_tests_properties("verify_ts_all_exe" PROPERTIES
ENVIRONMENT "HTTP_PROXY=;http_proxy=;"
DEPENDS "add_ts_all_exe")
list(APPEND ALL_TESTS "verify_ts_all_exe")

# Verify with untrusted Time-Stamp Authority
# This test is expected to fail
foreach(ext ${extensions_all})
Expand Down Expand Up @@ -718,6 +744,7 @@ if(Python3_FOUND AND NOT cryptography_error)
set(OUTPUT_FILES ${OUTPUT_FILES} "${FILES}/jreq.tsq")
set(OUTPUT_FILES ${OUTPUT_FILES} "${FILES}/jresp.tsr")
endforeach(ext ${extensions_all})
set(OUTPUT_FILES ${OUTPUT_FILES} "${FILES}/ts_all.exe")

add_test(NAME "remove_files"
COMMAND ${CMAKE_COMMAND} -E rm -f ${OUTPUT_FILES})
Expand Down
Loading
Loading