Commit db14bc7
committed
src/internal.c: defer ticket SNI/ALPN binding check until after parsing
The early checks in DoClientTicketCheck and DoClientTicket ran before
the corresponding extensions were parsed, so the computed current hash
was zero while the ticket's stored hash was non-zero, rejecting valid
resumptions in the nginx, haproxy, grpc and CPython integration tests.
* TLS 1.3: DoTls13ClientHello processes pre_shared_key before
ALPN_Select, so TLSX_ALPN_GetRequest returned WOLFSSL_ALPN_NOT_FOUND.
* TLS 1.2: ClientHello extensions are parsed in wire order; clients
that put SessionTicket before server_name / ALPN hit the same
problem with both bindings.
Consolidate the verification into a single VerifyTicketBinding()
function, called once on the server after ALPN_Select (in both
DoTls13ClientHello and DoClientHello). DoClientTicketFinalize copies
the ticket's stored bindings onto ssl->session so the deferred check
has the values to compare. The early per-call sites are removed.
VerifyTicketBinding returns WOLFSSL_FATAL_ERROR on mismatch; the
caller currently aborts the handshake. Behaviour on mismatch (error
vs fallback to a fresh handshake) can be revisited from this single
point.1 parent 66074e2 commit db14bc7
3 files changed
Lines changed: 58 additions & 51 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
38468 | 38468 | | |
38469 | 38469 | | |
38470 | 38470 | | |
| 38471 | + | |
| 38472 | + | |
| 38473 | + | |
| 38474 | + | |
| 38475 | + | |
38471 | 38476 | | |
38472 | 38477 | | |
38473 | 38478 | | |
| |||
39250 | 39255 | | |
39251 | 39256 | | |
39252 | 39257 | | |
39253 | | - | |
39254 | | - | |
| 39258 | + | |
39255 | 39259 | | |
39256 | 39260 | | |
39257 | 39261 | | |
| |||
39271 | 39275 | | |
39272 | 39276 | | |
39273 | 39277 | | |
39274 | | - | |
39275 | | - | |
| 39278 | + | |
39276 | 39279 | | |
39277 | 39280 | | |
39278 | 39281 | | |
| |||
39290 | 39293 | | |
39291 | 39294 | | |
39292 | 39295 | | |
| 39296 | + | |
| 39297 | + | |
| 39298 | + | |
| 39299 | + | |
| 39300 | + | |
| 39301 | + | |
| 39302 | + | |
| 39303 | + | |
| 39304 | + | |
| 39305 | + | |
| 39306 | + | |
| 39307 | + | |
| 39308 | + | |
| 39309 | + | |
| 39310 | + | |
| 39311 | + | |
| 39312 | + | |
| 39313 | + | |
| 39314 | + | |
| 39315 | + | |
| 39316 | + | |
| 39317 | + | |
| 39318 | + | |
| 39319 | + | |
| 39320 | + | |
| 39321 | + | |
| 39322 | + | |
| 39323 | + | |
| 39324 | + | |
| 39325 | + | |
| 39326 | + | |
| 39327 | + | |
39293 | 39328 | | |
39294 | 39329 | | |
39295 | 39330 | | |
| |||
39755 | 39790 | | |
39756 | 39791 | | |
39757 | 39792 | | |
39758 | | - | |
39759 | | - | |
39760 | | - | |
39761 | | - | |
39762 | | - | |
39763 | | - | |
39764 | | - | |
39765 | | - | |
39766 | | - | |
39767 | | - | |
39768 | | - | |
39769 | | - | |
39770 | | - | |
39771 | | - | |
39772 | | - | |
39773 | | - | |
39774 | | - | |
39775 | | - | |
39776 | | - | |
39777 | | - | |
39778 | | - | |
39779 | | - | |
| 39793 | + | |
| 39794 | + | |
39780 | 39795 | | |
39781 | 39796 | | |
39782 | 39797 | | |
| |||
39872 | 39887 | | |
39873 | 39888 | | |
39874 | 39889 | | |
| 39890 | + | |
| 39891 | + | |
| 39892 | + | |
| 39893 | + | |
| 39894 | + | |
| 39895 | + | |
| 39896 | + | |
| 39897 | + | |
39875 | 39898 | | |
39876 | 39899 | | |
39877 | 39900 | | |
| |||
40231 | 40254 | | |
40232 | 40255 | | |
40233 | 40256 | | |
40234 | | - | |
40235 | | - | |
40236 | | - | |
40237 | | - | |
40238 | | - | |
40239 | | - | |
40240 | | - | |
40241 | | - | |
40242 | | - | |
40243 | | - | |
40244 | | - | |
40245 | | - | |
40246 | | - | |
40247 | | - | |
40248 | | - | |
40249 | | - | |
40250 | | - | |
40251 | | - | |
40252 | | - | |
40253 | | - | |
40254 | | - | |
40255 | | - | |
40256 | | - | |
40257 | | - | |
40258 | | - | |
| 40257 | + | |
| 40258 | + | |
40259 | 40259 | | |
40260 | 40260 | | |
40261 | 40261 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7555 | 7555 | | |
7556 | 7556 | | |
7557 | 7557 | | |
| 7558 | + | |
| 7559 | + | |
| 7560 | + | |
| 7561 | + | |
7558 | 7562 | | |
7559 | 7563 | | |
7560 | 7564 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6790 | 6790 | | |
6791 | 6791 | | |
6792 | 6792 | | |
| 6793 | + | |
| 6794 | + | |
| 6795 | + | |
6793 | 6796 | | |
6794 | 6797 | | |
6795 | 6798 | | |
| |||
0 commit comments