Repository navigation
Commit 6ea9c11
Address review of the re-signed manifest rule
Look a member up by the raw bytes of its name. The zip reader's own
lookup is by a name it decodes as CP437 when an entry lacks the UTF-8
flag, so a UTF-8 name written without it was missed and a valid jar
refused as holding a section for a member it does not hold.
Read the manifest within the jar limits alone: the 16 MiB cap of its
own was below them. A jar past a limit while the manifest is read is
the caller's too-large refusal, not a difference.
Replace the MD5 that computed its constants with f64::sin and held the
whole member: a constant table, fed block by block, checked against the
RFC 1321 vectors.
Take a member's SHA-256 from the digests the comparison already holds
instead of inflating it again, open each jar once and parse each section
once.
Match a changed digest line without regard to the case of its name.
Name signing in a refusal only when the patched jar is signed: an
unsigned jar whose manifest differs is the ordinary wrong-base case.
Remove what no caller reaches: a section dropped with a member the
record deletes (every path requires a record member at its afterHash),
and the baseline taken from a record that lists the manifest. Such a
jar is refused for now, and the contract says so. The docs state the
rule as implemented.
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>1 parent 74765d5 commit 6ea9c11
6 files changed
Lines changed: 606 additions & 238 deletions
File tree
- crates
- socket-patch-cli
- socket-patch-core/src
- patch
- vendor
- docs
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2831 | 2831 | | |
2832 | 2832 | | |
2833 | 2833 | | |
2834 | | - | |
2835 | | - | |
| 2834 | + | |
| 2835 | + | |
| 2836 | + | |
2836 | 2837 | | |
2837 | 2838 | | |
2838 | 2839 | | |
| |||
3253 | 3254 | | |
3254 | 3255 | | |
3255 | 3256 | | |
3256 | | - | |
| 3257 | + | |
3257 | 3258 | | |
3258 | 3259 | | |
3259 | | - | |
3260 | | - | |
| 3260 | + | |
| 3261 | + | |
| 3262 | + | |
| 3263 | + | |
3261 | 3264 | | |
3262 | 3265 | | |
3263 | 3266 | | |
| |||
3266 | 3269 | | |
3267 | 3270 | | |
3268 | 3271 | | |
3269 | | - | |
3270 | | - | |
3271 | | - | |
| 3272 | + | |
| 3273 | + | |
| 3274 | + | |
| 3275 | + | |
| 3276 | + | |
| 3277 | + | |
| 3278 | + | |
| 3279 | + | |
| 3280 | + | |
3272 | 3281 | | |
3273 | 3282 | | |
3274 | 3283 | | |
| |||
0 commit comments