From 9c0ab739eab7861ee390384bb8d471f722b76ab1 Mon Sep 17 00:00:00 2001 From: frank Date: Thu, 30 Mar 2023 08:01:22 +0800 Subject: [PATCH] add simple validation for password, fix #15478 (#15503) --- src/status_im/node/core.cljs | 2 +- src/status_im2/contexts/syncing/events.cljs | 41 ++++++++++++--------- status-go-version.json | 6 +-- 3 files changed, 28 insertions(+), 21 deletions(-) diff --git a/src/status_im/node/core.cljs b/src/status_im/node/core.cljs index a68994ec39..546a5f4e56 100644 --- a/src/status_im/node/core.cljs +++ b/src/status_im/node/core.cljs @@ -165,7 +165,7 @@ :MailserversConfig {:Enabled true} :EnableNTPSync true :WakuConfig - {:Enabled true + {:Enabled (not wakuv2-enabled) :BloomFilterMode waku-bloom-filter-mode :LightClient true :MinimumPoW 0.000001} diff --git a/src/status_im2/contexts/syncing/events.cljs b/src/status_im2/contexts/syncing/events.cljs index db4734e74d..ec7e1617e9 100644 --- a/src/status_im2/contexts/syncing/events.cljs +++ b/src/status_im2/contexts/syncing/events.cljs @@ -8,7 +8,8 @@ [status-im.node.core :as node] [re-frame.core :as re-frame] [status-im.data-store.settings :as data-store.settings] - [status-im.utils.platform :as utils.platform])) + [status-im.utils.platform :as utils.platform] + [status-im2.constants :as constants])) (rf/defn local-pairing-completed {:events [:syncing/pairing-completed]} @@ -54,19 +55,25 @@ (rf/defn preparations-for-connection-string {:events [:syncing/get-connection-string-for-bootstrapping-another-device]} [{:keys [db]} entered-password] - (let [sha3-pwd (status/sha3 (str (security/safe-unmask-data entered-password))) - key-uid (get-in db [:multiaccount :key-uid]) - config-map (.stringify js/JSON - (clj->js {:senderConfig {:keyUID key-uid - :keystorePath "" - :password sha3-pwd - :deviceType utils.platform/os} - :serverConfig {:timeout 0}}))] - (status/get-connection-string-for-bootstrapping-another-device - config-map - (fn [connection-string] - (rf/dispatch - [:bottom-sheet/show-sheet - {:show-handle? false - :content (fn [] - [sheet/qr-code-view-with-connection-string connection-string])}]))))) + (let [valid-password? (>= (count entered-password) constants/min-password-length) + show-sheet (fn [connection-string] + (rf/dispatch + [:bottom-sheet/show-sheet + {:show-handle? false + :content (fn [] + [sheet/qr-code-view-with-connection-string + connection-string])}]))] + (if valid-password? + (let [sha3-pwd (status/sha3 (str (security/safe-unmask-data entered-password))) + key-uid (get-in db [:multiaccount :key-uid]) + config-map (.stringify js/JSON + (clj->js {:senderConfig {:keyUID key-uid + :keystorePath "" + :password sha3-pwd + :deviceType utils.platform/os} + :serverConfig {:timeout 0}}))] + (status/get-connection-string-for-bootstrapping-another-device + config-map + #(show-sheet %))) + (show-sheet "")))) + diff --git a/status-go-version.json b/status-go-version.json index c876cad39c..591d47cb3d 100644 --- a/status-go-version.json +++ b/status-go-version.json @@ -3,7 +3,7 @@ "_comment": "Instead use: scripts/update-status-go.sh ", "owner": "status-im", "repo": "status-go", - "version": "v0.141.2", - "commit-sha1": "91c6949cd25449d5459581a21f2c8b929290ced0", - "src-sha256": "0d4x1y9jhdxy5jn9kqp5avx157iqz4ma7903c3ys0njmnxhmjyf8" + "version": "v0.142.1", + "commit-sha1": "bb6139aef1718ef89861d0ed372952473178b881", + "src-sha256": "07n9gx7n8wxdxznk0g3kcy77pn14k42j1ixf18bfqgf5z40ixyna" }