Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable usage of multiple fido2 devices by supporting password change … #888

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
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