Skip to content

Commit

Permalink
Check for empty public key
Browse files Browse the repository at this point in the history
We check that ENS does not return an empty public key. In addition to
that validation is done on status-go in order to avoid saving the chat.
  • Loading branch information
cammellos committed Feb 7, 2020
1 parent dcfac1c commit 11bc3a4
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
5 changes: 4 additions & 1 deletion src/status_im/ui/screens/add_new/new_chat/db.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,12 @@
[{:keys [multiaccount]} public-key]
(= (:public-key multiaccount) public-key))

(def empty-public-key "0x0400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000")

(defn validate-pub-key [db public-key]
(cond
(not (spec/valid? :global/public-key public-key))
(or (not (spec/valid? :global/public-key public-key))
(= public-key empty-public-key))
(i18n/label (if platform/desktop?
:t/use-valid-contact-code-desktop
:t/use-valid-contact-code))
Expand Down
6 changes: 3 additions & 3 deletions status-go-version.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"_comment": "DO NOT EDIT THIS FILE BY HAND. USE 'scripts/update-status-go.sh <tag>' instead",
"owner": "status-im",
"repo": "status-go",
"version": "v0.43.0",
"commit-sha1": "f2eebd1e499e1eb7ab84d634792ec7927b1e79b3",
"src-sha256": "1pcsigvwlv1k4hnzfw2f7c9shhavinyqg6711xnq3jkr4j53j2p8"
"version": "bug/validate-pubkey",
"commit-sha1": "84a6cb2d3d63c01b334b5b7727b135293075b3a8",
"src-sha256": "1f1kcfhf0drxcazmmla9irdj9ji2lrzm53slyfkrl2fjdk4gklsd"
}

0 comments on commit 11bc3a4

Please sign in to comment.