MCPcopy Create free account
hub / github.com/Meituan-Dianping/SQLAdvisor / buildClientHello

Function buildClientHello

extra/yassl/src/handshake.cpp:36–59  ·  view source on GitHub ↗

Build a client hello message from cipher suites and compression method

Source from the content-addressed store, hash-verified

34
35// Build a client hello message from cipher suites and compression method
36void buildClientHello(SSL& ssl, ClientHello& hello)
37{
38 // store for pre master secret
39 ssl.useSecurity().use_connection().chVersion_ = hello.client_version_;
40
41 ssl.getCrypto().get_random().Fill(hello.random_, RAN_LEN);
42 if (ssl.getSecurity().get_resuming()) {
43 hello.id_len_ = ID_LEN;
44 memcpy(hello.session_id_, ssl.getSecurity().get_resume().GetID(),
45 ID_LEN);
46 }
47 else
48 hello.id_len_ = 0;
49 hello.suite_len_ = ssl.getSecurity().get_parms().suites_size_;
50 memcpy(hello.cipher_suites_, ssl.getSecurity().get_parms().suites_,
51 hello.suite_len_);
52 hello.comp_len_ = 1;
53
54 hello.set_length(sizeof(ProtocolVersion) +
55 RAN_LEN +
56 hello.id_len_ + sizeof(hello.id_len_) +
57 hello.suite_len_ + sizeof(hello.suite_len_) +
58 hello.comp_len_ + sizeof(hello.comp_len_));
59}
60
61
62// Build a server hello message

Callers 1

sendClientHelloFunction · 0.85

Calls 6

FillMethod · 0.80
get_randomMethod · 0.80
get_resumingMethod · 0.80
GetIDMethod · 0.80
get_parmsMethod · 0.80
set_lengthMethod · 0.80

Tested by

no test coverage detected