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

Function buildServerHello

extra/yassl/src/handshake.cpp:63–84  ·  view source on GitHub ↗

Build a server hello message

Source from the content-addressed store, hash-verified

61
62// Build a server hello message
63void buildServerHello(SSL& ssl, ServerHello& hello)
64{
65 if (ssl.getSecurity().get_resuming()) {
66 memcpy(hello.random_,ssl.getSecurity().get_connection().server_random_,
67 RAN_LEN);
68 memcpy(hello.session_id_, ssl.getSecurity().get_resume().GetID(),
69 ID_LEN);
70 }
71 else {
72 ssl.getCrypto().get_random().Fill(hello.random_, RAN_LEN);
73 ssl.getCrypto().get_random().Fill(hello.session_id_, ID_LEN);
74 }
75 hello.id_len_ = ID_LEN;
76 ssl.set_sessionID(hello.session_id_);
77
78 hello.cipher_suite_[0] = ssl.getSecurity().get_parms().suite_[0];
79 hello.cipher_suite_[1] = ssl.getSecurity().get_parms().suite_[1];
80 hello.compression_method_ = hello.compression_method_;
81
82 hello.set_length(sizeof(ProtocolVersion) + RAN_LEN + ID_LEN +
83 sizeof(hello.id_len_) + SUITE_LEN + SIZEOF_ENUM);
84}
85
86
87// add handshake from buffer into md5 and sha hashes, use handshake header

Callers 1

sendServerHelloFunction · 0.85

Calls 7

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

Tested by

no test coverage detected