Fix password being zeroized in RunSanityCheck()

This commit is contained in:
2026-02-10 21:54:34 -05:00
parent f49248930b
commit ddd7f893e9
+3 -1
View File
@@ -25,7 +25,9 @@ func RunSanityCheck(path string, password []byte) error {
if err != nil { if err != nil {
return errors.New("Failed to read sanity check file (" + path + ")") return errors.New("Failed to read sanity check file (" + path + ")")
} }
decBytes, err := DecryptAndZeroizePassword(encBytes, password)
// avoid zeroizing password, as this function expects the user to use the password after running it
decBytes, err := DecryptAndZeroizePassword(encBytes, append([]byte{}, password...))
if err == nil { if err == nil {
if bytes.Equal(decBytes, []byte("thx4usin'rcw")) { if bytes.Equal(decBytes, []byte("thx4usin'rcw")) {
return nil return nil