add simple validation for password, fix #15478 (#15503)

This commit is contained in:
frank 2023-03-30 08:01:22 +08:00 committed by GitHub
parent 0503f5cfc9
commit 9c0ab739ea
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 28 additions and 21 deletions

View File

@ -165,7 +165,7 @@
:MailserversConfig {:Enabled true} :MailserversConfig {:Enabled true}
:EnableNTPSync true :EnableNTPSync true
:WakuConfig :WakuConfig
{:Enabled true {:Enabled (not wakuv2-enabled)
:BloomFilterMode waku-bloom-filter-mode :BloomFilterMode waku-bloom-filter-mode
:LightClient true :LightClient true
:MinimumPoW 0.000001} :MinimumPoW 0.000001}

View File

@ -8,7 +8,8 @@
[status-im.node.core :as node] [status-im.node.core :as node]
[re-frame.core :as re-frame] [re-frame.core :as re-frame]
[status-im.data-store.settings :as data-store.settings] [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 (rf/defn local-pairing-completed
{:events [:syncing/pairing-completed]} {:events [:syncing/pairing-completed]}
@ -54,6 +55,15 @@
(rf/defn preparations-for-connection-string (rf/defn preparations-for-connection-string
{:events [:syncing/get-connection-string-for-bootstrapping-another-device]} {:events [:syncing/get-connection-string-for-bootstrapping-another-device]}
[{:keys [db]} entered-password] [{:keys [db]} entered-password]
(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))) (let [sha3-pwd (status/sha3 (str (security/safe-unmask-data entered-password)))
key-uid (get-in db [:multiaccount :key-uid]) key-uid (get-in db [:multiaccount :key-uid])
config-map (.stringify js/JSON config-map (.stringify js/JSON
@ -64,9 +74,6 @@
:serverConfig {:timeout 0}}))] :serverConfig {:timeout 0}}))]
(status/get-connection-string-for-bootstrapping-another-device (status/get-connection-string-for-bootstrapping-another-device
config-map config-map
(fn [connection-string] #(show-sheet %)))
(rf/dispatch (show-sheet ""))))
[:bottom-sheet/show-sheet
{:show-handle? false
:content (fn []
[sheet/qr-code-view-with-connection-string connection-string])}])))))

View File

@ -3,7 +3,7 @@
"_comment": "Instead use: scripts/update-status-go.sh <rev>", "_comment": "Instead use: scripts/update-status-go.sh <rev>",
"owner": "status-im", "owner": "status-im",
"repo": "status-go", "repo": "status-go",
"version": "v0.141.2", "version": "v0.142.1",
"commit-sha1": "91c6949cd25449d5459581a21f2c8b929290ced0", "commit-sha1": "bb6139aef1718ef89861d0ed372952473178b881",
"src-sha256": "0d4x1y9jhdxy5jn9kqp5avx157iqz4ma7903c3ys0njmnxhmjyf8" "src-sha256": "07n9gx7n8wxdxznk0g3kcy77pn14k42j1ixf18bfqgf5z40ixyna"
} }