mirror of
https://github.com/rwinkhart/rcw.git
synced 2026-08-28 04:46:42 -04:00
Fix password being zeroized in RunSanityCheck()
This commit is contained in:
@@ -25,7 +25,9 @@ func RunSanityCheck(path string, password []byte) error {
|
||||
if err != nil {
|
||||
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 bytes.Equal(decBytes, []byte("thx4usin'rcw")) {
|
||||
return nil
|
||||
|
||||
Reference in New Issue
Block a user