Files
buzz/crates
Tom Brow 713b864e2f fix(push-gateway): log which App Attest certificate check failed (#8671)
[#8630](https://github.com/block/buzz/pull/8630) made App Attest
rejections log which check failed. In production, an internal iPhone's
fresh enrollments now log `reason: certificate` with `detail: invalid
certificate path or structure`. That detail still covers about eight
distinct failures: a non-array or empty `x5c`, a bad configured root, a
malformed or duplicate-extension certificate, any webpki path rejection
(untrusted issuer, expiry, unsupported critical extension and so on),
and a key-usage mismatch. So the logs still cannot say why this device's
attestation is rejected while other devices enroll normally.

Each certificate failure now carries a `CertificateCheck`, and the
existing warning's `detail` names it:
- `x5c is not a non-empty array`
- `invalid configured root`
- `invalid encoding at x5c[i]`
- `invalid key usage at x5c[i]`
- `path rejected: <webpki error>`, for example `CertExpired { time: ..,
not_after: .. }` or `UnknownIssuer`

The webpki error includes only its variant and, for validity errors, the
timestamps it compared. It includes no certificate bytes or device
identifiers. The `reason` stays `certificate`, and the HTTP response
stays a uniform `invalid_attestation`.

### Validation
- Added tests: a table test runs each signed bad-chain case through the
production `verify_chain` and asserts the exact check: wrong usage,
expired, unknown critical extension, duplicate extension, trailing
bytes, empty chain, and a bad root. Swapping the key-usage result for
another check fails it. The shared certificate constraint corpus now
builds its chains from the same case list.
- The full push gateway suite passes locally. Clippy is clean. The local
pre-push `rust-tests` lane failed only in `buzz-relay` tests, which do
not depend on this crate, so I skipped it for the push and am relying on
CI for it.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

---------

Signed-off-by: Tom Brow <tomb@block.xyz>
2026-10-28 18:42:39 -07:00
..