zeek/scripts/policy
SG 42bf41aca1 check for the existance of f?$conns in file_sniff event in policy/protocols/ssl/log-hostcerts-only.zeek
In using the corelight/bro-xor-exe-plugin (https://github.com/corelight/bro-xor-exe-plugin) I noticed this error when running the PCAP trace file in its tests directory:

1428602842.525435 expression error in /opt/zeek/share/zeek/policy/protocols/ssl/log-hostcerts-only.zeek, line 44: field value missing (X509::f$conns)

Examining log-hostcerts-only.zeek, I saw that although f$conns is being checked for length, it's not being checked to see if it exists first.

This commit changes "if ( |f$conns| != 1 )" to "if (( ! f?$conns ) || ( |f$conns| != 1 ))" so that the script returns if there is no f$conns field.

In my local testing, this seems to fix the error. My testing was being done with v3.0.5, but I think this patch can be applied to both the 3.0.x and 3.1.x branches.
2020-04-16 10:19:59 -06:00
..
files Use consistent zeek_init priority for Log::create_stream calls 2020-01-22 13:58:20 -08:00
frameworks Add warning for ineffective &default arguments in handlers 2020-04-09 22:51:01 -07:00
integration Merge branch 'master' of https://github.com/sfinlon/zeek 2019-07-03 01:58:04 -07:00
misc Remove deprecated open_log_file and log_file_name functions 2019-06-27 17:43:20 -07:00
protocols check for the existance of f?$conns in file_sniff event in policy/protocols/ssl/log-hostcerts-only.zeek 2020-04-16 10:19:59 -06:00
tuning Merge remote-tracking branch 'origin/topic/seth/zeek_init' 2019-04-19 11:24:29 -07:00