follow-up prev commit: revert "strict checks" for old seeds

This commit is contained in:
SomberNight 2017-10-29 20:04:31 +01:00
parent d45e13553a
commit c05549c8cd
2 changed files with 5 additions and 5 deletions

View file

@ -264,10 +264,9 @@ def is_old_seed(seed):
seed = mnemonic.normalize_text(seed) seed = mnemonic.normalize_text(seed)
words = seed.split() words = seed.split()
try: try:
hex_seed = old_mnemonic.mn_decode(words) # checks here are deliberately left weak for legacy reasons, see #3149
words2 = old_mnemonic.mn_encode(hex_seed) old_mnemonic.mn_decode(words)
seed2 = ' '.join(words2) uses_electrum_words = True
uses_electrum_words = seed == seed2
except Exception: except Exception:
uses_electrum_words = False uses_electrum_words = False
try: try:

View file

@ -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 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'),
(' 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 able', 'standard'),
('cram swing cover prefer miss modify ritual silly deliver chunk behind inform', ''), ('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'), ('ostrich security deer aunt climb inner alpha arm mutual marble solid task', 'standard'),