Build a server hello message
| 61 | |
| 62 | // Build a server hello message |
| 63 | void 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 |
no test coverage detected