stakwork / sphinx-key

Lightning hardware signer on ESP32
28 stars 1 forks source link

Broker does not reject fake client IDs #91

Closed irriden closed 1 year ago

irriden commented 1 year ago

In the case where broker receives a control message for a fake client ID, the broker still tries to send that message to that client ID.

Evanfeenstra commented 1 year ago

good catch. This should fix it https://github.com/stakwork/sphinx-key/pull/92

If a client ID does not exist in the current Connections then an empty ChannelReply is returned to the http handler, which returns an error to the controller

irriden commented 1 year ago

@Evanfeenstra seems we should handle these more graciously ? Right now we get a 500 HTTP code on the broker logs:

ERROR Fail
[2023-07-03T15:13:13.151 hsmd  /rocket::server::_ WARN] No 500 catcher registered. Using Rocket default.

and ctrl.rs can't parse the response:

COMMAND! Nonce
thread 'main' panicked at 'couldnt decode response: InvalidHexCharacter { c: '<', index: 0 }', src/ctrl.rs:54:43
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace