Frederic Crozat
7d754a1d6f
- Update microsoft.asc: shim signed by UEFI signing service, based on code from "Fri Sep 6 13:57:36 UTC 2013". - Improve extract_signature.sh to work on current path. OBS-URL: https://build.opensuse.org/request/show/199366 OBS-URL: https://build.opensuse.org/package/show/devel:openSUSE:Factory/shim?expand=0&rev=44
25 lines
447 B
Bash
25 lines
447 B
Bash
#!/bin/bash
|
|
# extract ascii armored signature from a PE binary
|
|
set -e
|
|
|
|
infile="$1"
|
|
|
|
if [ -z "$infile" -o ! -e "$infile" ]; then
|
|
echo "USAGE: $0 file.efi"
|
|
exit 1
|
|
fi
|
|
|
|
nssdir=`mktemp -d`
|
|
cleanup()
|
|
{
|
|
rm -r "$nssdir"
|
|
}
|
|
trap cleanup EXIT
|
|
echo > "$nssdir/pw"
|
|
certutil -f "$nssdir/pw" -d "$nssdir" -N
|
|
|
|
# wtf?
|
|
(pesign -n "$nssdir" -h -P -i "$infile";
|
|
perl $(dirname $0)/timestamp.pl "$infile";
|
|
pesign -n "$nssdir" -a -f -e /dev/stdout -i "$infile")|cat
|