Commit 14eeec6
fix(vendor): accept sha1-only SRI as last-resort verification in registry_fetch (#134)
npm-era lockfile entries carry ONLY `integrity sha1-…` (yarn classic
writes them for packages published before sha512 metadata existed).
verify_sri ranked sha512/384/256 and refused everything else, so every
legacy package became unvendorable whenever the prebuilt-artifact
service missed and the local-build fallback fetched the pristine
tarball: `vendor_fetch_failed: no usable hash in SRI sha1-…`. A clean
vendored run on a real 2019-era monorepo failed 14 of 62 packages this
way (ansi-regex@3.0.0, decode-uri-component@0.2.0, semver@5.3.0, …).
sha1 now ranks BELOW sha256/384/512 (never preferred, only used when
it is all the lockfile records) — the same trust the package manager
itself enforces for those entries, and the same decision the
LockIntegrity::Sha1Hex bare-hex arm already made in this file.
New unit test pins: sha1-only verifies, sha1 mismatch refuses (not
fail-open), sha1 never outranks a stronger hash in multi-hash SRIs,
md5 still refused.
Validated end-to-end on the real monorepo: all 14 previously-failing
packages vendor, scan exits success, yarn 1 installs 62/62 vendored
packages byte-identical to their patched blobs.
Co-authored-by: Claude Fable 5 <noreply@anthropic.com>1 parent c8479ae commit 14eeec6
1 file changed
Lines changed: 34 additions & 0 deletions
Lines changed: 34 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
756 | 756 | | |
757 | 757 | | |
758 | 758 | | |
| 759 | + | |
| 760 | + | |
| 761 | + | |
| 762 | + | |
| 763 | + | |
| 764 | + | |
| 765 | + | |
| 766 | + | |
759 | 767 | | |
760 | 768 | | |
761 | 769 | | |
| |||
766 | 774 | | |
767 | 775 | | |
768 | 776 | | |
| 777 | + | |
769 | 778 | | |
770 | 779 | | |
771 | 780 | | |
| |||
779 | 788 | | |
780 | 789 | | |
781 | 790 | | |
| 791 | + | |
782 | 792 | | |
783 | 793 | | |
784 | 794 | | |
| |||
990 | 1000 | | |
991 | 1001 | | |
992 | 1002 | | |
| 1003 | + | |
| 1004 | + | |
| 1005 | + | |
| 1006 | + | |
| 1007 | + | |
| 1008 | + | |
| 1009 | + | |
| 1010 | + | |
| 1011 | + | |
| 1012 | + | |
| 1013 | + | |
| 1014 | + | |
| 1015 | + | |
| 1016 | + | |
| 1017 | + | |
| 1018 | + | |
| 1019 | + | |
| 1020 | + | |
| 1021 | + | |
| 1022 | + | |
| 1023 | + | |
| 1024 | + | |
| 1025 | + | |
| 1026 | + | |
993 | 1027 | | |
994 | 1028 | | |
995 | 1029 | | |
| |||
0 commit comments