mirror of
https://github.com/zeek/zeek.git
synced 2025-10-02 06:38:20 +00:00
Fix a bug in diff-remove-x509-names canonifier
The last field in a log was being ignored, due to an off-by-one error in a "for" loop. Also simplified the script by combining two patterns into one.
This commit is contained in:
parent
6df54a3168
commit
b1d1d90de4
1 changed files with 21 additions and 20 deletions
|
@ -5,27 +5,28 @@
|
|||
|
||||
BEGIN { FS="\t"; OFS="\t"; s_col = -1; i_col = -1; is_col = -1; cs_col = -1; ci_col = -1; cert_subj_col = -1; cert_issuer_col = -1 }
|
||||
|
||||
/^#fields/ {
|
||||
for ( i = 2; i < NF; ++i )
|
||||
{
|
||||
if ( $i == "subject" )
|
||||
s_col = i-1;
|
||||
if ( $i == "issuer" )
|
||||
i_col = i-1;
|
||||
if ( $i == "issuer_subject" )
|
||||
is_col = i-1;
|
||||
if ( $i == "client_subject" )
|
||||
cs_col = i-1;
|
||||
if ( $i == "client_issuer" )
|
||||
ci_col = i-1;
|
||||
if ( $i == "certificate.subject" )
|
||||
cert_subj_col = i-1;
|
||||
if ( $i == "certificate.issuer" )
|
||||
cert_issuer_col = i-1;
|
||||
}
|
||||
}
|
||||
|
||||
/^#/ {
|
||||
if ( $1 == "#fields" )
|
||||
{
|
||||
for ( i = 2; i <= NF; ++i )
|
||||
{
|
||||
if ( $i == "subject" )
|
||||
s_col = i-1;
|
||||
if ( $i == "issuer" )
|
||||
i_col = i-1;
|
||||
if ( $i == "issuer_subject" )
|
||||
is_col = i-1;
|
||||
if ( $i == "client_subject" )
|
||||
cs_col = i-1;
|
||||
if ( $i == "client_issuer" )
|
||||
ci_col = i-1;
|
||||
if ( $i == "certificate.subject" )
|
||||
cert_subj_col = i-1;
|
||||
if ( $i == "certificate.issuer" )
|
||||
cert_issuer_col = i-1;
|
||||
}
|
||||
}
|
||||
|
||||
print;
|
||||
next;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue