summaryrefslogtreecommitdiffstats
path: root/mDNSResponder/mDNSMacOSX/helper.c
diff options
context:
space:
mode:
Diffstat (limited to 'mDNSResponder/mDNSMacOSX/helper.c')
-rw-r--r--mDNSResponder/mDNSMacOSX/helper.c15
1 files changed, 13 insertions, 2 deletions
diff --git a/mDNSResponder/mDNSMacOSX/helper.c b/mDNSResponder/mDNSMacOSX/helper.c
index dc90b35d..7b6cb897 100644
--- a/mDNSResponder/mDNSMacOSX/helper.c
+++ b/mDNSResponder/mDNSMacOSX/helper.c
@@ -1,6 +1,6 @@
/* -*- Mode: C; tab-width: 4 -*-
*
- * Copyright (c) 2007-2015 Apple Inc. All rights reserved.
+ * Copyright (c) 2007-2018 Apple Inc. All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -710,7 +710,12 @@ fin:
enum DNSKeyFormat
{
- formatNotDNSKey, formatDdnsTypeItem, formatDnsPrefixedServiceItem, formatBtmmPrefixedServiceItem
+ formatNotDNSKey,
+ formatDdnsTypeItem,
+ formatDnsPrefixedServiceItem,
+#if MDNSRESPONDER_BTMM_SUPPORT
+ formatBtmmPrefixedServiceItem
+#endif
};
// On Mac OS X on Intel, the four-character string seems to be stored backwards, at least sometimes.
@@ -720,7 +725,9 @@ enum DNSKeyFormat
#ifndef NO_SECURITYFRAMEWORK
+#if MDNSRESPONDER_BTMM_SUPPORT
static const char btmmprefix[] = "btmmdns:";
+#endif
static const char dnsprefix[] = "dns:";
static const char ddns[] = "ddns";
static const char ddnsrev[] = "sndd";
@@ -778,8 +785,10 @@ static enum DNSKeyFormat getDNSKeyFormat(SecKeychainItemRef item, SecKeychainAtt
}
if (attributes->attr[1].length >= sizeof(dnsprefix)-1 && 0 == strncasecmp(attributes->attr[1].data, dnsprefix, sizeof(dnsprefix)-1))
format = formatDnsPrefixedServiceItem;
+#if MDNSRESPONDER_BTMM_SUPPORT
else if (attributes->attr[1].length >= sizeof(btmmprefix)-1 && 0 == strncasecmp(attributes->attr[1].data, btmmprefix, sizeof(btmmprefix)-1))
format = formatBtmmPrefixedServiceItem;
+#endif
else if (attributes->attr[0].length == sizeof(ddns)-1 && 0 == strncasecmp(attributes->attr[0].data, ddns, sizeof(ddns)-1))
format = formatDdnsTypeItem;
else if (attributes->attr[0].length == sizeof(ddnsrev)-1 && 0 == strncasecmp(attributes->attr[0].data, ddnsrev, sizeof(ddnsrev)-1))
@@ -821,7 +830,9 @@ static CFPropertyListRef copyKeychainItemInfo(SecKeychainItemRef item, SecKeycha
data = CFDataCreate(kCFAllocatorDefault, attributes->attr[1].data, attributes->attr[1].length);
break;
case formatDnsPrefixedServiceItem:
+#if MDNSRESPONDER_BTMM_SUPPORT
case formatBtmmPrefixedServiceItem:
+#endif
data = CFDataCreate(kCFAllocatorDefault, attributes->attr[1].data, attributes->attr[1].length);
break;
default: