SSL: test updates for record_layer version

Update the tests to also include the recently included record layer
fields.
This commit is contained in:
Johanna Amann 2018-08-28 11:02:20 -07:00
parent 27d47314f7
commit 23eb8096fc
7 changed files with 71 additions and 34 deletions

View file

@ -23,10 +23,12 @@ module SSL;
export {
redef record Info += {
# ClientHello
client_record_version: string &log &optional;
client_random: string &log &optional;
client_cipher_suites: string &log &optional;
# ServerHello
server_record_version: string &log &optional;
server_random: string &log &optional;
# ServerKeyExchange
@ -66,6 +68,7 @@ event ssl_client_hello(c: connection, version: count, record_version: count, pos
{
set_session(c);
c$ssl$client_random = bytestring_to_hexstr(client_random);
c$ssl$client_record_version = SSL::version_strings[record_version];
local ciphers_str = "";
for (i in ciphers)
@ -83,6 +86,7 @@ event ssl_server_hello(c: connection, version: count, record_version: count, pos
{
set_session(c);
c$ssl$server_random = bytestring_to_hexstr(server_random);
c$ssl$server_record_version = SSL::version_strings[record_version];
}
event ssl_dh_server_params(c: connection, p: string, q: string, Ys: string) &priority=5

View file

@ -1,3 +1,14 @@
# @TEST-EXEC: bro -r $TRACES/tls/tls1.2.trace %INPUT
# @TEST-EXEC: btest-diff ssl.log
# @TEST-EXEC: btest-diff x509.log
# @TEST-EXEC: btest-diff .stdout
event ssl_client_hello(c: connection, version: count, record_version: count, possible_ts: time, client_random: string, session_id: string, ciphers: index_vec, comp_methods: index_vec) &priority=5
{
print "client", SSL::version_strings[record_version], SSL::version_strings[version];
}
event ssl_server_hello(c: connection, version: count, record_version: count, possible_ts: time, server_random: string, session_id: string, cipher: count, comp_method: count) &priority=5
{
print "server", SSL::version_strings[record_version], SSL::version_strings[version];
}

View file

@ -29,3 +29,13 @@ event ssl_encrypted_data(c: connection, is_orig: bool, record_version: count, co
{
print "encrypted", c$id, is_orig, SSL::version_strings[record_version], content_type;
}
event ssl_client_hello(c: connection, version: count, record_version: count, possible_ts: time, client_random: string, session_id: string, ciphers: index_vec, comp_methods: index_vec) &priority=5
{
print "client", SSL::version_strings[record_version], SSL::version_strings[version];
}
event ssl_server_hello(c: connection, version: count, record_version: count, possible_ts: time, server_random: string, session_id: string, cipher: count, comp_method: count) &priority=5
{
print "server", SSL::version_strings[record_version], SSL::version_strings[version];
}