@@ -33,7 +33,7 @@ def getFileEncKey(key):
33
33
filekey , enckey = key [:len (key )/ 2 ], key [len (key )/ 2 :]
34
34
FILENAME_MESS = '5f91add3fa1c3c76e90c90a3bd0999e2bd7833d06a483fe884ee60397aca277a'
35
35
digest = hmac .new (filekey , FILENAME_MESS , hashlib .sha256 ).hexdigest ()
36
- filename = '' . join (( digest , '.pswd' ))
36
+ filename = digest + '.pswd'
37
37
return [filename , filekey , enckey ]
38
38
39
39
# File level decryption and file reading
@@ -80,8 +80,11 @@ def getDecryptedNonce(entry):
80
80
print
81
81
print 'Waiting for TREZOR input ...'
82
82
print
83
- title = entry ['title' ].replace ("http://" ,"" ).replace ("https://" ,"" )
84
- ENC_KEY = '' .join (('Unlock ' , title , ' for user ' , entry ['username' ], '?' ))
83
+ if 'item' in entry :
84
+ item = entry ['item' ].replace ('http://' , '' ).replace ('https://' , '' )
85
+ else :
86
+ item = entry ['title' ].replace ('http://' , '' ).replace ('https://' , '' )
87
+ ENC_KEY = 'Unlock %s for user %s?' % (item , entry ['username' ])
85
88
ENC_VALUE = entry ['nonce' ]
86
89
decrypted_nonce = hexlify (client .decrypt_keyvalue (
87
90
getPath (),
@@ -118,13 +121,13 @@ def main():
118
121
fileName = getFileEncKey (masterKey )[0 ]
119
122
#print 'file name:', fileName
120
123
121
- path = os .path .expanduser ('~/Dropbox/Apps/TREZOR Passwords /' )
124
+ path = os .path .expanduser ('~/Dropbox/Apps/TREZOR Password Manager /' )
122
125
#print 'path to file:', path
123
126
124
127
encKey = getFileEncKey (masterKey )[2 ]
125
128
#print 'enckey:', encKey
126
129
127
- full_path = '' . join (( path , fileName ))
130
+ full_path = path + fileName
128
131
parsed_json = decryptStorage (full_path , encKey )
129
132
130
133
#list entries
0 commit comments