mirror of
https://github.com/zeek/zeek.git
synced 2025-10-14 04:28:20 +00:00
The Great Embooleanating
A large number of functions had return values and/or arguments changed to use ``bool`` types instead of ``int``.
This commit is contained in:
parent
3c470ffe13
commit
fd5e15b116
145 changed files with 1288 additions and 1331 deletions
|
@ -44,7 +44,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, 0)),
|
||||
make_intrusive<StringVal>(new BroString(data, len, false)),
|
||||
IntrusivePtr{AdoptRef{}, val_mgr->GetCount(offset)}
|
||||
);
|
||||
|
||||
|
@ -57,7 +57,7 @@ bool DataEvent::DeliverStream(const u_char* data, uint64_t len)
|
|||
|
||||
mgr.Enqueue(stream_event,
|
||||
IntrusivePtr{NewRef{}, GetFile()->GetVal()},
|
||||
make_intrusive<StringVal>(new BroString(data, len, 0))
|
||||
make_intrusive<StringVal>(new BroString(data, len, false))
|
||||
);
|
||||
|
||||
return true;
|
||||
|
|
|
@ -290,7 +290,7 @@ void file_analysis::X509::ParseBasicConstraints(X509_EXTENSION* ex)
|
|||
if ( x509_ext_basic_constraints )
|
||||
{
|
||||
auto pBasicConstraint = make_intrusive<RecordVal>(BifType::Record::X509::BasicConstraints);
|
||||
pBasicConstraint->Assign(0, val_mgr->GetBool(constr->ca ? 1 : 0));
|
||||
pBasicConstraint->Assign(0, val_mgr->GetBool(constr->ca));
|
||||
|
||||
if ( constr->pathlen )
|
||||
pBasicConstraint->Assign(1, val_mgr->GetCount((int32_t) ASN1_INTEGER_get(constr->pathlen)));
|
||||
|
@ -344,7 +344,7 @@ void file_analysis::X509::ParseSAN(X509_EXTENSION* ext)
|
|||
VectorVal* uris = 0;
|
||||
VectorVal* ips = 0;
|
||||
|
||||
unsigned int otherfields = 0;
|
||||
bool otherfields = false;
|
||||
|
||||
for ( int i = 0; i < sk_GENERAL_NAME_num(altname); i++ )
|
||||
{
|
||||
|
@ -415,7 +415,7 @@ void file_analysis::X509::ParseSAN(X509_EXTENSION* ext)
|
|||
{
|
||||
// reporter->Error("Subject alternative name contained unsupported fields. fuid %s", GetFile()->GetID().c_str());
|
||||
// This happens quite often - just mark it
|
||||
otherfields = 1;
|
||||
otherfields = true;
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -623,7 +623,7 @@ function sct_verify%(cert: opaque of x509, logid: string, log_key: string, signa
|
|||
if ( precert && issuer_key_hash->Len() != 32)
|
||||
{
|
||||
reporter->Error("Invalid issuer_key_hash length");
|
||||
return val_mgr->GetBool(0);
|
||||
return val_mgr->GetFalse();
|
||||
}
|
||||
|
||||
std::string data;
|
||||
|
@ -647,7 +647,7 @@ function sct_verify%(cert: opaque of x509, logid: string, log_key: string, signa
|
|||
if ( pos < 0 )
|
||||
{
|
||||
reporter->Error("NID_ct_precert_scts not found");
|
||||
return val_mgr->GetBool(0);
|
||||
return val_mgr->GetFalse();
|
||||
}
|
||||
#else
|
||||
int num_ext = X509_get_ext_count(x);
|
||||
|
@ -751,7 +751,7 @@ sct_verify_err:
|
|||
EVP_PKEY_free(key);
|
||||
|
||||
reporter->Error("%s", errstr.c_str());
|
||||
return val_mgr->GetBool(0);
|
||||
return val_mgr->GetFalse();
|
||||
%}
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue