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

memory locking for secret key handling #446

Open
poolpOrg opened this issue Feb 7, 2025 · 0 comments
Open

memory locking for secret key handling #446

poolpOrg opened this issue Feb 7, 2025 · 0 comments

Comments

@poolpOrg
Copy link
Collaborator

poolpOrg commented Feb 7, 2025

We want to avoid Golang from interfering with buffers handling keys, and more notably the passphrase and derived master key.

1- ensure that such keys (passphrase queried during opening of an encrypted repository) are zeroed on exit
2- ensure the zeroing doesn't get optimized out
3- ensure that memory buffers holding keys are not swapped out

The obvious solution is to mmap and mlock, overwriting the keys with random data on wipe... but the mmap and mlock is system-dependent so it's going to be possibly painful to make portable.

Investigate https://github.com/awnumar/memguard or equivalent.

If nothing fits our needs, we'll have to implement such code.

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

No branches or pull requests

1 participant