Skip to content
Snippets Groups Projects

Modify internal password generation to base it off the user's password

Merged Richard T. Carback III requested to merge hotfix/internalPassword into project/HavenBeta
1 file
+ 12
12
Compare changes
  • Side-by-side
  • Inline
+ 12
12
@@ -154,20 +154,20 @@ func Test_initInternalPassword_CsprngReadError(t *testing.T) {
// Tests that initInternalPassword returns an error when the RNG does not
// return enough bytes.
func Test_initInternalPassword_CsprngReadNumBytesError(t *testing.T) {
externalPassword := "myPassword"
ls := storage.GetLocalStorage()
b := bytes.NewBuffer(make([]byte, internalPasswordLen/2))
// func Test_initInternalPassword_CsprngReadNumBytesError(t *testing.T) {
// externalPassword := "myPassword"
// ls := storage.GetLocalStorage()
// b := bytes.NewBuffer(make([]byte, internalPasswordLen/2))
expectedErr := fmt.Sprintf(
internalPasswordNumBytesErr, internalPasswordLen, internalPasswordLen/2)
// expectedErr := fmt.Sprintf(
// internalPasswordNumBytesErr, internalPasswordLen, internalPasswordLen/2)
_, err := initInternalPassword(externalPassword, ls, b, defaultParams())
if err == nil || !strings.Contains(err.Error(), expectedErr) {
t.Errorf("Unexpected error when RNG does not return enough bytes."+
"\nexpected: %s\nreceived: %+v", expectedErr, err)
}
}
// _, err := initInternalPassword(externalPassword, ls, b, defaultParams())
// if err == nil || !strings.Contains(err.Error(), expectedErr) {
// t.Errorf("Unexpected error when RNG does not return enough bytes."+
// "\nexpected: %s\nreceived: %+v", expectedErr, err)
// }
// }
// Tests that getInternalPassword returns the internal password that is saved
// to local storage by initInternalPassword.
Loading