Skip to content

Commit

Permalink
Fix for format change in Bitwarden Desktop v2022.8.0
Browse files Browse the repository at this point in the history
Fix for data.json file format change introduced in Bitwarden Desktop 2022.8.0. (GurpreetKang#17)

Fix support for pre Desktop 2022.8.0 data.json files.
  • Loading branch information
GurpreetKang authored and bruno-amelco committed Sep 5, 2022
1 parent 58137e7 commit 84bf605
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions BitwardenDecrypt.py
Original file line number Diff line number Diff line change
Expand Up @@ -400,9 +400,16 @@ def decryptBitwardenJSON(options):

# Get/Decrypt All Organization Keys
for uuid in organizationKeys.items():
BitwardenSecrets['OrgSecrets'][uuid[0]] = decryptRSA(uuid[1]['key'], BitwardenSecrets['RSAPrivateKey'])
# File Format >= Desktop 2022.8.0
if type(uuid[1]) is dict:
BitwardenSecrets['OrgSecrets'][uuid[0]] = decryptRSA(uuid[1]['key'], BitwardenSecrets['RSAPrivateKey'])
# File Format < Desktop 2022.8.0
elif type(uuid[1]) is str:
BitwardenSecrets['OrgSecrets'][uuid[0]] = decryptRSA(uuid[1], BitwardenSecrets['RSAPrivateKey'])
else:
print(f"ERROR: Could Not Determine Organization Keys From File Format")



for a in datafile['data']:

supportedGroups = ['folders', 'ciphers', 'collections', 'organizations']
Expand Down

0 comments on commit 84bf605

Please sign in to comment.