clients from taking advantage of new stronger enctypes when the
libraries are upgraded.
+**dns_canonicalize_hostname**
+ Indicate whether name lookups will be used to canonicalize
+ hostnames for use in service principal names. Setting this flag
+ to false can improve security by reducing reliance on DNS, but
+ means that short hostnames will not be canonicalized to
+ fully-qualified hostnames. The default value is true.
+
**dns_lookup_kdc**
Indicate whether DNS SRV records should be used to locate the KDCs
and other servers for a realm, if they are not listed in the
**rdns**
If this flag is true, reverse name lookup will be used in addition
to forward name lookup to canonicalizing hostnames for use in
- service principal names. The default value is true.
+ service principal names. If **dns_canonicalize_hostname** is set
+ to false, this flag has no effect. The default value is true.
**realm_try_domains**
Indicate whether a host's domain components should be used to
#define KRB5_CONF_DISABLE "disable"
#define KRB5_CONF_DISABLE_LAST_SUCCESS "disable_last_success"
#define KRB5_CONF_DISABLE_LOCKOUT "disable_lockout"
+#define KRB5_CONF_DNS_CANONICALIZE_HOSTNAME "dns_canonicalize_hostname"
#define KRB5_CONF_DNS_LOOKUP_KDC "dns_lookup_kdc"
#define KRB5_CONF_DNS_LOOKUP_REALM "dns_lookup_realm"
#define KRB5_CONF_DNS_FALLBACK "dns_fallback"
krb5_boolean allow_weak_crypto;
krb5_boolean ignore_acceptor_hostname;
+ krb5_boolean dns_canonicalize_hostname;
krb5_trace_callback trace_callback;
void *trace_callback_data;
goto cleanup;
ctx->ignore_acceptor_hostname = tmp;
+ retval = get_boolean(ctx, KRB5_CONF_DNS_CANONICALIZE_HOSTNAME, 1, &tmp);
+ if (retval)
+ goto cleanup;
+ ctx->dns_canonicalize_hostname = tmp;
+
/* initialize the prng (not well, but passable) */
if ((retval = krb5_c_random_os_entropy( ctx, 0, NULL)) !=0)
goto cleanup;
/* copy the hostname into non-volatile storage */
- if (type == KRB5_NT_SRV_HST) {
+ if (type == KRB5_NT_SRV_HST && context->dns_canonicalize_hostname) {
struct addrinfo *ai = NULL, hints;
int err;
char hnamebuf[NI_MAXHOST];