Repository navigation
Commit 6a8ebd5
TLS: Generate the server random before processing ClientHello extensions
The server random was only generated after all of the ClientHello extensions had
been processed. In (D)TLSv1.3 the PSK callbacks are invoked while the
pre_shared_key extension is being parsed, so a call to SSL_get_server_random()
from within them returned all zeros. The TLSv1.2 psk_server_callback runs during
ClientKeyExchange processing and so already observed the real value, making the
behaviour inconsistent between protocol versions.
Move the generation of the server random to immediately after the protocol
version has been selected and before any of the remaining ClientHello
processing. As a result the server random is also visible from the other
callbacks invoked during ClientHello processing, such as the session ticket and
servername callbacks.
Fixes openssl#26404
Assisted-by: Claude:claude-fable-5-1
Co-authored-by: Frederik Wedel-Heinen <frederik.wedel-heinen@dencrypt.dk>1 parent 0673930 commit 6a8ebd5
4 files changed
Lines changed: 320 additions & 16 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
74 | 74 | | |
75 | 75 | | |
76 | 76 | | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
77 | 90 | | |
78 | 91 | | |
79 | 92 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2085 | 2085 | | |
2086 | 2086 | | |
2087 | 2087 | | |
| 2088 | + | |
2088 | 2089 | | |
2089 | 2090 | | |
2090 | 2091 | | |
| |||
2161 | 2162 | | |
2162 | 2163 | | |
2163 | 2164 | | |
| 2165 | + | |
| 2166 | + | |
| 2167 | + | |
| 2168 | + | |
| 2169 | + | |
| 2170 | + | |
| 2171 | + | |
| 2172 | + | |
| 2173 | + | |
| 2174 | + | |
| 2175 | + | |
| 2176 | + | |
| 2177 | + | |
| 2178 | + | |
| 2179 | + | |
2164 | 2180 | | |
2165 | 2181 | | |
2166 | 2182 | | |
| |||
2330 | 2346 | | |
2331 | 2347 | | |
2332 | 2348 | | |
2333 | | - | |
2334 | | - | |
2335 | | - | |
2336 | | - | |
2337 | | - | |
2338 | | - | |
2339 | | - | |
2340 | | - | |
2341 | | - | |
2342 | | - | |
2343 | | - | |
2344 | | - | |
2345 | | - | |
2346 | | - | |
2347 | | - | |
2348 | 2349 | | |
2349 | 2350 | | |
2350 | 2351 | | |
| |||
2809 | 2810 | | |
2810 | 2811 | | |
2811 | 2812 | | |
2812 | | - | |
| 2813 | + | |
2813 | 2814 | | |
2814 | 2815 | | |
2815 | 2816 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1336 | 1336 | | |
1337 | 1337 | | |
1338 | 1338 | | |
| 1339 | + | |
| 1340 | + | |
| 1341 | + | |
| 1342 | + | |
| 1343 | + | |
| 1344 | + | |
| 1345 | + | |
| 1346 | + | |
| 1347 | + | |
1339 | 1348 | | |
1340 | 1349 | | |
1341 | 1350 | | |
1342 | 1351 | | |
1343 | 1352 | | |
| 1353 | + | |
| 1354 | + | |
| 1355 | + | |
| 1356 | + | |
1344 | 1357 | | |
1345 | 1358 | | |
1346 | 1359 | | |
| |||
1361 | 1374 | | |
1362 | 1375 | | |
1363 | 1376 | | |
| 1377 | + | |
| 1378 | + | |
| 1379 | + | |
| 1380 | + | |
1364 | 1381 | | |
1365 | 1382 | | |
1366 | 1383 | | |
| |||
1387 | 1404 | | |
1388 | 1405 | | |
1389 | 1406 | | |
| 1407 | + | |
| 1408 | + | |
| 1409 | + | |
| 1410 | + | |
| 1411 | + | |
| 1412 | + | |
| 1413 | + | |
| 1414 | + | |
| 1415 | + | |
| 1416 | + | |
| 1417 | + | |
| 1418 | + | |
| 1419 | + | |
| 1420 | + | |
| 1421 | + | |
| 1422 | + | |
| 1423 | + | |
| 1424 | + | |
| 1425 | + | |
| 1426 | + | |
| 1427 | + | |
| 1428 | + | |
| 1429 | + | |
| 1430 | + | |
| 1431 | + | |
| 1432 | + | |
| 1433 | + | |
| 1434 | + | |
| 1435 | + | |
1390 | 1436 | | |
1391 | 1437 | | |
1392 | 1438 | | |
| 1439 | + | |
1393 | 1440 | | |
1394 | 1441 | | |
1395 | 1442 | | |
| |||
0 commit comments