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

Improve get_SD_usage_data function #187

Open
robinkrahl opened this issue Sep 12, 2020 · 2 comments
Open

Improve get_SD_usage_data function #187

robinkrahl opened this issue Sep 12, 2020 · 2 comments

Comments

@robinkrahl
Copy link
Contributor

  • The NitrokeyManager::get_SD_usage_data function currently only returns the min/max write levels. It could also return the min/max read levels.

Also, the documentation should be improved:

  • Intuitively, one would assume that the returned levels are in the range 0..100, but they are actually in the range 1..99. Is this intended?
  • Is the returned range inclusive or exclusive?
@szszszsz
Copy link
Member

Hi!
Good questions! Will check

@szszszsz
Copy link
Member

According to the Nitrokey Storage firmware, the reads are exclusive, hence the values range probably [1].

In my understanding use case is to provide minimum/maximum range, where the data could be safely stored, thus the +1/-1 from the limits. E.g. there are some writes in the beginning of the SD card, in the very first percentile, region 0%-1%, so the value returned will be 1%. Value 0% would not have meaning here.
Maybe could be useful to show that the write has not been executed in this power cycle yet, but this will bring unnecessary complexity.

[1] https://github.com/Nitrokey/nitrokey-storage-firmware/blob/f66b2e63582312717b7e45ce078b3b8fd869c51d/src/OTP/report_protocol.c#L2658

sgued pushed a commit to sgued/libnitrokey that referenced this issue Feb 14, 2022
Use list instead of ls in local_critical
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants