Make OCSP analyzer part of the X.509 analyzer

This allows the easier integration of shared functionality. And it also
makes logical sense, given that OCSP is not interesting without X.509.
This commit is contained in:
Johanna Amann 2017-02-08 10:57:30 -08:00
parent dfc871f831
commit c670613996
16 changed files with 13 additions and 47 deletions

View file

@ -1 +0,0 @@
Support for ocsp file analysis framework.

View file

@ -1 +0,0 @@
@load ./main

View file

@ -1 +1,2 @@
Support for X509 certificates with the file analysis framework. Support for X509 certificates with the file analysis framework.
Also supposrts OCSP requests and responses.

View file

@ -2,6 +2,8 @@
@load base/utils/paths @load base/utils/paths
@load base/utils/queue @load base/utils/queue
# Note - this needs some cleaning up and is currently not loaded by default.
module OCSP; module OCSP;
export { export {

View file

@ -77,7 +77,6 @@
@load base/files/extract @load base/files/extract
@load base/files/unified2 @load base/files/unified2
@load base/files/x509 @load base/files/x509
@load base/files/ocsp
@load base/misc/find-checksum-offloading @load base/misc/find-checksum-offloading
@load base/misc/find-filtered-trace @load base/misc/find-filtered-trace

View file

@ -1,4 +1,4 @@
##! Perform OCSP response validation. ##! Perform validation of stapled OCSP responses.
@load base/frameworks/notice @load base/frameworks/notice
@load base/protocols/ssl @load base/protocols/ssl

View file

@ -5,4 +5,3 @@ add_subdirectory(hash)
add_subdirectory(pe) add_subdirectory(pe)
add_subdirectory(unified2) add_subdirectory(unified2)
add_subdirectory(x509) add_subdirectory(x509)
add_subdirectory(ocsp)

View file

@ -1,10 +0,0 @@
include(BroPlugin)
include_directories(BEFORE ${CMAKE_CURRENT_SOURCE_DIR}
${CMAKE_CURRENT_BINARY_DIR})
bro_plugin_begin(Bro OCSP)
bro_plugin_cc(OCSP.cc Plugin.cc)
bro_plugin_bif(events.bif types.bif functions.bif)
bro_plugin_end()

View file

@ -1,25 +0,0 @@
// See the file in the main distribution directory for copyright.
#include "plugin/Plugin.h"
#include "OCSP.h"
namespace plugin {
namespace Bro_OCSP {
class Plugin : public plugin::Plugin {
public:
plugin::Configuration Configure()
{
AddComponent(new ::file_analysis::Component("OCSP", ::file_analysis::OCSP::Instantiate));
plugin::Configuration config;
config.name = "Bro::OCSP";
config.description = "OCSP analyzer";
return config;
}
} plugin;
}
}

View file

@ -5,6 +5,6 @@ include_directories(BEFORE ${CMAKE_CURRENT_SOURCE_DIR}
${CMAKE_CURRENT_BINARY_DIR}) ${CMAKE_CURRENT_BINARY_DIR})
bro_plugin_begin(Bro X509) bro_plugin_begin(Bro X509)
bro_plugin_cc(X509.cc Plugin.cc) bro_plugin_cc(X509.cc OCSP.cc Plugin.cc)
bro_plugin_bif(events.bif types.bif functions.bif) bro_plugin_bif(events.bif types.bif functions.bif ocsp_events.bif ocsp_types.bif ocsp_functions.bif)
bro_plugin_end() bro_plugin_end()

View file

@ -5,8 +5,8 @@
#include "OCSP.h" #include "OCSP.h"
#include "Event.h" #include "Event.h"
#include "events.bif.h" #include "ocsp_events.bif.h"
#include "types.bif.h" #include "ocsp_types.bif.h"
#include "file_analysis/Manager.h" #include "file_analysis/Manager.h"

View file

@ -4,6 +4,7 @@
#include "plugin/Plugin.h" #include "plugin/Plugin.h"
#include "X509.h" #include "X509.h"
#include "OCSP.h"
namespace plugin { namespace plugin {
namespace Bro_X509 { namespace Bro_X509 {
@ -13,10 +14,11 @@ public:
plugin::Configuration Configure() plugin::Configuration Configure()
{ {
AddComponent(new ::file_analysis::Component("X509", ::file_analysis::X509::Instantiate)); AddComponent(new ::file_analysis::Component("X509", ::file_analysis::X509::Instantiate));
AddComponent(new ::file_analysis::Component("OCSP", ::file_analysis::OCSP::Instantiate));
plugin::Configuration config; plugin::Configuration config;
config.name = "Bro::X509"; config.name = "Bro::X509";
config.description = "X509 analyzer"; config.description = "X509 and OCSP analyzer";
return config; return config;
} }
} plugin; } plugin;

View file

@ -1,6 +1,6 @@
%%{ %%{
#include "file_analysis/analyzer/ocsp/OCSP.h" #include "file_analysis/analyzer/x509/OCSP.h"
#include "types.bif.h" #include "ocsp_types.bif.h"
%%} %%}
## Parses a OCSP response into an OCSP::Response structure. ## Parses a OCSP response into an OCSP::Response structure.