1
0
mirror of https://github.com/nmap/nmap.git synced 2025-12-12 18:59:03 +00:00

Improve fingermatch/fingerdiff in deciding which tests to use when there are multiple instances of the same test line

This commit is contained in:
fyodor
2006-09-12 10:17:37 +00:00
parent 9d936ce099
commit 6dedc52a1d
2 changed files with 23 additions and 6 deletions

View File

@@ -132,7 +132,7 @@ int main(int argc, char *argv[]) {
char observedFPString[8192];
char line[512];
char *p, *endptr;
int i;
int i, rc;
int done=0;
FILE *fp;
@@ -182,9 +182,14 @@ int main(int argc, char *argv[]) {
if (readFP(stdin, observedFPString, sizeof(observedFPString)) == -1)
usage("Failed to read in supposed observed fingerprint from stdin\n");
observedFP = parse_single_fingerprint(observedFPString);
if (!observedFP) fatal("Sorry -- failed to parse the so-called reference fingerprint you entered");
if ((rc = remove_duplicate_tests(observedFP))) {
printf("[WARN] Adjusted fingerprint due to %d duplicated tests (we only look at the first).\n", rc);
}
/* OK, now I've got the fingerprints -- I just need to compare them ... */
accuracy = compare_fingerprints(referenceFP, observedFP, 1);
if (accuracy == 1)