Skip to content

Commit

Permalink
[WIP] py3 error
Browse files Browse the repository at this point in the history
  • Loading branch information
AlessandroZ committed Apr 9, 2019
1 parent 68f6bca commit c87d014
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions Windows/lazagne/softwares/browsers/chromium_based.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
# -*- coding: utf-8 -*-
import ast
import base64
import json
import os
Expand Down Expand Up @@ -90,7 +89,11 @@ def _export_credentials(self, db_path, is_yandex=False):
# Yandex passwords use a masterkey stored on windows credential manager
# https://yandex.com/support/browser-passwords-crypto/without-master.html
if is_yandex and yandex_enckey:
p = ast.literal_eval(str(password))
try:
p = json.loads(str(password))
except Exception:
p = json.loads(password)

password = base64.b64decode(p['p'])

# Passwords are stored using AES-256-GCM algorithm
Expand All @@ -101,7 +104,8 @@ def _export_credentials(self, db_path, is_yandex=False):
# Failed...
else:
# Decrypt the Password
password = Win32CryptUnprotectData(password, is_current_user=constant.is_current_user, user_dpapi=constant.user_dpapi)
password = Win32CryptUnprotectData(password, is_current_user=constant.is_current_user,
user_dpapi=constant.user_dpapi)

if not url and not login and not password:
continue
Expand Down

0 comments on commit c87d014

Please sign in to comment.