tvl-depot/tvix/nix-compat/src
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
..
aterm docs(nix-compat/aterm/parser): fix docstring 2023-12-21 16:43:44 +00:00
bin docs(nix-compat/drvfmt): fix reference 2023-12-21 16:39:07 +00:00
derivation docs(nix-compat/derivation): fix docstring 2023-12-21 16:44:16 +00:00
nar docs(nix-compat/nar/reader): fix reference 2023-12-21 16:44:16 +00:00
narinfo docs(nix-compat/narinfo): fix reference 2023-12-21 16:36:34 +00:00
nixhash fix(nix-compat/nix-hash): relax padding requirements 2024-01-03 13:01:02 +00:00
store_path feat(nix-compat/store_path): build_ca_path may fail 2024-01-01 00:52:41 +00:00
lib.rs feat(tvix/nix-compat): add narinfo parsing and serialisation 2023-10-27 16:08:06 +00:00
nixbase32.rs refactor(nix-compat/nixbase32): address clippy 2023-12-09 12:58:39 +00:00