slip0016: use urlparse in pwdreader proof of concept

parent f3aa073c
...@@ -9,6 +9,7 @@ import hmac ...@@ -9,6 +9,7 @@ import hmac
import hashlib import hashlib
import json import json
import os import os
from urlparse import urlparse
# Return path by BIP-32 # Return path by BIP-32
def getPath(): def getPath():
...@@ -81,9 +82,14 @@ def getDecryptedNonce(entry): ...@@ -81,9 +82,14 @@ def getDecryptedNonce(entry):
print 'Waiting for TREZOR input ...' print 'Waiting for TREZOR input ...'
print print
if 'item' in entry: if 'item' in entry:
item = entry['item'].replace('http://', '').replace('https://', '') item = entry['item']
else: else:
item = entry['title'].replace('http://', '').replace('https://', '') item = entry['title']
pr = urlparse(item)
if pr.scheme and pr.netloc:
item = pr.netloc
ENC_KEY = 'Unlock %s for user %s?' % (item, entry['username']) ENC_KEY = 'Unlock %s for user %s?' % (item, entry['username'])
ENC_VALUE = entry['nonce'] ENC_VALUE = entry['nonce']
decrypted_nonce = hexlify(client.decrypt_keyvalue( decrypted_nonce = hexlify(client.decrypt_keyvalue(
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment