Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

lack of retry of a session key if it errors out #446

Closed
nosmaster89 opened this issue Aug 12, 2023 · 3 comments · Fixed by #447
Closed

lack of retry of a session key if it errors out #446

nosmaster89 opened this issue Aug 12, 2023 · 3 comments · Fixed by #447

Comments

@nosmaster89
Copy link

if the session key fails due to a sig error from the ecc, it will not re attempt to sign a session key. this leads to all data getting lost atleast untill a reconnection is atempted
2023-08-12T12:41:15.234016Z WARN run:run: gateway_rs::packet_router: failed to initialize session err=crypto error: signature error

after this it stops submitting packets to the HPR.
this has been observed on a heltec 1.1 running gwrs 1.1.1

@madninja
Copy link
Member

madninja commented Aug 12, 2023

if the session key fails due to a sig error from the ecc, it will not re attempt to sign a session key. this leads to all data getting lost atleast untill a reconnection is atempted 2023-08-12T12:41:15.234016Z WARN run:run: gateway_rs::packet_router: failed to initialize session err=crypto error: signature error

after this it stops submitting packets to the HPR. this has been observed on a heltec 1.1 running gwrs 1.1.1

right so the worst case reconnect attempt is 30 minutes later.. what would you expect it to do? Helltec can't even sign one thing to get to a session key for packets.

I do see it's not actually following the normal reconnect retry behavior on signature failure though which would at least start with a shorter reconnect time.

@nosmaster89
Copy link
Author

can we not catch the sig error in the driver and just retry after n , i acually think the problem is caused by not enough time before commands , when i was testing mfr on this device . if i got a sig error i could lock the chip by never waiting before trying again. waiting some time period seemed to release the chip again.

its not really a problem for 1 time signs its just a loss of poc aslong as the chips given time to rest. but if the chip is kept busy it may cause problems.

i was under the assumption that if the session key failed then gwrs would fall back to signing packets with the ecc.

@madninja
Copy link
Member

madninja commented Aug 12, 2023

can we not catch the sig error in the driver and just retry after n , i acually think the problem is caused by not enough time before commands , when i was testing mfr on this device . if i got a sig error i could lock the chip by never waiting before trying again. waiting some time period seemed to release the chip again.

No, after N is a thundering herd problem in the making. So this way it backs off after every failure but at least starts within 5 seconds instead of the current 30 minutes.

its not really a problem for 1 time signs its just a loss of poc aslong as the chips given time to rest. but if the chip is kept busy it may cause problems.

i was under the assumption that if the session key failed then gwrs would fall back to signing packets with the ecc.

That's not going to happen under the current HPR/gwrs assumptions.. In the register message gwrs indicates it supports session keys.. So it should :-).

Doing "fallback signing" is not great for performance and weakens the gwrs assertion that is supports session keys. It would have to check both keys, which is not good for performance either

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants