Delete SSL certificates from memory after ssl_established event.

- This is an attempt at fixing the memory issues brought about by
  the introduction of the new SSL analyzer.  My initial testing
  shows a hefty memory saving.
This commit is contained in:
Seth Hall 2011-09-08 01:52:25 -04:00
parent e07e4ca117
commit 4931aa815f

View file

@ -29,6 +29,11 @@ export {
## mozilla-ca-list.bro script it will be set to Mozilla's root CA list.
const root_certs: table[string] of string = {} &redef;
## This determines if the c$ssl record is deleted after the record is
## logged. You probably want this to be deleted since it contains
## the full certificate and all of the chain certificates in it.
const delete_certs_after_logging = T &redef;
global log_ssl: event(rec: Info);
const ports = {
@ -121,5 +126,13 @@ event ssl_established(c: connection) &priority=5
event ssl_established(c: connection) &priority=-5
{
Log::write(SSL::LOG, c$ssl);
if ( delete_certs_after_logging )
{
if ( c$ssl?$cert )
delete c$ssl$cert;
if ( c$ssl?$cert_chain )
delete c$ssl$cert_chain;
}
}