Skip to content

Adiantum encrypting VFS improvements. #80

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

Merged
merged 7 commits into from
Apr 21, 2024
Merged

Adiantum encrypting VFS improvements. #80

merged 7 commits into from
Apr 21, 2024

Conversation

ncruces
Copy link
Owner

@ncruces ncruces commented Apr 19, 2024

Goals:

  1. find a way to encrypt sub-journals (and other temporaries) or scream that we can't.
  2. figure out a better API to set keys, that works with the above.

(1) Is important because most temporary files can hold database data, not just temporary tables, but transient views, sorter data, etc. I'd rather fail loudly than persist that data. We can also hold it in Go, rather than guest, memory.

(2) Would be nice because URI parameters are easily available to other parts of the application. A solution that works with ATTACH is elusive, though.

@ncruces ncruces changed the title Adiantum encrypting VFS fixes. Adiantum encrypting VFS improvements. Apr 19, 2024
@ncruces
Copy link
Owner Author

ncruces commented Apr 20, 2024

ISTM that the best way to handle temporaries is to use a random key for every file that has empty path and OPEN_DELETEONCLOSE and see if that covers everything. For these files we can even keep a length, avoiding the only issue Adiantum can't transparently handle (partial blocks at the end).

Users that don't want the overhead can still use PRAGMA temp_store.

@ncruces
Copy link
Owner Author

ncruces commented Apr 20, 2024

Any solution to (2) needs to be in addition to URI parameters, I guess. It's not just ATTACH … KEY (that we can't do without patching SQLite). A PRAGMA would probably solve that.

It's our backup API that assumes URIs. Forcing users to set keys through a _pragma=textkey(pass) URI parameter, because URI parameters are bad, is a roundabout way to do it.

With URI parameters keys will be in guest memory for the duration of the connection. But we currently don't expose any API to retrieve them. So maybe that's OK?

@ncruces ncruces marked this pull request as ready for review April 21, 2024 00:52
@ncruces ncruces merged commit 07241d0 into main Apr 21, 2024
9 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.

1 participant