Commit e8bd78f
committed
fix(signing): preserve a trailing empty query in @target-uri
`urlsplit` maps both `/p` and `/p?` to `query == ""`, and `urlunsplit` emits no
`?` for an empty string, so the two URLs collapsed to one signature base. A
signer that sent `/p?` and a verifier that reconstructed `/p` produced identical
bytes for different URLs and agreed -- the confusion `@target-uri` exists to
prevent.
The distinction is already lost by the time the split result exists, so it is
recovered from the raw URL. The fragment is excluded first: in
`https://e.com/p#f?x` the `?` belongs to the fragment and must NOT be
resurrected, while `https://e.com/p?#frag` must keep its `?`. No vector combines
a fragment with a query, so a plain `"?" in url` test passes the vector and gets
that case wrong.
Retires the last entry in KNOWN_CANONICALIZATION_GAPS. All 31 canonicalization
cases now pass with zero xfail and zero skip. The ledger mechanism stays --
deleting it would re-create #975 at the next vector refresh.
Fixes #979.1 parent 7548cc8 commit e8bd78f
2 files changed
Lines changed: 12 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
126 | 126 | | |
127 | 127 | | |
128 | 128 | | |
129 | | - | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
130 | 140 | | |
131 | 141 | | |
132 | 142 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
29 | 29 | | |
30 | 30 | | |
31 | 31 | | |
32 | | - | |
33 | | - | |
34 | | - | |
35 | | - | |
36 | | - | |
| 32 | + | |
37 | 33 | | |
38 | 34 | | |
39 | 35 | | |
| |||
0 commit comments