From b2042924983000692e04803251605922812ce962 Mon Sep 17 00:00:00 2001 From: liulin Date: Tue, 11 May 2021 09:42:51 +0800 Subject: [PATCH] put shared folder name as group in the account --- lastpass/vault.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/lastpass/vault.py b/lastpass/vault.py index 1653eff..dd0a0f0 100644 --- a/lastpass/vault.py +++ b/lastpass/vault.py @@ -48,17 +48,20 @@ def parse_accounts(self, chunks, encryption_key): key = encryption_key rsa_private_key = None + shar_folder_name = None for i in chunks: if i.id == b'ACCT': - # TODO: Put shared folder name as group in the account account = parser.parse_ACCT(i, key) + if shar_folder_name is not None: + account.group = shar_folder_name if account: accounts.append(account) elif i.id == b'PRIK': rsa_private_key = parser.parse_PRIK(i, encryption_key) elif i.id == b'SHAR': # After SHAR chunk all the folliwing accounts are enrypted with a new key - key = parser.parse_SHAR(i, encryption_key, rsa_private_key)['encryption_key'] - + shar = parser.parse_SHAR(i, encryption_key, rsa_private_key) + key = shar['encryption_key'] + shar_folder_name = shar['name'] return accounts