Esempio n. 1
0
        private bool IsMasterPasswordValid(string masterPassword)
        {
            var isValid = PasswordFunctions.MasterPasswordIsValid(masterPassword, Settings.Instance.MasterPasswordHash);

            if (isValid)
            {
                this.AssignFieldsByOldMasterPassword(masterPassword);
            }
            return(isValid);
        }
Esempio n. 2
0
        public void V1MasterPasswordValidationTest()
        {
            // cant use persistence security here, because of initialization depends on newest algorithm
            string masterHash  = PasswordFunctions.ComputeMasterPasswordHash(MASTERPASSWORD);
            string masterHash2 = PasswordFunctions.ComputeMasterPasswordHash(MASTERPASSWORD);

            Assert.AreEqual(masterHash, masterHash2);

            bool isValid = PasswordFunctions.MasterPasswordIsValid(MASTERPASSWORD, masterHash);

            Assert.IsTrue(isValid, "Couldn't validate stored master password v1");
        }