#include <yassl_imp.hpp>
Inheritance diagram for yaSSL::ServerHello:


Public Member Functions | |
| ServerHello (ProtocolVersion pv) | |
| ServerHello () | |
| input_buffer & | set (input_buffer &in) |
| output_buffer & | get (output_buffer &out) const |
| HandShakeType | get_type () const |
| void | Process (input_buffer &, SSL &) |
| const opaque * | get_random () const |
Private Member Functions | |
| ServerHello (const ServerHello &) | |
| ServerHello & | operator= (const ServerHello &) |
Private Attributes | |
| ProtocolVersion | server_version_ |
| Random | random_ |
| uint8 | id_len_ |
| opaque | session_id_ [ID_LEN] |
| opaque | cipher_suite_ [SUITE_LEN] |
| CompressionMethod | compression_method_ |
Friends | |
| input_buffer & | operator>> (input_buffer &, ServerHello &) |
| output_buffer & | operator<< (output_buffer &, const ServerHello &) |
| void | buildServerHello (SSL &, ServerHello &) |
Definition at line 245 of file yassl_imp.hpp.
| yaSSL::ServerHello::ServerHello | ( | ProtocolVersion | pv | ) | [explicit] |
Definition at line 1250 of file yassl_imp.cpp.
References yaSSL::ID_LEN, memset, yaSSL::RAN_LEN, random_, and session_id_.
01251 : server_version_(pv) 01252 { 01253 memset(random_, 0, RAN_LEN); 01254 memset(session_id_, 0, ID_LEN); 01255 }
| yaSSL::ServerHello::ServerHello | ( | ) |
Definition at line 1243 of file yassl_imp.cpp.
References yaSSL::ID_LEN, memset, yaSSL::RAN_LEN, random_, and session_id_.
| yaSSL::ServerHello::ServerHello | ( | const ServerHello & | ) | [private] |
| output_buffer & yaSSL::ServerHello::get | ( | output_buffer & | out | ) | const [virtual] |
| const opaque * yaSSL::ServerHello::get_random | ( | ) | const |
Definition at line 1276 of file yassl_imp.cpp.
References random_.
01277 { 01278 return random_; 01279 }
| HandShakeType yaSSL::ServerHello::get_type | ( | ) | const [virtual] |
Implements yaSSL::HandShakeBase.
Definition at line 1270 of file yassl_imp.cpp.
References yaSSL::server_hello.
01271 { 01272 return server_hello; 01273 }
| ServerHello& yaSSL::ServerHello::operator= | ( | const ServerHello & | ) | [private] |
| void yaSSL::ServerHello::Process | ( | input_buffer & | , | |
| SSL & | ||||
| ) | [virtual] |
Implements yaSSL::HandShakeBase.
Definition at line 1215 of file yassl_imp.cpp.
References cipher_suite_, yaSSL::SSL::deriveKeys(), yaSSL::SSL::deriveTLSKeys(), yaSSL::Security::get_resume(), yaSSL::Security::get_resuming(), yaSSL::SSL_SESSION::GetID(), yaSSL::SSL_SESSION::GetSecret(), yaSSL::SSL::getSecurity(), yaSSL::ID_LEN, id_len_, yaSSL::SSL::isTLS(), memcmp(), random_, yaSSL::server_end, yaSSL::serverHelloComplete, yaSSL::serverHelloDoneComplete, session_id_, yaSSL::Connection::sessionID_Set_, yaSSL::SSL::set_masterSecret(), yaSSL::SSL::set_pending(), yaSSL::SSL::set_random(), yaSSL::Security::set_resuming(), yaSSL::SSL::set_sessionID(), yaSSL::Log::Trace(), yaSSL::Security::use_connection(), yaSSL::States::useClient(), yaSSL::SSL::useLog(), yaSSL::SSL::useSecurity(), and yaSSL::SSL::useStates().
01216 { 01217 ssl.set_pending(cipher_suite_[1]); 01218 ssl.set_random(random_, server_end); 01219 if (id_len_) 01220 ssl.set_sessionID(session_id_); 01221 else 01222 ssl.useSecurity().use_connection().sessionID_Set_ = false; 01223 01224 if (ssl.getSecurity().get_resuming()) 01225 if (memcmp(session_id_, ssl.getSecurity().get_resume().GetID(), 01226 ID_LEN) == 0) { 01227 ssl.set_masterSecret(ssl.getSecurity().get_resume().GetSecret()); 01228 if (ssl.isTLS()) 01229 ssl.deriveTLSKeys(); 01230 else 01231 ssl.deriveKeys(); 01232 ssl.useStates().useClient() = serverHelloDoneComplete; 01233 return; 01234 } 01235 else { 01236 ssl.useSecurity().set_resuming(false); 01237 ssl.useLog().Trace("server denied resumption"); 01238 } 01239 ssl.useStates().useClient() = serverHelloComplete; 01240 }
Here is the call graph for this function:

| input_buffer & yaSSL::ServerHello::set | ( | input_buffer & | in | ) | [virtual] |
| void buildServerHello | ( | SSL & | ssl, | |
| ServerHello & | hello | |||
| ) | [friend] |
Definition at line 70 of file handshake.cpp.
00071 { 00072 if (ssl.getSecurity().get_resuming()) { 00073 memcpy(hello.random_,ssl.getSecurity().get_connection().server_random_, 00074 RAN_LEN); 00075 memcpy(hello.session_id_, ssl.getSecurity().get_resume().GetID(), 00076 ID_LEN); 00077 } 00078 else { 00079 ssl.getCrypto().get_random().Fill(hello.random_, RAN_LEN); 00080 ssl.getCrypto().get_random().Fill(hello.session_id_, ID_LEN); 00081 } 00082 hello.id_len_ = ID_LEN; 00083 ssl.set_sessionID(hello.session_id_); 00084 00085 hello.cipher_suite_[0] = ssl.getSecurity().get_parms().suite_[0]; 00086 hello.cipher_suite_[1] = ssl.getSecurity().get_parms().suite_[1]; 00087 hello.compression_method_ = no_compression; 00088 00089 hello.set_length(sizeof(ProtocolVersion) + RAN_LEN + ID_LEN + 00090 sizeof(hello.id_len_) + SUITE_LEN + SIZEOF_ENUM); 00091 }
| output_buffer& operator<< | ( | output_buffer & | output, | |
| const ServerHello & | hello | |||
| ) | [friend] |
Definition at line 1190 of file yassl_imp.cpp.
01191 { 01192 // Protocol 01193 output[AUTO] = hello.server_version_.major_; 01194 output[AUTO] = hello.server_version_.minor_; 01195 01196 // Random 01197 output.write(hello.random_, RAN_LEN); 01198 01199 // Session 01200 output[AUTO] = hello.id_len_; 01201 output.write(hello.session_id_, ID_LEN); 01202 01203 // Suites 01204 output[AUTO] = hello.cipher_suite_[0]; 01205 output[AUTO] = hello.cipher_suite_[1]; 01206 01207 // Compression 01208 output[AUTO] = hello.compression_method_; 01209 01210 return output; 01211 }
| input_buffer& operator>> | ( | input_buffer & | input, | |
| ServerHello & | hello | |||
| ) | [friend] |
Definition at line 1164 of file yassl_imp.cpp.
01165 { 01166 // Protocol 01167 hello.server_version_.major_ = input[AUTO]; 01168 hello.server_version_.minor_ = input[AUTO]; 01169 01170 // Random 01171 input.read(hello.random_, RAN_LEN); 01172 01173 // Session 01174 hello.id_len_ = input[AUTO]; 01175 if (hello.id_len_) 01176 input.read(hello.session_id_, hello.id_len_); 01177 01178 // Suites 01179 hello.cipher_suite_[0] = input[AUTO]; 01180 hello.cipher_suite_[1] = input[AUTO]; 01181 01182 // Compression 01183 hello.compression_method_ = CompressionMethod(input[AUTO]); 01184 01185 return input; 01186 }
opaque yaSSL::ServerHello::cipher_suite_[SUITE_LEN] [private] |
Definition at line 250 of file yassl_imp.hpp.
Referenced by yaSSL::buildServerHello(), yaSSL::operator<<(), yaSSL::operator>>(), and Process().
Definition at line 251 of file yassl_imp.hpp.
Referenced by yaSSL::buildServerHello(), yaSSL::operator<<(), and yaSSL::operator>>().
uint8 yaSSL::ServerHello::id_len_ [private] |
Definition at line 248 of file yassl_imp.hpp.
Referenced by yaSSL::buildServerHello(), yaSSL::operator<<(), yaSSL::operator>>(), and Process().
Random yaSSL::ServerHello::random_ [private] |
Definition at line 247 of file yassl_imp.hpp.
Referenced by yaSSL::buildServerHello(), get_random(), yaSSL::operator<<(), yaSSL::operator>>(), Process(), and ServerHello().
Definition at line 246 of file yassl_imp.hpp.
Referenced by yaSSL::operator<<(), and yaSSL::operator>>().
opaque yaSSL::ServerHello::session_id_[ID_LEN] [private] |
Definition at line 249 of file yassl_imp.hpp.
Referenced by yaSSL::buildServerHello(), yaSSL::operator<<(), yaSSL::operator>>(), Process(), and ServerHello().
1.4.7

