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

Use updated ctap-types with references #9

Merged
merged 4 commits into from
Oct 25, 2023

Conversation

sosthene-nitrokey
Copy link
Contributor

This PR uses the updated ctap-types crate that uses references rather than heapless buffers to reduce the total stack usage. See Nitrokey/ctap-types#11

src/lib/types.rs Outdated
for i in 0..4 {
wc_magic_number[i] = arr[1 + i];
}
wc_magic_number[..4].copy_from_slice(&arr[1..(4 + 1)]);
Copy link
Member

Choose a reason for hiding this comment

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

Nit: I think [1..(4 + 1)] is a bit hard to read, I’d either use [1..5] or, if you want to highlight that the lengths match, [1..][..4].

Not related to this PR, but it looks like there is a check for arr.size() missing here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I was surprised that I didn't use [1..][..4], and looking at the history it looks like it came from a cargo clippy --fix.

Will make a clippy issue to see if that can be improved.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It also added wc_magic_number[..4] that was unnecessary.

@sosthene-nitrokey
Copy link
Contributor Author

I can't merge this or add reviewer. @szszszsz can you add the core team to the maintainers?

@sosthene-nitrokey sosthene-nitrokey merged commit d1b9fbb into Nitrokey:main Oct 25, 2023
2 checks passed
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.

2 participants