Cryptography Reference
In-Depth Information
if ( send( connection, ( void * ) send_buffer,
send_buffer_size, 0 ) < send_buffer_size )
{
return -1;
}
free( send_buffer );
return 0;
}
At this point, the actual socket-level send function is called. Now the client
hello message, with its handshake message header, with its TLS header, are sent
to the server for processing. After all of this prepending, the fi nal wire-level
structure is as shown in Figure 6-5.
msg
type
handshake message
body (variable)
type
major
minor
length
length
major
minor
current time
client
random
current time
random bytes
sess
id
len
random bytes
cipher
suites
length
Comp
meth
len
compression
methods
(variable)
session id
(variable)
cipher suites
(variable)
Figure 6-5: TLS Client Hello with all headers
TLS Server Hello
The server should now select one of the supported cipher suites and respond
with a server hello response. The client is required to block, waiting for an
answer; nothing else can happen on this socket until the server responds.
Expand tls_connect :
// Step 2. Receive the server hello response
if ( receive_tls_msg( connection, parameters ) < 0 )
{
perror( “Unable to receive server hello” );
return 2;
}
Search WWH ::




Custom Search