Skip to content

Commit dec684b

Browse files
committed
Add debug logging for signature key parsing and handle newline escape sequences
1 parent a5be7b6 commit dec684b

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

main.go

+7-2
Original file line numberDiff line numberDiff line change
@@ -285,9 +285,12 @@ func loop() {
285285
if len(*signatureKey) == 0 {
286286
log.Panicf("signature public key cannot be empty")
287287
}
288-
signaturePubKey, err := utilities.ParseRsaPublicKey(*signatureKey)
288+
fmt.Println("Signature key:", *signatureKey)
289+
290+
// when a public key is read fro the .ini file, the '\n' are escape with an additional '\', we need to replace them with '\n'
291+
signaturePubKey, err := utilities.ParseRsaPublicKey(strings.ReplaceAll(*signatureKey, "\\n", "\n"))
289292
if err != nil {
290-
log.Panicf("cannot parse signature key: %s", err)
293+
log.Panicf("cannot parse signature key '%s'. %s", *signatureKey, err)
291294
}
292295

293296
// Instantiate Index and Tools
@@ -539,6 +542,8 @@ func parseIni(filename string) (args []string, err error) {
539542
return nil, err
540543
}
541544

545+
fmt.Println("Sections:", cfg.Sections())
546+
542547
for _, section := range cfg.Sections() {
543548
for key, val := range section.KeysHash() {
544549
// Ignore launchself

0 commit comments

Comments
 (0)