Cryptography Reference
In-Depth Information
Dissecting the Server Response Messages
The server then sends back the server hello, certifi cate and server hello done
messages. Notice that in this case, they're not included in a single TLS packet,
although the specifi cation allows for this. This single TCP packet includes three
individual top-level TLS messages.
The fi rst is of length 75 bytes (0x004a) and contains a handshake message of
type 2 (server hello). The server hello packet, of course, starts with the version
number 0x0301, followed by the 32-byte server random structure. Servers nor-
mally assign a session ID to every connection, so the session ID in this case is
non-empty; it is 32 bytes long and is equal to 07e76fed29bfc73b710b0c2757fcd
1a7b325561b232906ceb3d8a0347f3bd2f5 . The server hello fi nishes out by select-
ing a cipher suite and a compression method. Obviously it chose 0x002F and
0x00 , respectively, because those were the only two choices it was given. If it
didn't recognize, or didn't support, any of these choices then this server hello
message would have instead been an alert.
12:37:03.938904 IP localhost.localdomain.https > localhost.localdomain.56047: P
1:822(821) ack 51 win 256 <nop,nop,timestamp 12673268 12673267>
Handshake
Header
0x0000: 4500 0369 82e3 4000 4006 b6a9 7f00 0001 E..i..@.@.......
TLS
Header
TLS Version
(3.1)
0x0010: 7f00 0001 01bb daef 1e28 e211 1e32 63e5 .........(...2c.
0x0020: 8018 0100 015e 0000 0101 080a 00c1 60f4 .....^........`.
0x0030: 00c1 60f3 1603 0100 4a02 0000 4603 014c ..`.....J...F..L
0x0040: 4f19 3fe5 8513 ecba f396 6b6a b96f bfbe O.?.......kj.o..
Server
Random
Session Id
Length
0x0050: e410 52ae 1b64 3c93 174f 38a6 548e 5320 ..R..d<..O8.T.S.
Session ID
0x0060: 07e7 6fed 29bf c73b 710b 0c27 57fc d1a7 ..o.)..;q.. W...
Selected
Compression
Selected
Cipher Suite
0x0070: b325 561b 2329 06ce b3d8 a034 7f3b d2f5 .%V.#).....4.;..
0x0080: 002f 00
A server hello is generally followed by a server certifi cate message. This is
not necessarily always the case, as you see in Chapter 8, but generally it is. Here
the TLS header indicates that the following message is 344 ( 0x02d8 ) bytes long
and is a server handshake certifi cate message (handshake message 0x0b ). This
message in turns starts out with a three-byte length declaration — 0x0002d1
indicating that the following certifi cate chain is 337 bytes long. After this is yet
another length declaration 0x0002ce , indicating that the fi rst certifi cate in this
certifi cate chain — in this case, the only certifi cate in this chain — is 334 bytes
long. Finally, the ASN.1 DER representation of the server's certifi cate follows.
16 0301 02d8 0b00 02d4 0002 d100 ./..............
0x0090: 02ce 3082 02ca 3082 0274 a003 0201 0202 ..0...0..t......
0x00a0: 0900 a72f c757 5f51 e56f 300d 0609 2a86 .../.W_Q.o0...*.
0x00b0: 4886 f70d 0101 0505 0030 7931 0b30 0906 H........0y1.0..
....
Search WWH ::




Custom Search