Skip to content

Commit a95363f

Browse files
committed
remove the need for CERT_PWD
1 parent be1a0b9 commit a95363f

File tree

3 files changed

+8
-26
lines changed

3 files changed

+8
-26
lines changed

do/build.go

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -383,13 +383,6 @@ func signFilesMust(dir string) {
383383
signMust(filepath.Join(dir, "SumatraPDF-dll.exe"))
384384
}
385385

386-
func signFilesOptional(dir string) {
387-
if !hasCertPwd() {
388-
return
389-
}
390-
signFilesMust(dir)
391-
}
392-
393386
const (
394387
kPlatformIntel32 = "Win32"
395388
kPlatformIntel64 = "x64"
@@ -632,7 +625,6 @@ func buildSmoke() {
632625

633626
// p := fmt.Sprintf(`/p:Configuration=%s;Platform=%s`, config, platform)
634627
// runExeLoggedMust(msbuildPath, slnPath, `/t:SumatraPDF`, p, `/m`)
635-
// signFilesOptional(dir)
636628
// }
637629

638630
func buildTestUtil() {

do/main.go

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ var (
2020
b2Access string
2121
b2Secret string
2222
transUploadSecret string
23-
certPwd string
2423
)
2524

2625
func loadSecrets() bool {
@@ -49,7 +48,6 @@ func loadSecrets() bool {
4948
getEnv("BB_ACCESS", &b2Access, 8)
5049
getEnv("BB_SECRET", &b2Secret, 8)
5150
getEnv("TRANS_UPLOAD_SECRET", &transUploadSecret, 4)
52-
getEnv("CERT_PWD", &certPwd, 4)
5351
return true
5452
}
5553

@@ -69,7 +67,6 @@ func getSecrets() {
6967
b2Access = os.Getenv("BB_ACCESS")
7068
b2Secret = os.Getenv("BB_SECRET")
7169
transUploadSecret = os.Getenv("TRANS_UPLOAD_SECRET")
72-
certPwd = os.Getenv("CERT_PWD")
7370
}
7471

7572
func regenPremake() {
@@ -190,9 +187,6 @@ func ensureBuildOptionsPreRequesites(opts *BuildOptions) {
190187
ensureAllUploadCreds()
191188
}
192189

193-
if opts.sign {
194-
panicIf(!hasCertPwd(), "CERT_PWD env variable is not set")
195-
}
196190
if opts.verifyTranslationUpToDate {
197191
verifyTranslationsMust()
198192
}

do/sign.go

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,12 @@ func runCmdLoggedRedacted(cmd *exec.Cmd, redact string) error {
1818
return cmd.Run()
1919
}
2020

21-
func hasCertPwd() bool {
22-
return strings.TrimSpace(certPwd) != ""
21+
func runCmdLogged(cmd *exec.Cmd) error {
22+
cmd.Stdout = os.Stdout
23+
cmd.Stderr = os.Stderr
24+
s := cmd.String()
25+
fmt.Printf("> %s\n", s)
26+
return cmd.Run()
2327
}
2428

2529
// https://zabkat.com/blog/code-signing-sha1-armageddon.htm
@@ -38,15 +42,6 @@ func signMust(path string) {
3842
// the sign tool is finicky, so copy the cert to the same dir as
3943
// the exe we're signing
4044

41-
if false {
42-
if certPwd == "" {
43-
if flgSkipSign {
44-
return
45-
}
46-
}
47-
panicIf(certPwd == "", "CERT_PWD env variable not set")
48-
}
49-
5045
// retry 3 times because signing might fail due to temorary error
5146
// ("The specified timestamp server either could not be reached or")
5247
var err error
@@ -67,10 +62,11 @@ func signMust(path string) {
6762
"/fd", "sha256",
6863
fileName)
6964
cmd.Dir = fileDir
70-
err = runCmdLoggedRedacted(cmd, certPwd)
65+
err = runCmdLogged(cmd)
7166
}
7267

7368
if false && err == nil {
69+
certPwd := ""
7470
// double-sign with sha2 for win7+ ater Jan 2016
7571
cmd := exec.Command(signtoolPath, "sign", "/fd", "sha256", "/tr", signServer,
7672
"/td", "sha256", "/f", "cert.pfx",

0 commit comments

Comments
 (0)