Commit 7947c73
committed
Assert the server's own refusal and the second ClientHello's message_seq, relates to github #1468.
The re-review of the previous fixes found two comments claiming more than the
code does and two test assertions weaker than their messages.
The notification comment said the call was placed exactly as
TlsServerProtocol does it. The version gating is mirrored; the ordering
relative to the other TlsServer callbacks is not, and cannot be, because
DTLS selects the version in generateServerHello, by which point
establishClientSigAlgs and processClientExtensions have already run. Say
both, rather than claiming a wholesale mirror.
DTLSVerifier produces a DTLSRequest for any ClientHello carrying a cookie it
has verified, so it need not have sent the HelloVerifyRequest during that
call. The invariant is that the ClientHello arrived through the cookie
exchange.
The server-refusal test asserted the internal_error the client receives,
which is not specific to this cause, so the harness now records what the
server itself threw and the test asserts that diagnostic. The harness also
stops printing a stack trace for a server abort a test expects, which
otherwise makes a passing test look like a failing one.
Counting datagrams that carry a ClientHello cannot tell a new message from a
retransmission of the first, so the scripted transport records each
ClientHello's message_seq and the test requires it to advance to 1, per
RFC 6347 4.2.2.1 parent 170e6a0 commit 7947c73
3 files changed
Lines changed: 84 additions & 11 deletions
File tree
- tls/src
- main/java/org/bouncycastle/tls
- test/java/org/bouncycastle/tls/test
Lines changed: 15 additions & 8 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
134 | 134 | | |
135 | 135 | | |
136 | 136 | | |
137 | | - | |
138 | | - | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
139 | 140 | | |
140 | 141 | | |
141 | 142 | | |
| |||
1677 | 1678 | | |
1678 | 1679 | | |
1679 | 1680 | | |
1680 | | - | |
1681 | | - | |
1682 | | - | |
1683 | | - | |
1684 | | - | |
1685 | | - | |
| 1681 | + | |
| 1682 | + | |
| 1683 | + | |
| 1684 | + | |
| 1685 | + | |
| 1686 | + | |
| 1687 | + | |
| 1688 | + | |
| 1689 | + | |
| 1690 | + | |
| 1691 | + | |
| 1692 | + | |
1686 | 1693 | | |
1687 | 1694 | | |
1688 | 1695 | | |
| |||
Lines changed: 28 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
97 | 97 | | |
98 | 98 | | |
99 | 99 | | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
100 | 109 | | |
101 | 110 | | |
102 | 111 | | |
| |||
250 | 259 | | |
251 | 260 | | |
252 | 261 | | |
| 262 | + | |
| 263 | + | |
253 | 264 | | |
254 | 265 | | |
255 | 266 | | |
| |||
268 | 279 | | |
269 | 280 | | |
270 | 281 | | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
271 | 292 | | |
272 | 293 | | |
273 | 294 | | |
| |||
284 | 305 | | |
285 | 306 | | |
286 | 307 | | |
| 308 | + | |
| 309 | + | |
| 310 | + | |
| 311 | + | |
| 312 | + | |
| 313 | + | |
| 314 | + | |
287 | 315 | | |
288 | 316 | | |
289 | 317 | | |
| |||
Lines changed: 41 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
786 | 786 | | |
787 | 787 | | |
788 | 788 | | |
| 789 | + | |
789 | 790 | | |
790 | 791 | | |
791 | 792 | | |
| |||
809 | 810 | | |
810 | 811 | | |
811 | 812 | | |
| 813 | + | |
| 814 | + | |
| 815 | + | |
| 816 | + | |
| 817 | + | |
| 818 | + | |
| 819 | + | |
| 820 | + | |
| 821 | + | |
| 822 | + | |
812 | 823 | | |
813 | 824 | | |
814 | 825 | | |
| |||
1750 | 1761 | | |
1751 | 1762 | | |
1752 | 1763 | | |
| 1764 | + | |
| 1765 | + | |
| 1766 | + | |
1753 | 1767 | | |
1754 | 1768 | | |
1755 | 1769 | | |
| |||
2194 | 2208 | | |
2195 | 2209 | | |
2196 | 2210 | | |
2197 | | - | |
| 2211 | + | |
2198 | 2212 | | |
2199 | 2213 | | |
2200 | 2214 | | |
| |||
2257 | 2271 | | |
2258 | 2272 | | |
2259 | 2273 | | |
| 2274 | + | |
| 2275 | + | |
2260 | 2276 | | |
2261 | 2277 | | |
2262 | 2278 | | |
| |||
2414 | 2430 | | |
2415 | 2431 | | |
2416 | 2432 | | |
| 2433 | + | |
2417 | 2434 | | |
| 2435 | + | |
2418 | 2436 | | |
2419 | 2437 | | |
2420 | | - | |
| 2438 | + | |
2421 | 2439 | | |
2422 | 2440 | | |
2423 | 2441 | | |
2424 | 2442 | | |
2425 | 2443 | | |
| 2444 | + | |
| 2445 | + | |
| 2446 | + | |
| 2447 | + | |
| 2448 | + | |
| 2449 | + | |
| 2450 | + | |
| 2451 | + | |
| 2452 | + | |
| 2453 | + | |
| 2454 | + | |
2426 | 2455 | | |
2427 | 2456 | | |
2428 | 2457 | | |
| |||
2452 | 2481 | | |
2453 | 2482 | | |
2454 | 2483 | | |
2455 | | - | |
| 2484 | + | |
| 2485 | + | |
| 2486 | + | |
| 2487 | + | |
| 2488 | + | |
| 2489 | + | |
| 2490 | + | |
| 2491 | + | |
| 2492 | + | |
| 2493 | + | |
2456 | 2494 | | |
2457 | 2495 | | |
2458 | 2496 | | |
| |||
0 commit comments