28 * (C) Copyright IBM Corp. 1999 All Rights Reserved. 29 * Copyright 1997 The Open Group Research Institute. All rights reserved. 30 */ 31 package sun.security.krb5; 32 33 import java.io.*; 34 import java.nio.file.DirectoryStream; 35 import java.nio.file.Files; 36 import java.nio.file.Paths; 37 import java.nio.file.Path; 38 import java.security.PrivilegedAction; 39 import java.util.*; 40 import java.net.InetAddress; 41 import java.net.UnknownHostException; 42 import java.security.AccessController; 43 import java.security.PrivilegedExceptionAction; 44 import java.util.regex.Matcher; 45 import java.util.regex.Pattern; 46 47 import sun.net.dns.ResolverConfiguration; 48 import sun.security.action.GetPropertyAction; 49 import sun.security.krb5.internal.crypto.EType; 50 import sun.security.krb5.internal.Krb5; 51 52 /** 53 * This class maintains key-value pairs of Kerberos configurable constants 54 * from configuration file or from user specified system properties. 55 */ 56 57 public class Config { 58 59 /* 60 * Only allow a single instance of Config. 61 */ 62 private static Config singleton = null; 63 64 /* 65 * Hashtable used to store configuration information. 66 */ 67 private Hashtable<String,Object> stanzaTable = new Hashtable<>(); 68 69 private static boolean DEBUG = sun.security.krb5.internal.Krb5.DEBUG; 70 71 // these are used for hexdecimal calculation. 72 private static final int BASE16_0 = 1; 73 private static final int BASE16_1 = 16; 74 private static final int BASE16_2 = 16 * 16; 75 private static final int BASE16_3 = 16 * 16 * 16; 76 77 /** | 28 * (C) Copyright IBM Corp. 1999 All Rights Reserved. 29 * Copyright 1997 The Open Group Research Institute. All rights reserved. 30 */ 31 package sun.security.krb5; 32 33 import java.io.*; 34 import java.nio.file.DirectoryStream; 35 import java.nio.file.Files; 36 import java.nio.file.Paths; 37 import java.nio.file.Path; 38 import java.security.PrivilegedAction; 39 import java.util.*; 40 import java.net.InetAddress; 41 import java.net.UnknownHostException; 42 import java.security.AccessController; 43 import java.security.PrivilegedExceptionAction; 44 import java.util.regex.Matcher; 45 import java.util.regex.Pattern; 46 47 import sun.net.dns.ResolverConfiguration; 48 import sun.security.action.GetIntegerAction; 49 import sun.security.action.GetPropertyAction; 50 import sun.security.krb5.internal.crypto.EType; 51 import sun.security.krb5.internal.Krb5; 52 53 /** 54 * This class maintains key-value pairs of Kerberos configurable constants 55 * from configuration file or from user specified system properties. 56 */ 57 58 public class Config { 59 60 public static final boolean DISABLE_REFERRALS; 61 62 /** 63 * {@systemProperty sun.security.krb5.disableReferrals} property 64 * indicating whether or not cross-realm referrals (RFC 6806) are 65 * enabled. 66 */ 67 static { 68 PrivilegedAction<String> getDisableReferralsProp = 69 () -> System.getProperty( 70 "sun.security.krb5.disableReferrals", "false"); 71 DISABLE_REFERRALS = "true".equalsIgnoreCase( 72 AccessController.doPrivileged(getDisableReferralsProp)); 73 } 74 75 /** 76 * {@systemProperty sun.security.krb5.maxReferrals} property 77 * indicating the maximum number of cross-realm referral 78 * hops allowed. 79 */ 80 public static final int MAX_REFERRALS = GetIntegerAction 81 .privilegedGetProperty("sun.security.krb5.maxReferrals", 5); 82 83 /* 84 * Only allow a single instance of Config. 85 */ 86 private static Config singleton = null; 87 88 /* 89 * Hashtable used to store configuration information. 90 */ 91 private Hashtable<String,Object> stanzaTable = new Hashtable<>(); 92 93 private static boolean DEBUG = sun.security.krb5.internal.Krb5.DEBUG; 94 95 // these are used for hexdecimal calculation. 96 private static final int BASE16_0 = 1; 97 private static final int BASE16_1 = 16; 98 private static final int BASE16_2 = 16 * 16; 99 private static final int BASE16_3 = 16 * 16 * 16; 100 101 /** |