15
15
16
16
PASSWORD_CMD_DARWIN = ["security" , "find-generic-password" , "-ws" , "Signal Safe Storage" ]
17
17
PASSWORD_CMD_GNOME = ["secret-tool" , "lookup" , "application" , "Signal" ]
18
- PASSWARD_CMD_KDE = ["kwallet-query" , "kdewallet" , "-f" ,
18
+ PASSWORD_CMD_KDE = ["kwallet-query" , "kdewallet" , "-f" ,
19
19
"Chromium Keys" , "-r" , "Chromium Safe Storage" ]
20
20
21
21
@@ -39,7 +39,7 @@ def get_key(file: Path, password: Optional[str]) -> str:
39
39
if "key" in data :
40
40
return data ["key" ]
41
41
elif "encryptedKey" in data :
42
- encrypyed_key = data ["encryptedKey" ]
42
+ encrypted_key = data ["encryptedKey" ]
43
43
if sys .platform == "win32" :
44
44
secho (
45
45
"Signal decryption isn't currently supported on Windows"
@@ -48,21 +48,20 @@ def get_key(file: Path, password: Optional[str]) -> str:
48
48
)
49
49
if sys .platform == "darwin" :
50
50
if password :
51
- return decrypt (password , encrypyed_key , b"v10" , 1003 )
51
+ return decrypt (password , encrypted_key , b"v10" , 1003 )
52
52
pw = get_password (PASSWORD_CMD_DARWIN , "macOS" ) # may raise error
53
- return decrypt (pw , encrypyed_key , b"v10" , 1003 )
53
+ return decrypt (pw , encrypted_key , b"v10" , 1003 )
54
54
else : # linux
55
55
if password :
56
- return decrypt (password , encrypyed_key , b"v11" , 1 )
56
+ return decrypt (password , encrypted_key , b"v11" , 1 )
57
57
elif "safeStorageBackend" in data :
58
58
if data ["safeStorageBackend" ] == "gnome_libsecret" :
59
59
pw = get_password (PASSWORD_CMD_GNOME , "gnome" ) # may raise error
60
- pw = get_password (PASSWORD_CMD_KDE , "KDE" ) # may raise error
61
- return decrypt (password , encrypyed_key , b"v11" , 1 )
60
+ return decrypt (pw , encrypted_key , b"v11" , 1 )
62
61
elif data ["safeStorageBackend" ] in [
63
62
"gnome_libsecret" , "kwallet" , "kwallet5" , "kwallet6" ]:
64
63
pw = get_password (PASSWORD_CMD_KDE , "KDE" ) # may raise error
65
- return decrypt (password , encrypyed_key , b"v11" , 1 )
64
+ return decrypt (pw , encrypted_key , b"v11" , 1 )
66
65
else :
67
66
secho ("Your Signal data key is encrypted, and requires a password." )
68
67
secho (f"The safe storage backend is { data ['safeStorageBackend' ]} " )
@@ -90,7 +89,7 @@ def get_password(cmd: list[str], system: str) -> Optional[str]:
90
89
cmd: shell command as list of words
91
90
system: Name of the system we are on, for help message.
92
91
Returns:
93
- password if found, None otherwise
92
+ password if found
94
93
Raises:
95
94
nondescript error: if no password was found
96
95
"""
0 commit comments