From b393b54e35091efd3f49e9eccaf472c91f5bd0d1 Mon Sep 17 00:00:00 2001 From: criw Date: Tue, 6 Mar 2018 04:43:12 +0100 Subject: FIX #3440 improved verification of restore from seed phrase --- ui/app/keychains/hd/restore-vault.js | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'ui/app') diff --git a/ui/app/keychains/hd/restore-vault.js b/ui/app/keychains/hd/restore-vault.js index a4ed137f9..c4ba0d8fd 100644 --- a/ui/app/keychains/hd/restore-vault.js +++ b/ui/app/keychains/hd/restore-vault.js @@ -141,6 +141,19 @@ RestoreVaultScreen.prototype.createNewVaultAndRestore = function () { // check seed var seedBox = document.querySelector('textarea.twelve-word-phrase') var seed = seedBox.value.trim() + + // true if the string has more than a space between words. + if (seed.split(' ').length > 1) { + this.warning = 'there can only a space between words' + this.props.dispatch(actions.displayWarning(this.warning)) + return + } + // true if seed contains a character that is not between a-z or a space + if(!seed.match(/^[a-z ]+$/)) { + this.warning = 'seed words only have lowercase characters' + this.props.dispatch(actions.displayWarning(this.warning)) + return + } if (seed.split(' ').length !== 12) { this.warning = 'seed phrases are 12 words long' this.props.dispatch(actions.displayWarning(this.warning)) -- cgit From a52ef7a06a04888d2de1246c0896f86f59a3f153 Mon Sep 17 00:00:00 2001 From: kumavis Date: Tue, 13 Mar 2018 14:41:54 -0700 Subject: ui - lint fix --- ui/app/keychains/hd/restore-vault.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'ui/app') diff --git a/ui/app/keychains/hd/restore-vault.js b/ui/app/keychains/hd/restore-vault.js index 6c8f6cdb0..685094854 100644 --- a/ui/app/keychains/hd/restore-vault.js +++ b/ui/app/keychains/hd/restore-vault.js @@ -152,7 +152,7 @@ RestoreVaultScreen.prototype.createNewVaultAndRestore = function () { return } // true if seed contains a character that is not between a-z or a space - if(!seed.match(/^[a-z ]+$/)) { + if (!seed.match(/^[a-z ]+$/)) { this.warning = 'seed words only have lowercase characters' this.props.dispatch(actions.displayWarning(this.warning)) return -- cgit