vishalxl / nostr_console

Nostr console is an open-source twitter-like social network, direct chat app and group chat all bundled into one program. Built on the decentralized Nostr protocol.
GNU Affero General Public License v3.0
441 stars 33 forks source link

For private key 1 when sending a DM the application crashes #28

Closed vishalxl closed 1 year ago

vishalxl commented 1 year ago

One issue here is that the inbox is shown with id 0000

One of the events 0b9 can be seen here

Here is traceback:


Type user public key, or their name, or their 1st few letters; or type 'x' to cancel: 0000
                                           ---------- 000 (0000000000000000000000000000000000000000000000000000000000000000) ----------

                                   0b948d23cf8be30d23d859331d9e85055c6ba4b005c259b799b1f481e5513f8e     07:04 PM May 20        poll_bot: ???
                                   38fd1c36faa02d375aa324b59fccc1c0d5e3364018370605a9d761143f9325c4     07:05 PM May 20        poll_bot: ???

Type message; or type 'x' to exit, or press <enter> to refresh: test
Unhandled exception:
Invalid argument(s): Invalid point compression
#0      ECCurve.decompressPoint (package:pointycastle/ecc/ecc_fp.dart:356:7)
#1      ECCurveBase.decodePoint (package:pointycastle/ecc/ecc_base.dart:215:13)
#2      Kepler.loadPublicKey (package:kepler/src/kepler.dart:149:29)
#3      Kepler.rawSecret (package:kepler/src/kepler.dart:162:23)
#4      Kepler.byteSecret (package:kepler/src/kepler.dart:173:20)
#5      myEncryptRaw (package:nostr_console/event_ds.dart:1538:27)
#6      myEncrypt (package:nostr_console/event_ds.dart:1531:27)
#7      sendDirectMessage (package:nostr_console/console_ui.dart:133:42)
#8      PrivateMenuUI (package:nostr_console/console_ui.dart:1182:25)
<asynchronous suspension>
#9      mainMenuUi (package:nostr_console/console_ui.dart:1295:11)
<asynchronous suspension>

Issue is that this account has sent a DM to a pubkey with 64 zeros. Solution is to put in test so that messages to such pubkeys aren't taken as valid.

vishalxl commented 1 year ago

Fixed with this commit

vishalxl commented 1 year ago

Note: can send dm's using this key on console ( and that can be read too)

vishalxl commented 1 year ago

pvt key 1 is usable with new release 0.1.5-beta