depending on libfsverity #233
-
Is there any reason for us to not depend on libfsverity? Why are we carrying a reimplementation of things like the digest computation? |
Beta Was this translation helpful? Give feedback.
Answered by
alexlarsson
Dec 14, 2023
Replies: 1 comment 2 replies
-
The reason is two-fold. First to be easy to include as a git submodule, but also it is because we need a streaming version of the computation and the libfsverity APIs didn't have that. |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
That is not streaming in the same way we need. Yes, you can pass a read_fn to it, but the function is in control of calling it.
What we need it for is that when you call lcfs_write_to() we produce the output bytes one block at a time to a write callback, but we also pass those blocks to a streaming computation of the fs-verity digest. This means that once the image has been written to the caller the digest is available in options->digest out.
This is used for example in ostree when we just compute the digest for an image. If we were to do a two step thing that first creates the image file, and then pass it to libfsverity_compute_digest() we would have to keep the entire file on disk or in…