summaryrefslogtreecommitdiff
path: root/src/common
diff options
context:
space:
mode:
authorLaurent Bercot <ska-skaware@skarnet.org>2024-04-26 16:02:47 +0000
committerLaurent Bercot <ska@appnovation.com>2024-04-26 16:02:47 +0000
commitf67f36978ca9a9f8b1a6065db7d26763c1cc456c (patch)
treed36e6c0c249c96672d6264f8ddf14b498b6c9e35 /src/common
parente9a0ed1fde6df9cee8ab093bce1624d89eb47ac2 (diff)
downloadshibari-f67f36978ca9a9f8b1a6065db7d26763c1cc456c.tar.xz
Support dns-0x20 BULLSHIT
Signed-off-by: Laurent Bercot <ska@appnovation.com>
Diffstat (limited to 'src/common')
-rw-r--r--src/common/deps-lib/shibari-common2
-rw-r--r--src/common/shibari_util_canon_domain.c20
2 files changed, 22 insertions, 0 deletions
diff --git a/src/common/deps-lib/shibari-common b/src/common/deps-lib/shibari-common
index a5c44a4..eed0d4f 100644
--- a/src/common/deps-lib/shibari-common
+++ b/src/common/deps-lib/shibari-common
@@ -6,5 +6,7 @@ shibari_log_start.o
shibari_util_qtype_num.o
shibari_util_qtype_str.o
shibari_util_rcode_str.o
+shibari_util_canon_domain.o
shibari_util_get_prefixlen.o
+-ls6dns
-lskarnet
diff --git a/src/common/shibari_util_canon_domain.c b/src/common/shibari_util_canon_domain.c
new file mode 100644
index 0000000..ece0c9b
--- /dev/null
+++ b/src/common/shibari_util_canon_domain.c
@@ -0,0 +1,20 @@
+/* ISC license. */
+
+#include <stdint.h>
+#include <ctype.h>
+
+#include <s6-dns/s6dns-domain.h>
+
+#include <shibari/util.h>
+
+void shibari_util_canon_domain (s6dns_domain_t *canon, s6dns_domain_t const *orig)
+{
+ uint8_t i = 0 ;
+ canon->len = orig->len ;
+ while (i < orig->len)
+ {
+ uint8_t len = orig->s[i] ;
+ canon->s[i++] = len ;
+ for (; len-- ; i++) canon->s[i] = tolower(orig->s[i]) ;
+ }
+}