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

EvseSlac: Fix regression that NMK was not regenerated on reset #843

Merged
merged 1 commit into from
Sep 3, 2024

Conversation

corneliusclaussen
Copy link
Contributor

Describe your changes

A regression had been introduced between 2024.2.0 and 2024.3.0 that removed the re-generation of the NMK in between sessions. This PR re-adds this functionality.

Issue ticket number and link

Checklist before requesting a review

  • I have performed a self-review of my code
  • I have made corresponding changes to the documentation
  • I read the contribution documentation and made sure that my changes meet its requirements

@corneliusclaussen corneliusclaussen marked this pull request as draft September 2, 2024 12:45
@corneliusclaussen corneliusclaussen marked this pull request as ready for review September 2, 2024 14:15
@corneliusclaussen
Copy link
Contributor Author

Verfied on real HW that it now generates new NMK keys for each session. Also verfied it only sends one set_key.req at startup and not two.

@SebaLukas
Copy link
Contributor

Despite no code change, CM_SET_KEY.REQ is only sent once?

Copy link
Contributor

@SebaLukas SebaLukas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

Copy link
Contributor

@a-w50 a-w50 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a note (I know I initially wrote this), but the generate_nmk function should be a free function and the code should look like
ctx.slac_config.session_nmk = generate_nmk() this is more explicit. Unfortunately standard c arrays are not copyable like this, but this can be mitigated by using std::array which would also be more safe

@corneliusclaussen corneliusclaussen merged commit 38aa4cc into main Sep 3, 2024
11 checks passed
@corneliusclaussen corneliusclaussen deleted the bugfix/evseslac_generate_nmk branch September 3, 2024 10:46
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 this pull request may close these issues.

3 participants