summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>2008-04-16 22:35:24 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>2008-04-16 22:35:24 +0000
commitd3b0e81c0a24fb1b8343a2e058cd4815dc768f2a (patch)
tree0de14d7e9d9855cf08bddb8308e355b1e8c97f9b
parent84736d470fd6d37560017f2e26ab80ee92200bab (diff)
permit _ in the middle of a DNS name component
-rw-r--r--lib/libc/net/res_comp.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/libc/net/res_comp.c b/lib/libc/net/res_comp.c
index 9bdc26dd246..69a6ce0abbb 100644
--- a/lib/libc/net/res_comp.c
+++ b/lib/libc/net/res_comp.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: res_comp.c,v 1.13 2005/08/06 20:30:03 espie Exp $ */
+/* $OpenBSD: res_comp.c,v 1.14 2008/04/16 22:35:23 deraadt Exp $ */
/*
* ++Copyright++ 1985, 1993
@@ -332,6 +332,7 @@ dn_find(u_char *exp_dn, u_char *msg, u_char **dnptrs, u_char **lastdnptr)
#define PERIOD 0x2e
#define hyphenchar(c) ((c) == 0x2d)
#define bslashchar(c) ((c) == 0x5c)
+#define underscorechar(c) ((c) == 0x5f)
#define periodchar(c) ((c) == PERIOD)
#define asterchar(c) ((c) == 0x2a)
#define alphachar(c) (((c) >= 0x41 && (c) <= 0x5a) \
@@ -339,7 +340,7 @@ dn_find(u_char *exp_dn, u_char *msg, u_char **dnptrs, u_char **lastdnptr)
#define digitchar(c) ((c) >= 0x30 && (c) <= 0x39)
#define borderchar(c) (alphachar(c) || digitchar(c))
-#define middlechar(c) (borderchar(c) || hyphenchar(c))
+#define middlechar(c) (borderchar(c) || hyphenchar(c) || underscorechar(c))
#define domainchar(c) ((c) > 0x20 && (c) < 0x7f)
int