ostrya-sys
Ostrya [n. a botanical genus within the family Betulaceae, commonly known as ironwood tree] is a pure-Rust, async implementation of the ostree repository system, written from scratch.
Wrappers for the Linux fs-verity ioctls and for a read-only memory map.
A caller seals a file with fs-verity and reads the digest and the
parameters that the kernel holds for the sealed file. The seal has the
parameters that ostree uses: SHA-256, 4096-byte blocks, and no salt. A
caller can also map a file read-only. The only dependency of the crate is
rustix.
API documentation: https://docs.rs/ostrya-sys
Entry points
enable_verityseals a file with fs-verity.measure_verityreturns the fs-verity digest of a sealed file.read_verity_descriptorreturns the parameters of a sealed file.Mmapis a read-only memory map of a file.
Examples
The example seals a file and reads its parameters and its digest. The file system of the file must support fs-verity.
use File;
use ;
// A read-only descriptor, and no writable descriptor to the file.
let file = open?;
enable_verity?;
let desc = read_verity_descriptor?;
// SHA-256, 4096-byte blocks (2 to the power 12), and no salt.
assert_eq!;
let digest: = measure_verity?;
This crate holds all unsafe code of the ostrya library crates. A
SAFETY comment on each unsafe block gives its reasoning.