Skip to content
Snippets Groups Projects
Commit dd722b24 authored by Martin Nilsson's avatar Martin Nilsson
Browse files

Simplified certificate_packet code.

parent 49a2122d
No related branches found
No related tags found
No related merge requests found
...@@ -147,15 +147,7 @@ string(8bit) hash_messages(string(8bit) sender) ...@@ -147,15 +147,7 @@ string(8bit) hash_messages(string(8bit) sender)
Packet certificate_packet(array(string(8bit)) certificates) Packet certificate_packet(array(string(8bit)) certificates)
{ {
ADT.struct struct = ADT.struct(); ADT.struct struct = ADT.struct();
int len = 0; struct->put_var_string_array(certificates, 3, 3);
if(certificates && sizeof(certificates))
len = `+( @ Array.map(certificates, sizeof));
// SSL3_DEBUG_MSG("SSL.Connection: certificate_message size %d\n", len);
struct->put_uint(len + 3 * sizeof(certificates), 3);
foreach(certificates, string(8bit) cert)
struct->put_var_string(cert, 3);
return handshake_packet(HANDSHAKE_certificate, struct->pop_data()); return handshake_packet(HANDSHAKE_certificate, struct->pop_data());
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment