mirror of
https://github.com/zeek/zeek.git
synced 2025-10-03 23:28:20 +00:00
Update deprecated ValManager::GetCount usages
This commit is contained in:
parent
0ddac4abcf
commit
93f4c5871b
89 changed files with 830 additions and 844 deletions
|
@ -226,13 +226,13 @@ bool File::SetExtractionLimit(RecordVal* args, uint64_t bytes)
|
|||
void File::IncrementByteCount(uint64_t size, int field_idx)
|
||||
{
|
||||
uint64_t old = LookupFieldDefaultCount(field_idx);
|
||||
val->Assign(field_idx, val_mgr->GetCount(old + size));
|
||||
val->Assign(field_idx, val_mgr->Count(old + size));
|
||||
}
|
||||
|
||||
void File::SetTotalBytes(uint64_t size)
|
||||
{
|
||||
DBG_LOG(DBG_FILE_ANALYSIS, "[%s] Total bytes %" PRIu64, id.c_str(), size);
|
||||
val->Assign(total_bytes_idx, val_mgr->GetCount(size));
|
||||
val->Assign(total_bytes_idx, val_mgr->Count(size));
|
||||
}
|
||||
|
||||
bool File::IsComplete() const
|
||||
|
@ -455,8 +455,8 @@ void File::DeliverChunk(const u_char* data, uint64_t len, uint64_t offset)
|
|||
{
|
||||
FileEvent(file_reassembly_overflow, {
|
||||
IntrusivePtr{NewRef{}, val},
|
||||
IntrusivePtr{AdoptRef{}, val_mgr->GetCount(current_offset)},
|
||||
IntrusivePtr{AdoptRef{}, val_mgr->GetCount(gap_bytes)}
|
||||
val_mgr->Count(current_offset),
|
||||
val_mgr->Count(gap_bytes)
|
||||
});
|
||||
}
|
||||
}
|
||||
|
@ -600,8 +600,8 @@ void File::Gap(uint64_t offset, uint64_t len)
|
|||
{
|
||||
FileEvent(file_gap, {
|
||||
IntrusivePtr{NewRef{}, val},
|
||||
IntrusivePtr{AdoptRef{}, val_mgr->GetCount(offset)},
|
||||
IntrusivePtr{AdoptRef{}, val_mgr->GetCount(len)}
|
||||
val_mgr->Count(offset),
|
||||
val_mgr->Count(len)
|
||||
});
|
||||
}
|
||||
|
||||
|
|
|
@ -448,9 +448,8 @@ bool Manager::IsDisabled(const analyzer::Tag& tag)
|
|||
if ( ! disabled )
|
||||
disabled = internal_const_val("Files::disable")->AsTableVal();
|
||||
|
||||
Val* index = val_mgr->GetCount(bool(tag));
|
||||
auto yield = disabled->Lookup(index);
|
||||
Unref(index);
|
||||
auto index = val_mgr->Count(bool(tag));
|
||||
auto yield = disabled->Lookup(index.get());
|
||||
|
||||
if ( ! yield )
|
||||
return false;
|
||||
|
|
|
@ -45,7 +45,7 @@ bool DataEvent::DeliverChunk(const u_char* data, uint64_t len, uint64_t offset)
|
|||
mgr.Enqueue(chunk_event,
|
||||
IntrusivePtr{NewRef{}, GetFile()->GetVal()},
|
||||
make_intrusive<StringVal>(new BroString(data, len, false)),
|
||||
IntrusivePtr{AdoptRef{}, val_mgr->GetCount(offset)}
|
||||
val_mgr->Count(offset)
|
||||
);
|
||||
|
||||
return true;
|
||||
|
|
|
@ -94,8 +94,8 @@ bool Extract::DeliverStream(const u_char* data, uint64_t len)
|
|||
f->FileEvent(file_extraction_limit, {
|
||||
IntrusivePtr{NewRef{}, f->GetVal()},
|
||||
IntrusivePtr{NewRef{}, Args()},
|
||||
IntrusivePtr{AdoptRef{}, val_mgr->GetCount(limit)},
|
||||
IntrusivePtr{AdoptRef{}, val_mgr->GetCount(len)}
|
||||
val_mgr->Count(limit),
|
||||
val_mgr->Count(len)
|
||||
});
|
||||
|
||||
// Limit may have been modified by a BIF, re-check it.
|
||||
|
|
|
@ -13,7 +13,7 @@ VectorVal* process_rvas(const RVAS* rva_table)
|
|||
{
|
||||
VectorVal* rvas = new VectorVal(internal_type("index_vec")->AsVectorType());
|
||||
for ( uint16 i=0; i < rva_table->rvas()->size(); ++i )
|
||||
rvas->Assign(i, val_mgr->GetCount((*rva_table->rvas())[i]->size()));
|
||||
rvas->Assign(i, val_mgr->Count((*rva_table->rvas())[i]->size()));
|
||||
|
||||
return rvas;
|
||||
}
|
||||
|
@ -30,9 +30,8 @@ refine flow File += {
|
|||
{
|
||||
if ( ((c >> i) & 0x1) == 1 )
|
||||
{
|
||||
Val *ch = val_mgr->GetCount((1<<i)&mask);
|
||||
char_set->Assign(ch, 0);
|
||||
Unref(ch);
|
||||
auto ch = val_mgr->Count((1<<i)&mask);
|
||||
char_set->Assign(ch.get(), 0);
|
||||
}
|
||||
}
|
||||
return char_set;
|
||||
|
@ -44,22 +43,22 @@ refine flow File += {
|
|||
{
|
||||
auto dh = make_intrusive<RecordVal>(BifType::Record::PE::DOSHeader);
|
||||
dh->Assign(0, make_intrusive<StringVal>(${h.signature}.length(), (const char*) ${h.signature}.data()));
|
||||
dh->Assign(1, val_mgr->GetCount(${h.UsedBytesInTheLastPage}));
|
||||
dh->Assign(2, val_mgr->GetCount(${h.FileSizeInPages}));
|
||||
dh->Assign(3, val_mgr->GetCount(${h.NumberOfRelocationItems}));
|
||||
dh->Assign(4, val_mgr->GetCount(${h.HeaderSizeInParagraphs}));
|
||||
dh->Assign(5, val_mgr->GetCount(${h.MinimumExtraParagraphs}));
|
||||
dh->Assign(6, val_mgr->GetCount(${h.MaximumExtraParagraphs}));
|
||||
dh->Assign(7, val_mgr->GetCount(${h.InitialRelativeSS}));
|
||||
dh->Assign(8, val_mgr->GetCount(${h.InitialSP}));
|
||||
dh->Assign(9, val_mgr->GetCount(${h.Checksum}));
|
||||
dh->Assign(10, val_mgr->GetCount(${h.InitialIP}));
|
||||
dh->Assign(11, val_mgr->GetCount(${h.InitialRelativeCS}));
|
||||
dh->Assign(12, val_mgr->GetCount(${h.AddressOfRelocationTable}));
|
||||
dh->Assign(13, val_mgr->GetCount(${h.OverlayNumber}));
|
||||
dh->Assign(14, val_mgr->GetCount(${h.OEMid}));
|
||||
dh->Assign(15, val_mgr->GetCount(${h.OEMinfo}));
|
||||
dh->Assign(16, val_mgr->GetCount(${h.AddressOfNewExeHeader}));
|
||||
dh->Assign(1, val_mgr->Count(${h.UsedBytesInTheLastPage}));
|
||||
dh->Assign(2, val_mgr->Count(${h.FileSizeInPages}));
|
||||
dh->Assign(3, val_mgr->Count(${h.NumberOfRelocationItems}));
|
||||
dh->Assign(4, val_mgr->Count(${h.HeaderSizeInParagraphs}));
|
||||
dh->Assign(5, val_mgr->Count(${h.MinimumExtraParagraphs}));
|
||||
dh->Assign(6, val_mgr->Count(${h.MaximumExtraParagraphs}));
|
||||
dh->Assign(7, val_mgr->Count(${h.InitialRelativeSS}));
|
||||
dh->Assign(8, val_mgr->Count(${h.InitialSP}));
|
||||
dh->Assign(9, val_mgr->Count(${h.Checksum}));
|
||||
dh->Assign(10, val_mgr->Count(${h.InitialIP}));
|
||||
dh->Assign(11, val_mgr->Count(${h.InitialRelativeCS}));
|
||||
dh->Assign(12, val_mgr->Count(${h.AddressOfRelocationTable}));
|
||||
dh->Assign(13, val_mgr->Count(${h.OverlayNumber}));
|
||||
dh->Assign(14, val_mgr->Count(${h.OEMid}));
|
||||
dh->Assign(15, val_mgr->Count(${h.OEMinfo}));
|
||||
dh->Assign(16, val_mgr->Count(${h.AddressOfNewExeHeader}));
|
||||
|
||||
mgr.Enqueue(pe_dos_header,
|
||||
IntrusivePtr{NewRef{}, connection()->bro_analyzer()->GetFile()->GetVal()},
|
||||
|
@ -93,11 +92,11 @@ refine flow File += {
|
|||
if ( pe_file_header )
|
||||
{
|
||||
auto fh = make_intrusive<RecordVal>(BifType::Record::PE::FileHeader);
|
||||
fh->Assign(0, val_mgr->GetCount(${h.Machine}));
|
||||
fh->Assign(0, val_mgr->Count(${h.Machine}));
|
||||
fh->Assign(1, make_intrusive<Val>(static_cast<double>(${h.TimeDateStamp}), TYPE_TIME));
|
||||
fh->Assign(2, val_mgr->GetCount(${h.PointerToSymbolTable}));
|
||||
fh->Assign(3, val_mgr->GetCount(${h.NumberOfSymbols}));
|
||||
fh->Assign(4, val_mgr->GetCount(${h.SizeOfOptionalHeader}));
|
||||
fh->Assign(2, val_mgr->Count(${h.PointerToSymbolTable}));
|
||||
fh->Assign(3, val_mgr->Count(${h.NumberOfSymbols}));
|
||||
fh->Assign(4, val_mgr->Count(${h.SizeOfOptionalHeader}));
|
||||
fh->Assign(5, characteristics_to_bro(${h.Characteristics}, 16));
|
||||
|
||||
mgr.Enqueue(pe_file_header,
|
||||
|
@ -122,31 +121,31 @@ refine flow File += {
|
|||
{
|
||||
auto oh = make_intrusive<RecordVal>(BifType::Record::PE::OptionalHeader);
|
||||
|
||||
oh->Assign(0, val_mgr->GetCount(${h.magic}));
|
||||
oh->Assign(1, val_mgr->GetCount(${h.major_linker_version}));
|
||||
oh->Assign(2, val_mgr->GetCount(${h.minor_linker_version}));
|
||||
oh->Assign(3, val_mgr->GetCount(${h.size_of_code}));
|
||||
oh->Assign(4, val_mgr->GetCount(${h.size_of_init_data}));
|
||||
oh->Assign(5, val_mgr->GetCount(${h.size_of_uninit_data}));
|
||||
oh->Assign(6, val_mgr->GetCount(${h.addr_of_entry_point}));
|
||||
oh->Assign(7, val_mgr->GetCount(${h.base_of_code}));
|
||||
oh->Assign(0, val_mgr->Count(${h.magic}));
|
||||
oh->Assign(1, val_mgr->Count(${h.major_linker_version}));
|
||||
oh->Assign(2, val_mgr->Count(${h.minor_linker_version}));
|
||||
oh->Assign(3, val_mgr->Count(${h.size_of_code}));
|
||||
oh->Assign(4, val_mgr->Count(${h.size_of_init_data}));
|
||||
oh->Assign(5, val_mgr->Count(${h.size_of_uninit_data}));
|
||||
oh->Assign(6, val_mgr->Count(${h.addr_of_entry_point}));
|
||||
oh->Assign(7, val_mgr->Count(${h.base_of_code}));
|
||||
|
||||
if ( ${h.pe_format} != PE32_PLUS )
|
||||
oh->Assign(8, val_mgr->GetCount(${h.base_of_data}));
|
||||
oh->Assign(8, val_mgr->Count(${h.base_of_data}));
|
||||
|
||||
oh->Assign(9, val_mgr->GetCount(${h.image_base}));
|
||||
oh->Assign(10, val_mgr->GetCount(${h.section_alignment}));
|
||||
oh->Assign(11, val_mgr->GetCount(${h.file_alignment}));
|
||||
oh->Assign(12, val_mgr->GetCount(${h.os_version_major}));
|
||||
oh->Assign(13, val_mgr->GetCount(${h.os_version_minor}));
|
||||
oh->Assign(14, val_mgr->GetCount(${h.major_image_version}));
|
||||
oh->Assign(15, val_mgr->GetCount(${h.minor_image_version}));
|
||||
oh->Assign(16, val_mgr->GetCount(${h.minor_subsys_version}));
|
||||
oh->Assign(17, val_mgr->GetCount(${h.minor_subsys_version}));
|
||||
oh->Assign(18, val_mgr->GetCount(${h.size_of_image}));
|
||||
oh->Assign(19, val_mgr->GetCount(${h.size_of_headers}));
|
||||
oh->Assign(20, val_mgr->GetCount(${h.checksum}));
|
||||
oh->Assign(21, val_mgr->GetCount(${h.subsystem}));
|
||||
oh->Assign(9, val_mgr->Count(${h.image_base}));
|
||||
oh->Assign(10, val_mgr->Count(${h.section_alignment}));
|
||||
oh->Assign(11, val_mgr->Count(${h.file_alignment}));
|
||||
oh->Assign(12, val_mgr->Count(${h.os_version_major}));
|
||||
oh->Assign(13, val_mgr->Count(${h.os_version_minor}));
|
||||
oh->Assign(14, val_mgr->Count(${h.major_image_version}));
|
||||
oh->Assign(15, val_mgr->Count(${h.minor_image_version}));
|
||||
oh->Assign(16, val_mgr->Count(${h.minor_subsys_version}));
|
||||
oh->Assign(17, val_mgr->Count(${h.minor_subsys_version}));
|
||||
oh->Assign(18, val_mgr->Count(${h.size_of_image}));
|
||||
oh->Assign(19, val_mgr->Count(${h.size_of_headers}));
|
||||
oh->Assign(20, val_mgr->Count(${h.checksum}));
|
||||
oh->Assign(21, val_mgr->Count(${h.subsystem}));
|
||||
oh->Assign(22, characteristics_to_bro(${h.dll_characteristics}, 16));
|
||||
|
||||
oh->Assign(23, process_rvas(${h.rvas}));
|
||||
|
@ -173,14 +172,14 @@ refine flow File += {
|
|||
name_len = first_null - ${h.name}.data();
|
||||
section_header->Assign(0, make_intrusive<StringVal>(name_len, (const char*) ${h.name}.data()));
|
||||
|
||||
section_header->Assign(1, val_mgr->GetCount(${h.virtual_size}));
|
||||
section_header->Assign(2, val_mgr->GetCount(${h.virtual_addr}));
|
||||
section_header->Assign(3, val_mgr->GetCount(${h.size_of_raw_data}));
|
||||
section_header->Assign(4, val_mgr->GetCount(${h.ptr_to_raw_data}));
|
||||
section_header->Assign(5, val_mgr->GetCount(${h.non_used_ptr_to_relocs}));
|
||||
section_header->Assign(6, val_mgr->GetCount(${h.non_used_ptr_to_line_nums}));
|
||||
section_header->Assign(7, val_mgr->GetCount(${h.non_used_num_of_relocs}));
|
||||
section_header->Assign(8, val_mgr->GetCount(${h.non_used_num_of_line_nums}));
|
||||
section_header->Assign(1, val_mgr->Count(${h.virtual_size}));
|
||||
section_header->Assign(2, val_mgr->Count(${h.virtual_addr}));
|
||||
section_header->Assign(3, val_mgr->Count(${h.size_of_raw_data}));
|
||||
section_header->Assign(4, val_mgr->Count(${h.ptr_to_raw_data}));
|
||||
section_header->Assign(5, val_mgr->Count(${h.non_used_ptr_to_relocs}));
|
||||
section_header->Assign(6, val_mgr->Count(${h.non_used_ptr_to_line_nums}));
|
||||
section_header->Assign(7, val_mgr->Count(${h.non_used_num_of_relocs}));
|
||||
section_header->Assign(8, val_mgr->Count(${h.non_used_num_of_line_nums}));
|
||||
section_header->Assign(9, characteristics_to_bro(${h.characteristics}, 32));
|
||||
|
||||
mgr.Enqueue(pe_section_header,
|
||||
|
|
|
@ -67,19 +67,19 @@ refine flow Flow += {
|
|||
if ( ::unified2_event )
|
||||
{
|
||||
auto ids_event = make_intrusive<RecordVal>(BifType::Record::Unified2::IDSEvent);
|
||||
ids_event->Assign(0, val_mgr->GetCount(${ev.sensor_id}));
|
||||
ids_event->Assign(1, val_mgr->GetCount(${ev.event_id}));
|
||||
ids_event->Assign(0, val_mgr->Count(${ev.sensor_id}));
|
||||
ids_event->Assign(1, val_mgr->Count(${ev.event_id}));
|
||||
ids_event->Assign(2, make_intrusive<Val>(ts_to_double(${ev.ts}), TYPE_TIME));
|
||||
ids_event->Assign(3, val_mgr->GetCount(${ev.signature_id}));
|
||||
ids_event->Assign(4, val_mgr->GetCount(${ev.generator_id}));
|
||||
ids_event->Assign(5, val_mgr->GetCount(${ev.signature_revision}));
|
||||
ids_event->Assign(6, val_mgr->GetCount(${ev.classification_id}));
|
||||
ids_event->Assign(7, val_mgr->GetCount(${ev.priority_id}));
|
||||
ids_event->Assign(3, val_mgr->Count(${ev.signature_id}));
|
||||
ids_event->Assign(4, val_mgr->Count(${ev.generator_id}));
|
||||
ids_event->Assign(5, val_mgr->Count(${ev.signature_revision}));
|
||||
ids_event->Assign(6, val_mgr->Count(${ev.classification_id}));
|
||||
ids_event->Assign(7, val_mgr->Count(${ev.priority_id}));
|
||||
ids_event->Assign(8, unified2_addr_to_bro_addr(${ev.src_ip}));
|
||||
ids_event->Assign(9, unified2_addr_to_bro_addr(${ev.dst_ip}));
|
||||
ids_event->Assign(10, to_port(${ev.src_p}, ${ev.protocol}));
|
||||
ids_event->Assign(11, to_port(${ev.dst_p}, ${ev.protocol}));
|
||||
ids_event->Assign(17, val_mgr->GetCount(${ev.packet_action}));
|
||||
ids_event->Assign(17, val_mgr->Count(${ev.packet_action}));
|
||||
|
||||
mgr.Enqueue(::unified2_event,
|
||||
IntrusivePtr{NewRef{}, connection()->bro_analyzer()->GetFile()->GetVal()},
|
||||
|
@ -93,23 +93,23 @@ refine flow Flow += {
|
|||
if ( ::unified2_event )
|
||||
{
|
||||
auto ids_event = make_intrusive<RecordVal>(BifType::Record::Unified2::IDSEvent);
|
||||
ids_event->Assign(0, val_mgr->GetCount(${ev.sensor_id}));
|
||||
ids_event->Assign(1, val_mgr->GetCount(${ev.event_id}));
|
||||
ids_event->Assign(0, val_mgr->Count(${ev.sensor_id}));
|
||||
ids_event->Assign(1, val_mgr->Count(${ev.event_id}));
|
||||
ids_event->Assign(2, make_intrusive<Val>(ts_to_double(${ev.ts}), TYPE_TIME));
|
||||
ids_event->Assign(3, val_mgr->GetCount(${ev.signature_id}));
|
||||
ids_event->Assign(4, val_mgr->GetCount(${ev.generator_id}));
|
||||
ids_event->Assign(5, val_mgr->GetCount(${ev.signature_revision}));
|
||||
ids_event->Assign(6, val_mgr->GetCount(${ev.classification_id}));
|
||||
ids_event->Assign(7, val_mgr->GetCount(${ev.priority_id}));
|
||||
ids_event->Assign(3, val_mgr->Count(${ev.signature_id}));
|
||||
ids_event->Assign(4, val_mgr->Count(${ev.generator_id}));
|
||||
ids_event->Assign(5, val_mgr->Count(${ev.signature_revision}));
|
||||
ids_event->Assign(6, val_mgr->Count(${ev.classification_id}));
|
||||
ids_event->Assign(7, val_mgr->Count(${ev.priority_id}));
|
||||
ids_event->Assign(8, unified2_addr_to_bro_addr(${ev.src_ip}));
|
||||
ids_event->Assign(9, unified2_addr_to_bro_addr(${ev.dst_ip}));
|
||||
ids_event->Assign(10, to_port(${ev.src_p}, ${ev.protocol}));
|
||||
ids_event->Assign(11, to_port(${ev.dst_p}, ${ev.protocol}));
|
||||
ids_event->Assign(12, val_mgr->GetCount(${ev.impact_flag}));
|
||||
ids_event->Assign(13, val_mgr->GetCount(${ev.impact}));
|
||||
ids_event->Assign(14, val_mgr->GetCount(${ev.blocked}));
|
||||
ids_event->Assign(15, val_mgr->GetCount(${ev.mpls_label}));
|
||||
ids_event->Assign(16, val_mgr->GetCount(${ev.vlan_id}));
|
||||
ids_event->Assign(12, val_mgr->Count(${ev.impact_flag}));
|
||||
ids_event->Assign(13, val_mgr->Count(${ev.impact}));
|
||||
ids_event->Assign(14, val_mgr->Count(${ev.blocked}));
|
||||
ids_event->Assign(15, val_mgr->Count(${ev.mpls_label}));
|
||||
ids_event->Assign(16, val_mgr->Count(${ev.vlan_id}));
|
||||
|
||||
mgr.Enqueue(::unified2_event,
|
||||
IntrusivePtr{NewRef{}, connection()->bro_analyzer()->GetFile()->GetVal()},
|
||||
|
@ -124,11 +124,11 @@ refine flow Flow += {
|
|||
if ( ::unified2_packet )
|
||||
{
|
||||
auto packet = make_intrusive<RecordVal>(BifType::Record::Unified2::Packet);
|
||||
packet->Assign(0, val_mgr->GetCount(${pkt.sensor_id}));
|
||||
packet->Assign(1, val_mgr->GetCount(${pkt.event_id}));
|
||||
packet->Assign(2, val_mgr->GetCount(${pkt.event_second}));
|
||||
packet->Assign(0, val_mgr->Count(${pkt.sensor_id}));
|
||||
packet->Assign(1, val_mgr->Count(${pkt.event_id}));
|
||||
packet->Assign(2, val_mgr->Count(${pkt.event_second}));
|
||||
packet->Assign(3, make_intrusive<Val>(ts_to_double(${pkt.packet_ts}), TYPE_TIME));
|
||||
packet->Assign(4, val_mgr->GetCount(${pkt.link_type}));
|
||||
packet->Assign(4, val_mgr->Count(${pkt.link_type}));
|
||||
packet->Assign(5, bytestring_to_val(${pkt.packet_data}));
|
||||
|
||||
mgr.Enqueue(::unified2_packet,
|
||||
|
|
|
@ -288,7 +288,7 @@ static StringVal* parse_basic_resp_sig_alg(OCSP_BASICRESP* basic_resp,
|
|||
return rval;
|
||||
}
|
||||
|
||||
static Val* parse_basic_resp_data_version(OCSP_BASICRESP* basic_resp)
|
||||
static IntrusivePtr<Val> parse_basic_resp_data_version(OCSP_BASICRESP* basic_resp)
|
||||
{
|
||||
int der_basic_resp_len = 0;
|
||||
unsigned char* der_basic_resp_dat = nullptr;
|
||||
|
@ -296,7 +296,7 @@ static Val* parse_basic_resp_data_version(OCSP_BASICRESP* basic_resp)
|
|||
der_basic_resp_len = i2d_OCSP_BASICRESP(basic_resp, &der_basic_resp_dat);
|
||||
|
||||
if ( der_basic_resp_len <= 0 )
|
||||
return val_mgr->GetCount(-1);
|
||||
return val_mgr->Count(-1);
|
||||
|
||||
const unsigned char* const_der_basic_resp_dat = der_basic_resp_dat;
|
||||
|
||||
|
@ -305,13 +305,13 @@ static Val* parse_basic_resp_data_version(OCSP_BASICRESP* basic_resp)
|
|||
if ( ! bseq )
|
||||
{
|
||||
OPENSSL_free(der_basic_resp_dat);
|
||||
return val_mgr->GetCount(-1);
|
||||
return val_mgr->Count(-1);
|
||||
}
|
||||
|
||||
if ( sk_ASN1_TYPE_num(bseq) < 3 )
|
||||
{
|
||||
OPENSSL_free(der_basic_resp_dat);
|
||||
return val_mgr->GetCount(-1);
|
||||
return val_mgr->Count(-1);
|
||||
}
|
||||
|
||||
auto constexpr resp_data_idx = 0u;
|
||||
|
@ -320,7 +320,7 @@ static Val* parse_basic_resp_data_version(OCSP_BASICRESP* basic_resp)
|
|||
if ( ASN1_TYPE_get(dseq_type) != V_ASN1_SEQUENCE )
|
||||
{
|
||||
OPENSSL_free(der_basic_resp_dat);
|
||||
return val_mgr->GetCount(-1);
|
||||
return val_mgr->Count(-1);
|
||||
}
|
||||
|
||||
auto dseq_str = dseq_type->value.asn1_string;
|
||||
|
@ -332,13 +332,13 @@ static Val* parse_basic_resp_data_version(OCSP_BASICRESP* basic_resp)
|
|||
if ( ! dseq )
|
||||
{
|
||||
OPENSSL_free(der_basic_resp_dat);
|
||||
return val_mgr->GetEmptyString();
|
||||
return val_mgr->Count(-1);
|
||||
}
|
||||
|
||||
if ( sk_ASN1_TYPE_num(dseq) < 1 )
|
||||
{
|
||||
OPENSSL_free(der_basic_resp_dat);
|
||||
return val_mgr->GetEmptyString();
|
||||
return val_mgr->Count(-1);
|
||||
}
|
||||
|
||||
/*- ResponseData ::= SEQUENCE {
|
||||
|
@ -356,12 +356,12 @@ static Val* parse_basic_resp_data_version(OCSP_BASICRESP* basic_resp)
|
|||
{
|
||||
OPENSSL_free(der_basic_resp_dat);
|
||||
// Not present, use default value.
|
||||
return val_mgr->GetCount(0);
|
||||
return val_mgr->Count(0);
|
||||
}
|
||||
|
||||
uint64_t asn1_int = ASN1_INTEGER_get(version_type->value.integer);
|
||||
OPENSSL_free(der_basic_resp_dat);
|
||||
return val_mgr->GetCount(asn1_int);
|
||||
return val_mgr->Count(asn1_int);
|
||||
}
|
||||
|
||||
static uint64_t parse_request_version(OCSP_REQUEST* req)
|
||||
|
@ -422,7 +422,7 @@ void file_analysis::OCSP::ParseRequest(OCSP_REQUEST* req)
|
|||
if ( ocsp_request )
|
||||
mgr.Enqueue(ocsp_request,
|
||||
IntrusivePtr{NewRef{}, GetFile()->GetVal()},
|
||||
IntrusivePtr{AdoptRef{}, val_mgr->GetCount(version)}
|
||||
val_mgr->Count(version)
|
||||
);
|
||||
|
||||
BIO *bio = BIO_new(BIO_s_mem());
|
||||
|
@ -506,9 +506,9 @@ void file_analysis::OCSP::ParseResponse(OCSP_RESPONSE *resp)
|
|||
vl.emplace_back(AdoptRef{}, status_val);
|
||||
|
||||
#if ( OPENSSL_VERSION_NUMBER < 0x10100000L ) || defined(LIBRESSL_VERSION_NUMBER)
|
||||
vl.emplace_back(AdoptRef{}, val_mgr->GetCount((uint64_t)ASN1_INTEGER_get(resp_data->version)));
|
||||
vl.emplace_back(val_mgr->Count((uint64_t)ASN1_INTEGER_get(resp_data->version)));
|
||||
#else
|
||||
vl.emplace_back(AdoptRef{}, parse_basic_resp_data_version(basic_resp));
|
||||
vl.emplace_back(parse_basic_resp_data_version(basic_resp));
|
||||
#endif
|
||||
|
||||
// responderID
|
||||
|
|
|
@ -121,7 +121,7 @@ RecordVal* file_analysis::X509::ParseCertificate(X509Val* cert_val, File* f)
|
|||
RecordVal* pX509Cert = new RecordVal(BifType::Record::X509::Certificate);
|
||||
BIO *bio = BIO_new(BIO_s_mem());
|
||||
|
||||
pX509Cert->Assign(0, val_mgr->GetCount((uint64_t) X509_get_version(ssl_cert) + 1));
|
||||
pX509Cert->Assign(0, val_mgr->Count((uint64_t) X509_get_version(ssl_cert) + 1));
|
||||
i2a_ASN1_INTEGER(bio, X509_get_serialNumber(ssl_cert));
|
||||
int len = BIO_read(bio, buf, sizeof(buf));
|
||||
pX509Cert->Assign(1, make_intrusive<StringVal>(len, buf));
|
||||
|
@ -229,7 +229,7 @@ RecordVal* file_analysis::X509::ParseCertificate(X509Val* cert_val, File* f)
|
|||
|
||||
unsigned int length = KeyLength(pkey);
|
||||
if ( length > 0 )
|
||||
pX509Cert->Assign(10, val_mgr->GetCount(length));
|
||||
pX509Cert->Assign(10, val_mgr->Count(length));
|
||||
|
||||
EVP_PKEY_free(pkey);
|
||||
}
|
||||
|
@ -293,7 +293,7 @@ void file_analysis::X509::ParseBasicConstraints(X509_EXTENSION* ex)
|
|||
pBasicConstraint->Assign(0, val_mgr->Bool(constr->ca));
|
||||
|
||||
if ( constr->pathlen )
|
||||
pBasicConstraint->Assign(1, val_mgr->GetCount((int32_t) ASN1_INTEGER_get(constr->pathlen)));
|
||||
pBasicConstraint->Assign(1, val_mgr->Count((int32_t) ASN1_INTEGER_get(constr->pathlen)));
|
||||
|
||||
mgr.Enqueue(x509_ext_basic_constraints,
|
||||
IntrusivePtr{NewRef{}, GetFile()->GetVal()},
|
||||
|
|
|
@ -40,11 +40,11 @@ refine connection MockConnection += {
|
|||
|
||||
mgr.Enqueue(x509_ocsp_ext_signed_certificate_timestamp,
|
||||
IntrusivePtr{NewRef{}, bro_analyzer()->GetFile()->GetVal()},
|
||||
IntrusivePtr{AdoptRef{}, val_mgr->GetCount(version)},
|
||||
val_mgr->Count(version),
|
||||
make_intrusive<StringVal>(logid.length(), reinterpret_cast<const char*>(logid.begin())),
|
||||
IntrusivePtr{AdoptRef{}, val_mgr->GetCount(timestamp)},
|
||||
IntrusivePtr{AdoptRef{}, val_mgr->GetCount(digitally_signed_algorithms->HashAlgorithm())},
|
||||
IntrusivePtr{AdoptRef{}, val_mgr->GetCount(digitally_signed_algorithms->SignatureAlgorithm())},
|
||||
val_mgr->Count(timestamp),
|
||||
val_mgr->Count(digitally_signed_algorithms->HashAlgorithm()),
|
||||
val_mgr->Count(digitally_signed_algorithms->SignatureAlgorithm()),
|
||||
make_intrusive<StringVal>(digitally_signed_signature.length(), reinterpret_cast<const char*>(digitally_signed_signature.begin()))
|
||||
);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue