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:
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user