Merge with origin/topic/cmake-port.

Needed to readd the broctl/broccoli/binpac submodules manually, as
git seemed to get confused by the existing directories.
This commit is contained in:
Robin Sommer 2010-11-24 21:02:08 -08:00
parent c1768336c4
commit 610d081c4b
125 changed files with 2304 additions and 7592 deletions

View file

@ -5,11 +5,11 @@
#include "config.h"
#include <sys/types.h>
#if TIME_WITH_SYS_TIME
#ifdef TIME_WITH_SYS_TIME
# include <sys/time.h>
# include <time.h>
#else
# if HAVE_SYS_TIME_H
# ifdef HAVE_SYS_TIME_H
# include <sys/time.h>
# else
# include <time.h>
@ -233,10 +233,7 @@ BroFile::~BroFile()
delete [] name;
delete [] access;
#ifdef USE_OPENSSL
delete [] cipher_buffer;
#endif
#ifdef USE_PERFTOOLS
heap_checker->UnIgnoreObject(this);
@ -257,12 +254,9 @@ void BroFile::Init()
print_hook = true;
raw_output = false;
t = 0;
#ifdef USE_OPENSSL
pub_key = 0;
cipher_ctx = 0;
cipher_buffer = 0;
#endif
#ifdef USE_PERFTOOLS
heap_checker->IgnoreObject(this);
@ -348,9 +342,7 @@ int BroFile::Close()
if ( ! is_open )
return 1;
#ifdef USE_OPENSSL
FinishEncrypt();
#endif
// Do not close stdout/stderr.
if ( f == stdout || f == stderr )
@ -640,19 +632,6 @@ void BroFile::CloseCachedFiles()
}
}
#ifndef USE_OPENSSL
void BroFile::InitEncrypt(const char* keyfile)
{
if ( keyfile )
{
error("file encryption requested, but OpenSSL support not compiled in.");
Close();
}
}
#else
void BroFile::InitEncrypt(const char* keyfile)
{
if ( ! (pub_key || keyfile) )
@ -716,14 +695,12 @@ void BroFile::InitEncrypt(const char* keyfile)
int buf_size = MIN_BUFFER_SIZE + EVP_CIPHER_block_size(cipher_type);
cipher_buffer = new unsigned char[buf_size];
}
#endif
void BroFile::FinishEncrypt()
{
if ( ! is_open )
return;
#ifdef USE_OPENSSL
if ( ! pub_key )
return;
@ -742,7 +719,6 @@ void BroFile::FinishEncrypt()
delete cipher_ctx;
cipher_ctx = 0;
}
#endif
}
@ -757,7 +733,6 @@ int BroFile::Write(const char* data, int len)
if ( ! len )
len = strlen(data);
#ifdef USE_OPENSSL
if ( cipher_ctx )
{
while ( len )
@ -789,7 +764,6 @@ int BroFile::Write(const char* data, int len)
return 1;
}
#endif
len = fwrite(data, 1, len, f);
if ( len <= 0 )