Commit da07b7a
authored
See #95 for more context.
CTAP canonical CBOR encoding requires map keys to be sorted from shorter
key-length, to longer key-lenght.
No trivial root-cause fix due to serde_cbor, but thankfully the CBOR
data structures with string keys in libwebauthn are limited.
Added tests to prevent regressions.
## Test vectors
As decoded by [cbor.me](https://cbor.me).
### Ctap2CredentialType
```
A2 # map(2)
63 # text(3)
616C67 # "alg"
26 # negative(6)
64 # text(4)
74797065 # "type"
6A # text(10)
7075626C69632D6B6579 # "public-key"
```
### Ctap2PublicKeyCredentialDescriptor
```
A2 # map(2)
62 # text(2)
6964 # "id"
41 # bytes(1)
42 # "B"
64 # text(4)
74797065 # "type"
6A # text(10)
7075626C69632D6B6579 # "public-key"
```
1 parent db56a46 commit da07b7a
2 files changed
Lines changed: 42 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
41 | 41 | | |
42 | 42 | | |
43 | 43 | | |
44 | | - | |
| 44 | + | |
45 | 45 | | |
46 | 46 | | |
47 | 47 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
139 | 139 | | |
140 | 140 | | |
141 | 141 | | |
142 | | - | |
143 | 142 | | |
| 143 | + | |
144 | 144 | | |
145 | 145 | | |
146 | 146 | | |
| |||
156 | 156 | | |
157 | 157 | | |
158 | 158 | | |
159 | | - | |
160 | | - | |
161 | | - | |
162 | 159 | | |
163 | 160 | | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
164 | 164 | | |
165 | 165 | | |
166 | 166 | | |
| |||
205 | 205 | | |
206 | 206 | | |
207 | 207 | | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
0 commit comments