Move TOTP secrets to a dedicated entry field (breaks sshyp entry format compatibility)

This commit is contained in:
2024-05-21 19:21:42 -04:00
parent ca7633d791
commit c2f6023cbe
3 changed files with 6 additions and 6 deletions
+4 -4
View File
@@ -26,17 +26,17 @@ func CopyArgument(targetLocation string, field int, executableName string) {
os.Exit(1) os.Exit(1)
} }
if field != 5 { // TODO Update field after removed from notes (breaking sshyp entry compatibility) if field != 2 {
copySubject = decryptedEntry[field] copySubject = decryptedEntry[field]
} else { // TOTP mode } else { // TOTP mode
var secret string // stores secret for TOTP generation var secret string // stores secret for TOTP generation
var forSteam bool // indicates whether to generate TOTP in Steam format var forSteam bool // indicates whether to generate TOTP in Steam format
if strings.HasPrefix(decryptedEntry[5], "steam@") { if strings.HasPrefix(decryptedEntry[2], "steam@") {
secret = decryptedEntry[5][6:] secret = decryptedEntry[2][6:]
forSteam = true forSteam = true
} else { } else {
secret = decryptedEntry[5] secret = decryptedEntry[2]
} }
for { // keep field copied to clipboard, refresh on 30-second intervals for { // keep field copied to clipboard, refresh on 30-second intervals
+1 -1
View File
@@ -36,7 +36,7 @@ func Rename(oldLocation string, newLocation string) {
fmt.Println(AnsiError + "Failed to rename - does the target containing directory exists?" + AnsiReset) fmt.Println(AnsiError + "Failed to rename - does the target containing directory exists?" + AnsiReset)
} }
// TODO If in online mode, rename oldLocation to newLocation on the server // TODO implement synced renaming
os.Exit(0) os.Exit(0)
} }
+1 -1
View File
@@ -8,7 +8,7 @@ import (
) )
// TODO GPG support is a temporary feature - it will be replaced with a different encryption scheme in the future // TODO GPG support is a temporary feature - it will be replaced with a different encryption scheme in the future
// TODO These functions may continue to exist after that point, but consider them deprecated // These functions may continue to exist after that point, but consider them deprecated
// DecryptGPG decrypts a GPG-encrypted file and returns the contents as a slice of (trimmed) strings // DecryptGPG decrypts a GPG-encrypted file and returns the contents as a slice of (trimmed) strings
func DecryptGPG(targetLocation string) []string { func DecryptGPG(targetLocation string) []string {