feat(BRIDGE-424): FIDO2 GUI support.

This commit is contained in:
Atanas Janeshliev
2025-09-16 13:07:45 +02:00
parent e091e58be1
commit edf903fd21
42 changed files with 3567 additions and 3510 deletions

View File

@ -45,6 +45,11 @@ func (f *frontendCLI) yesNoQuestion(question string) bool {
return len(answer) > 0 // Empty is false.
}
func (f *frontendCLI) PromptAndWaitReturn(prompt string) {
f.Print(prompt, ". Press Enter/Return to continue: ")
f.ReadLine()
}
func (f *frontendCLI) readStringInAttempts(title string, readFunc func() string, isOK func(string) bool) (value string) {
f.Printf("%s: ", title)
value = readFunc()
@ -60,6 +65,10 @@ func (f *frontendCLI) readStringInAttempts(title string, readFunc func() string,
return
}
func (f *frontendCLI) ReadSecurityKeyPin() string {
return f.readStringInAttempts("Security key PIN", f.ReadPassword, isNotEmpty)
}
func (f *frontendCLI) printAndLogError(args ...interface{}) {
log.Error(args...)
f.Println(args...)
@ -110,15 +119,3 @@ Recommendation:
a different network to access Proton Mail.
`)
}
func sliceAnyToByteArray(s []any) []byte {
result := make([]byte, len(s))
for i, val := range s {
if intVal, ok := val.(float64); ok {
result[i] = byte(intVal)
} else {
panic("boom")
}
}
return result
}