SaitoTech / saito-lite-rust

a version of the Saito-Lite client written for compatibility with the Saito Rust client and binary data format
24 stars 28 forks source link

Exchanging keys with a node makes it crash #2268

Closed jqbrvn closed 8 months ago

jqbrvn commented 8 months ago

Running the initiate_key_exchange function of the Encrypt class while setting the public key of a node running a local instance of the saito-lite-rust as a recipient makes the node crash with no option of recovery beside nuking it. More importantly, hitting the Add contact button on the user profile page of the node on RedSquare (accessed through <SAITO_INSTANCE_ADDRESS>/redsquare/?user_id=<PUBLIC_KEY>) triggers the same issue.

Based on the attached node logs screenshot, the bug appears to be caused by the siteMessage function call in the accept_key_exchange function of the Encrypt class.

Screenshot 2023-12-30 132048

f8daniel commented 8 months ago

Some safety checks have been added so that full nodes ignore requests to create a Diffie-Hellman key pair