Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 12 additions & 8 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -78,15 +78,19 @@ func changePassword(args *argContainer) {
if len(masterkey) == 0 {
log.Panic("empty masterkey")
}
var newPw []byte
if confFile.IsFeatureFlagSet(configfile.FlagFIDO2) {
tlog.Fatal.Printf("Password change is not supported on FIDO2-enabled filesystems.")
os.Exit(exitcodes.Usage)
}
tlog.Info.Println("Please enter your new password.")
newPw, err := readpassword.Twice(nil, nil)
if err != nil {
tlog.Fatal.Println(err)
os.Exit(exitcodes.ReadPassword)
var fido2CredentialID, fido2HmacSalt []byte
fido2CredentialID = confFile.FIDO2.CredentialID //fido2.Register(args.fido2, filepath.Base(args.cipherdir))
fido2HmacSalt = confFile.FIDO2.HMACSalt //cryptocore.RandBytes(32)
newPw = fido2.Secret(args.fido2, args.fido2_assert_options, fido2CredentialID, fido2HmacSalt)
} else {
tlog.Info.Println("Please enter your new password.")
newPw, err = readpassword.Twice(nil, nil)
if err != nil {
tlog.Fatal.Println(err)
os.Exit(exitcodes.ReadPassword)
}
}
logN := confFile.ScryptObject.LogN()
if args._explicitScryptn {
Expand Down