summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorJeremy Harris <jgh146exb@wizmail.org>2014-08-14 21:21:45 +0100
committerJeremy Harris <jgh146exb@wizmail.org>2014-08-14 21:21:45 +0100
commit36b894a60b9431d20a8b8b1aa557673c747c4b47 (patch)
tree189945466fad247ec6bac8787db67bd6b8b2fcb5 /test
parent360c049264151071203aee2f957472321ff0dc41 (diff)
Fix fakens TLSA generation and DANE TLSA lookup
Diffstat (limited to 'test')
-rw-r--r--test/src/fakens.c19
-rw-r--r--test/stdout/58002
2 files changed, 17 insertions, 4 deletions
diff --git a/test/src/fakens.c b/test/src/fakens.c
index 912f41984..fd3604a3c 100644
--- a/test/src/fakens.c
+++ b/test/src/fakens.c
@@ -195,6 +195,19 @@ return pk;
}
uschar *
+bytefield(uschar ** pp, uschar * pk)
+{
+unsigned value = 0;
+uschar * p = *pp;
+
+while (isdigit(*p)) value = value*10 + *p++ - '0';
+while (isspace(*p)) p++;
+*pp = p;
+*pk++ = value & 255;
+return pk;
+}
+
+uschar *
shortfield(uschar ** pp, uschar * pk)
{
unsigned value = 0;
@@ -420,9 +433,9 @@ while (fgets(CS buffer, sizeof(buffer), f) != NULL)
break;
case ns_t_tlsa:
- pk = shortfield(&p, pk); /* usage */
- pk = shortfield(&p, pk); /* selector */
- pk = shortfield(&p, pk); /* match type */
+ pk = bytefield(&p, pk); /* usage */
+ pk = bytefield(&p, pk); /* selector */
+ pk = bytefield(&p, pk); /* match type */
while (isxdigit(*p))
{
value = toupper(*p) - (isdigit(*p) ? '0' : '7') << 4;
diff --git a/test/stdout/5800 b/test/stdout/5800
index bcbbd88e0..b9c64fea0 100644
--- a/test/stdout/5800
+++ b/test/stdout/5800
@@ -1,4 +1,4 @@
>
-> dnslookup tlsa: 3 1 2 3d5eb81b1dfc3f93c1fa8819e3fb3fdb41bb590441d5f3811db17772f4bc6de29bdd7c4f4b723750dda871b99379192b3f979f03db1252c4f08b03ef7176528d000000
+> dnslookup tlsa: 3 1 2 3d5eb81b1dfc3f93c1fa8819e3fb3fdb41bb590441d5f3811db17772f4bc6de29bdd7c4f4b723750dda871b99379192b3f979f03db1252c4f08b03ef7176528d
>
>