build: More signatures, more better (ref #3420)

This commit is contained in:
Jakob Borg 2017-11-20 14:54:52 +01:00
parent 0901350087
commit 4a58196959

View File

@ -1098,10 +1098,13 @@ func macosCodesign(file string) {
func windowsCodesign(file string) { func windowsCodesign(file string) {
st := "signtool.exe" st := "signtool.exe"
args := []string{"sign", "/fd", "sha256"}
if path := os.Getenv("CODESIGN_SIGNTOOL"); path != "" { if path := os.Getenv("CODESIGN_SIGNTOOL"); path != "" {
st = path st = path
} }
for i, algo := range []string{"sha1", "sha256"} {
args := []string{"sign", "/fd", algo}
if f := os.Getenv("CODESIGN_CERTIFICATE_FILE"); f != "" { if f := os.Getenv("CODESIGN_CERTIFICATE_FILE"); f != "" {
args = append(args, "/f", f) args = append(args, "/f", f)
} }
@ -1109,7 +1112,15 @@ func windowsCodesign(file string) {
args = append(args, "/p", p) args = append(args, "/p", p)
} }
if tr := os.Getenv("CODESIGN_TIMESTAMP_SERVER"); tr != "" { if tr := os.Getenv("CODESIGN_TIMESTAMP_SERVER"); tr != "" {
args = append(args, "/tr", tr, "/td", "sha256") switch algo {
case "sha256":
args = append(args, "/tr", tr, "/td", algo)
default:
args = append(args, "/t", tr)
}
}
if i > 0 {
args = append(args, "/as")
} }
args = append(args, file) args = append(args, file)
@ -1118,7 +1129,8 @@ func windowsCodesign(file string) {
log.Println("Codesign: signing failed:", string(bs)) log.Println("Codesign: signing failed:", string(bs))
return return
} }
log.Println("Codesign: successfully signed", file) log.Println("Codesign: successfully signed", file, "using", algo)
}
} }
func metalint() { func metalint() {