tvl-depot/tvix/nix-compat
Florian Klink 7a84a8fe89 fix(nix-compat/nix-hash): relax padding requirements
Nix is quite tolerant when it comes to parsing SRI hashes and their
padding (and only for SRI hashes, it funnily is strict about that in the
non-SRI-hash case).

Nix essentially accepts any number of padding characters, no matter if
it's too much or too little. So we do the only sane thing - simply strip
all padding characters, and parse it with BASE64_NOPAD and the length
the algo uses.

Change-Id: I6a721aa289b06cc36741589792b9dd4c4f930b86
Reviewed-on: https://cl.tvl.fyi/c/depot/+/10468
Reviewed-by: raitobezarius <tvl@lahfa.xyz>
Reviewed-by: tazjin <tazjin@tvl.su>
Tested-by: BuildkiteCI
2024-01-03 13:01:02 +00:00
..
benches fix(nix-compat/narinfo): unwrap in the benchmark 2023-10-28 17:11:22 +00:00
src fix(nix-compat/nix-hash): relax padding requirements 2024-01-03 13:01:02 +00:00
testdata feat(tvix/nix-compat): add narinfo parsing and serialisation 2023-10-27 16:08:06 +00:00
Cargo.toml chore(tvix): switch to upstream futures 0.3.30 2023-12-24 21:45:04 +00:00
default.nix test(tvix/nix-compat/nar/writer/sync): add tests 2023-10-18 12:31:57 +00:00