mirror of
https://github.com/zeek/zeek.git
synced 2025-10-02 14:48:21 +00:00
Add/fix log fields in x509 diff canonifier.
This commit is contained in:
parent
08bb4b2274
commit
8859c73bde
1 changed files with 27 additions and 3 deletions
|
@ -3,19 +3,25 @@
|
|||
# A diff canonifier that removes all X.509 Distinguished Name subject fields
|
||||
# because that output can differ depending on installed OpenSSL version.
|
||||
|
||||
BEGIN { FS="\t"; OFS="\t"; s_col = -1; i_col = -1; cs_col = -1; ci_col = -1 }
|
||||
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_subject" )
|
||||
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_subject" )
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -31,6 +37,12 @@ i_col >= 0 {
|
|||
$i_col = "+";
|
||||
}
|
||||
|
||||
is_col >= 0 {
|
||||
if ( $is_col != "-" )
|
||||
# Mark that it's set, but ignore content.
|
||||
$is_col = "+";
|
||||
}
|
||||
|
||||
cs_col >= 0 {
|
||||
if ( $cs_col != "-" )
|
||||
# Mark that it's set, but ignore content.
|
||||
|
@ -43,6 +55,18 @@ ci_col >= 0 {
|
|||
$ci_col = "+";
|
||||
}
|
||||
|
||||
cert_subj_col >= 0 {
|
||||
if ( $cert_subj_col != "-" )
|
||||
# Mark that it's set, but ignore content.
|
||||
$cert_subj_col = "+";
|
||||
}
|
||||
|
||||
cert_issuer_col >= 0 {
|
||||
if ( $cert_issuer_col != "-" )
|
||||
# Mark that it's set, but ignore content.
|
||||
$cert_issuer_col = "+";
|
||||
}
|
||||
|
||||
{
|
||||
print;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue