This commit is contained in:
Nora Koirala 2024-09-19 09:20:37 -07:00
Родитель 71eed7f112
Коммит b44421e603
1 изменённых файлов: 2 добавлений и 2 удалений

Просмотреть файл

@ -137,7 +137,7 @@ func unmarshalProtectedSettings(configFolder string, hs handlerSettingsCommon, v
//back up smime command in case cms fails
errMsg = fmt.Errorf("decrypting protected settings with cms command failed: error=%v stderr=%s \n now decrypting with smime command", err, string(bErr.Bytes()))
errMsg = fmt.Errorf("decrypting protected settings with cms command failed: error=%v stderr=%s \n now decrypting with smime command", err, bErr.String())
cmd = exec.Command("openssl", "smime", "-inform", "DER", "-decrypt", "-recip", crt, "-inkey", prv)
cmd.Stdin = bytes.NewReader(decoded)
bOut.Reset()
@ -145,7 +145,7 @@ func unmarshalProtectedSettings(configFolder string, hs handlerSettingsCommon, v
cmd.Stdout = &bOut
cmd.Stderr = &bErr
if err := cmd.Run(); err != nil {
return errors.Wrapf(errMsg, "decrypting protected settings with smime command failed: error=%v stderr=%s", err, string(bErr.Bytes()))
return errors.Wrapf(errMsg, "decrypting protected settings with smime command failed: error=%v stderr=%s", err, bErr.String())
}
// decrypted: json object for protected settings