Repository navigation
Commit b21a144
fix: skip malformed agent card signature headers (a2aproject#1335)
## Summary
```diff
for each AgentCard signature:
+ skip malformed base64, UTF-8, or JSON protected headers
attempt verification of remaining signatures
```
The malformed-header failure now reaches the existing
`InvalidSignaturesError` result when no signature verifies, while a
later valid signature can still verify. Fixes a2aproject#1332.
## Evidence
- **Before:** The issue reproduction raised raw `binascii.Error` for
`protected='!!!not-base64url!!!'` and stopped before later signatures.
- **After:** The regression test confirms malformed-only input raises
`InvalidSignaturesError` and malformed-then-valid input verifies.
`./scripts/lint.sh` passed; `uv run pytest --cov=src
--cov-report=term-missing` reported 2,270 passed, 183 skipped, 3
xfailed, 1 xpassed, and 93% total coverage.
## Merge Danger
**Door:** Two-way
**Blast Radius:** Low
Only malformed protected-header parsing is skipped; key-provider and
signature-verification handling remain unchanged.
---------
Co-authored-by: Sean <sean@SeandeMac-mini-2.local>
Co-authored-by: Sean Li <22557931+sean0407@users.noreply.github.com>
Co-authored-by: Mateusz Iwaniuk <45974414+Iwaniukooo11@users.noreply.github.com>1 parent ca3ef0d commit b21a144
2 files changed
Lines changed: 44 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
1 | 2 | | |
2 | 3 | | |
3 | 4 | | |
| |||
144 | 145 | | |
145 | 146 | | |
146 | 147 | | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
147 | 155 | | |
148 | 156 | | |
149 | 157 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
143 | 143 | | |
144 | 144 | | |
145 | 145 | | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
146 | 182 | | |
147 | 183 | | |
148 | 184 | | |
| |||
0 commit comments