bug fixes: RecordComparator needs to also compare RDATA so the removeDuplicates step actually works reliably -- this was masked by the duplicate suppression in RRset; only allow one command line specified KSK, since commons-cli doesn't seem to handle multi-arg options correctly; do not croak on the lack of command-line keys for now;; Also: new dnsjava lib that contains NSEC3 changes for the -04pre draft

git-svn-id: https://svn.verisignlabs.com/jdnssec/tools/trunk@55 4cbd57fe-54e5-0310-bd9a-f30fe5ea5e6e
This commit is contained in:
David Blacka
2006-02-16 20:23:56 +00:00
parent 42573b6d17
commit e2977c41f8
3 changed files with 54 additions and 15 deletions

View File

@@ -60,6 +60,19 @@ public class RecordComparator implements Comparator
return 1;
}
private int compareRDATA(Record a, Record b)
{
byte[] a_rdata = a.rdataToWireCanonical();
byte[] b_rdata = b.rdataToWireCanonical();
for (int i = 0; i < a_rdata.length && i < b_rdata.length; i++)
{
int n = (a_rdata[i] & 0xFF) - (b_rdata[i] & 0xFF);
if (n != 0) return n;
}
return (a_rdata.length - b_rdata.length);
}
public int compare(Object o1, Object o2) throws ClassCastException
{
Record a = (Record) o1;
@@ -92,6 +105,6 @@ public class RecordComparator implements Comparator
if (sig_type != 0) return sig_type;
return 0;
return compareRDATA(a, b);
}
}