Skip to content

Commit

Permalink
added invalid cert entry check and subsequent tuple update to conns s…
Browse files Browse the repository at this point in the history
…witch portion (#435)
  • Loading branch information
ethack authored Mar 20, 2019
1 parent 56b205a commit 917cb36
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions parser/fsimporter.go
Original file line number Diff line number Diff line change
Expand Up @@ -390,6 +390,15 @@ func (fs *FSImporter) parseFiles(indexedFiles []*fpt.IndexedFile, parsingThreads
uconnMap[srcDst].Tuples = append(uconnMap[srcDst].Tuples, tuple)
}

// Check if invalid cert record was written before the uconns
// record, we'll need to update it with the tuples.
if _, ok := certMap[dst]; ok {
// add tuple to invlaid cert list
if stringInSlice(tuple, certMap[dst].Tuples) == false {
certMap[dst].Tuples = append(certMap[dst].Tuples, tuple)
}
}

// Increment the connection count for the src-dst pair
uconnMap[srcDst].ConnectionCount++
hostMap[src].ConnectionCount++
Expand Down

0 comments on commit 917cb36

Please sign in to comment.