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

Fix location of data #23

Merged
merged 6 commits into from
Apr 5, 2023
Merged

Fix location of data #23

merged 6 commits into from
Apr 5, 2023

Conversation

sosthene-nitrokey
Copy link
Contributor

This is a temporary fix until trussed gives us a way to have a per-backend store of data

This is a temporary fix until trussed gives us a way to have a per-backend store of data
@sosthene-nitrokey sosthene-nitrokey marked this pull request as ready for review April 5, 2023 10:01
@sosthene-nitrokey sosthene-nitrokey requested review from robin-nitrokey and daringer and removed request for robin-nitrokey April 5, 2023 10:01
CHANGELOG.md Outdated Show resolved Hide resolved
Copy link
Member

@robin-nitrokey robin-nitrokey left a comment

Choose a reason for hiding this comment

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

LGTM! Please also update the doc comment for AuthBackend with the new path.

@robin-nitrokey robin-nitrokey linked an issue Apr 5, 2023 that may be closed by this pull request
@sosthene-nitrokey
Copy link
Contributor Author

This does mean that the salt is at

/// trussed/
///     dat/
///         backend-auth/
///             salt            global salt for key derivation

@robin-nitrokey
Copy link
Member

Should we move it to trussed/backend-auth/dat for consistency?

@sosthene-nitrokey
Copy link
Contributor Author

Let's move the global state to /backend-auth/dat/.... Trussed will then enforce the backend- prefix in the future

@sosthene-nitrokey
Copy link
Contributor Author

Current layout:

:: PERSISTENT
/backend-auth p(/)
/backend-auth/dat p(/backend-auth)
/backend-auth/dat/backend-auth p(/backend-auth/dat)
/backend-auth/dat/backend-auth/salt p(/backend-auth/dat/backend-auth)
/test p(/)
/test/backend-auth p(/test)
/test/backend-auth/dat p(/test/backend-auth)
/test/backend-auth/dat/pin.00 p(/test/backend-auth/dat)
/trussed p(/)
/trussed/dat p(/trussed)
/trussed/dat/rng-state.bin p(/trussed/dat)

@@ -106,21 +107,21 @@ impl AuthBackend {

fn get_global_salt<R: CryptoRng + RngCore>(
&self,
trussed_filestore: &mut impl Filestore,
global_fs: &mut impl Filestore,
rng: &mut R,
) -> Result<Salt, Error> {
let path = PathBuf::from(BACKEND_DIR).join(&PathBuf::from("salt"));
Copy link
Member

Choose a reason for hiding this comment

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

Wait, shouldn’t we drop BACKEND_DIR here too?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Oh right. It's even in the debugdumpstore just above

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Should I do a 0.2.1 or just ovewrite the tag?

Copy link
Member

Choose a reason for hiding this comment

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

As we already pulled it into nitrokey-3-firmware, let’s use 0.2.1.

@sosthene-nitrokey sosthene-nitrokey mentioned this pull request Apr 5, 2023
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.

Fix PIN data path
3 participants