Skip to content

Commit e1bd13e

Browse files
committed
ClientHello messages now include a 32-byte random-looking session ID since some TLSv1.0 implementations didn't like our empty session ID fields.
1 parent 2d479f1 commit e1bd13e

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

sslscan.c

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5364,8 +5364,14 @@ bs *makeClientHello(struct sslCheckOptions *options, unsigned int tls_version, b
53645364
bs_append_uint32_t(client_hello, rand);
53655365
}
53665366

5367-
/* Session ID Length: 0 */
5368-
bs_append_bytes(client_hello, (unsigned char []) { 0x00 }, 1);
5367+
/* Session ID Length: 32 */
5368+
bs_append_bytes(client_hello, (unsigned char []) { 32 }, 1);
5369+
5370+
/* A "random" 32-byte session ID. */
5371+
for (int i = 0; i < 8; i++) {
5372+
rand += (time_now ^ (uint32_t)((~(i + 0) << 24) | (~(i + 1) << 16) | (~(i + 2) << 8) | (~(i + 3) << 0)));
5373+
bs_append_uint32_t(client_hello, rand);
5374+
}
53695375

53705376
/* Add the length (in bytes) of the ciphersuites list to the Client Hello. */
53715377
bs_append_ushort(client_hello, bs_get_len(ciphersuite_list));

0 commit comments

Comments
 (0)