From c05549c8cd7b2d324fd280f8b7b537b3fbf60f5c Mon Sep 17 00:00:00 2001 From: SomberNight Date: Sun, 29 Oct 2017 20:04:31 +0100 Subject: [PATCH] follow-up prev commit: revert "strict checks" for old seeds --- lib/bitcoin.py | 7 +++---- lib/tests/test_bitcoin.py | 3 ++- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/bitcoin.py b/lib/bitcoin.py index 7df4df277..4d75d0a51 100644 --- a/lib/bitcoin.py +++ b/lib/bitcoin.py @@ -264,10 +264,9 @@ def is_old_seed(seed): seed = mnemonic.normalize_text(seed) words = seed.split() try: - hex_seed = old_mnemonic.mn_decode(words) - words2 = old_mnemonic.mn_encode(hex_seed) - seed2 = ' '.join(words2) - uses_electrum_words = seed == seed2 + # checks here are deliberately left weak for legacy reasons, see #3149 + old_mnemonic.mn_decode(words) + uses_electrum_words = True except Exception: uses_electrum_words = False try: diff --git a/lib/tests/test_bitcoin.py b/lib/tests/test_bitcoin.py index 7732b7b4d..94741ead8 100644 --- a/lib/tests/test_bitcoin.py +++ b/lib/tests/test_bitcoin.py @@ -355,7 +355,8 @@ class Test_seeds(unittest.TestCase): ('cell dumb heartbeat north boom tease ship baby bright kingdom rare badword', ''), ('cElL DuMb hEaRtBeAt nOrTh bOoM TeAsE ShIp bAbY BrIgHt kInGdOm rArE SqUeEzE', 'old'), (' cElL DuMb hEaRtBeAt nOrTh bOoM TeAsE ShIp bAbY BrIgHt kInGdOm rArE SqUeEzE ', 'old'), - ('hurry idiot prefer sunset mention mist jaw inhale impossible kingdom rare squeeze', ''), # almost 'old' but maps to 33 hex chars + # below seed is actually 'invalid old' as it maps to 33 hex chars + ('hurry idiot prefer sunset mention mist jaw inhale impossible kingdom rare squeeze', 'old'), ('cram swing cover prefer miss modify ritual silly deliver chunk behind inform able', 'standard'), ('cram swing cover prefer miss modify ritual silly deliver chunk behind inform', ''), ('ostrich security deer aunt climb inner alpha arm mutual marble solid task', 'standard'),