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

read_dir_first: stop at the first file that is alphabetically "after" not_before #33

Closed
wants to merge 1 commit into from

Conversation

sosthene-nitrokey
Copy link
Collaborator

In fido-authenticator, if we change the paths of RK to be: "rp_id.rk_id" instead of the current "rp_id/rk_id", we still want to be able to iterate over the keys even though we only know the "rp_id" and not the "rk_id". Therefore we need to be able to stop at "rp_id.***" when giving "rp_id" in not_before

This is technically a breaking change because now, given the files:

  • "aaa"
  • "aaabbb"

"read_dir_first" with "aaa" as not_before would only yield "aaa"
due to littlefs-project/littlefs#923. Now this will yield both files, and yield "aaabbb" first.

I beleive this behaviour is technically more correct as it is likely what would be expected to be yield expecting alphabetical order (though the order of the entries is still incorrect).

@sosthene-nitrokey sosthene-nitrokey force-pushed the iteration-cmp branch 2 times, most recently from f4fb98f to 7b0ad59 Compare February 2, 2024 14:19
@sosthene-nitrokey
Copy link
Collaborator Author

This posed some problems as it changed the behaviour of all existing code, and in addition since for FIDO we need to use the alphabetical ordering, not the bugged lfs one.

So I added a parameter to either use the old equality check or to use the one required by FIDO and exposed it a new client method.

… `not_before`

In fido-authenticator, if we change the paths of RK  to be:
"rp_id.rk_id" instead of the current "rp_id/rk_id", we still want to be able
to iterate over the keys even though we only  know the "rp_id" and not the
"rk_id". Therefore we need to be able to stop at "rp_id.***" when giving "rp_id" in `not_before`

This is technically a breaking change because now, given the files:

- "aaa"
- "aaabbb"

 "read_dir_first"  with "aaa" as `not_before` would only yield "aaa"
due to littlefs-project/littlefs#923.
Now this will yield both files, and yield "aaabbb" first.

I beleive this behaviour is technically more correct as it is likely what
would be expected to be yield expecting alphabetical order
(though the order of the entries is still incorrect).
@sosthene-nitrokey
Copy link
Collaborator Author

Replaced by upstream

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.

1 participant