Commit f55806a
committed
fix(remote): wrap content.ErrMismatchedDigest on a Docker-Content-Digest mismatch
verifyContentDigest and (*manifestStore).generateDescriptor reported a
response digest mismatch with a bare fmt.Errorf, so errors.Is could not
classify it as content.ErrMismatchedDigest even though it is exactly the
failure that sentinel names. ReadAll() already wrapped it, so whether a
caller could classify "the registry served the wrong bytes" depended on
which layer caught it.
Wrap content.ErrMismatchedDigest at both sites and widen the sentinel's
doc comment to cover every detection point, not just ReadAll(). The
malformed-header branch keeps its unwrapped error, and the message text
is otherwise unchanged.
Extend the two subtests that already drive these paths with the
errors.Is assertion; both fail against unmodified main.
Fixes #1470
Signed-off-by: fuleinist <1163738+fuleinist@users.noreply.github.com>1 parent c3de6f8 commit f55806a
3 files changed
Lines changed: 12 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
40 | 40 | | |
41 | 41 | | |
42 | 42 | | |
43 | | - | |
44 | | - | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
45 | 47 | | |
46 | 48 | | |
47 | 49 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2209 | 2209 | | |
2210 | 2210 | | |
2211 | 2211 | | |
2212 | | - | |
| 2212 | + | |
2213 | 2213 | | |
2214 | 2214 | | |
2215 | 2215 | | |
| 2216 | + | |
2216 | 2217 | | |
2217 | 2218 | | |
2218 | 2219 | | |
| |||
2260 | 2261 | | |
2261 | 2262 | | |
2262 | 2263 | | |
2263 | | - | |
| 2264 | + | |
2264 | 2265 | | |
2265 | 2266 | | |
2266 | 2267 | | |
| 2268 | + | |
2267 | 2269 | | |
2268 | 2270 | | |
2269 | 2271 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3373 | 3373 | | |
3374 | 3374 | | |
3375 | 3375 | | |
| 3376 | + | |
| 3377 | + | |
3376 | 3378 | | |
3377 | 3379 | | |
3378 | 3380 | | |
| |||
4326 | 4328 | | |
4327 | 4329 | | |
4328 | 4330 | | |
| 4331 | + | |
| 4332 | + | |
4329 | 4333 | | |
4330 | 4334 | | |
4331 | 4335 | | |
| |||
0 commit comments