Issue #3. Fix direct wildcard match
authorDavid Blacka <davidb@verisign.com>
Thu, 2 Jul 2020 18:57:17 +0000 (18:57 +0000)
committerDavid Blacka <davidb@verisign.com>
Thu, 2 Jul 2020 18:57:17 +0000 (18:57 +0000)
Notice if our wildcard expansion gives us back the same name we started with.

src/com/verisign/tat/dnssec/ValUtils.java

index 1df585f..4b8d1cf 100644 (file)
@@ -424,7 +424,13 @@ public class ValUtils {
         int label_diff = (rrset.getName().labels() - 1) - rrsig.getLabels();
 
         if (label_diff > 0) {
-            return rrset.getName().wild(label_diff);
+            Name wc = rrset.getName().wild(label_diff);
+            // if the name was the wildcard itself, this isn't actually a
+            // wildcard expansion.
+            if (wc.equals(rrset.getName())) {
+                return null;
+            }
+            return wc;
         }
 
         return null;