3 if {[llength $argv] != 4} {
4 puts stderr "Usage: $argv0 certdir token cert filename"
8 lassign $argv certdir token cert filename
10 set pin $::env(PESIGN_PIN)
12 file tempfile output efi.sig
15 spawn pesign --certdir "$certdir" -t "$token" -c "$cert" --sign -d sha256 -i "$filename" --export-signature "$output" --force
21 "Enter passphrase *:" {
27 lassign [wait] wait_pid spawn_id exec_rc wait_code childkilled
28 # couldn't exec pesign
33 # killed by signal (e.g. timeout)
34 if {$childkilled == "CHILDKILLED"} {
39 if {$wait_code == 0} {system cat $output}