< prev index next >

test/jdk/sun/security/krb5/auto/ReplayCacheTestProc.java

Print this page
rev 59107 : imported patch security


  72  */
  73 public class ReplayCacheTestProc {
  74 
  75     private static Proc[] pa;   // all acceptors
  76     private static Proc pi;     // the single initiator
  77     private static List<Req> reqs = new ArrayList<>();
  78     private static String HOST = "localhost";
  79 
  80     private static final String SERVICE;
  81     private static long uid;
  82     private static String cwd;
  83 
  84     static {
  85         String tmp = System.getProperty("test.service");
  86         SERVICE = (tmp == null) ? "service" : tmp;
  87         uid = jdk.internal.misc.VM.geteuid();
  88         // Where should the rcache be saved. KRB5RCACHEDIR is not
  89         // recognized on Solaris (might be supported on Solaris 12),
  90         // and directory name is different when launched by root.
  91         // See manpage krb5envvar(5) on KRB5RCNAME.
  92         if (System.getProperty("os.name").startsWith("SunOS")) {
  93             if (uid == 0) {
  94                 cwd = "/var/krb5/rcache/root/";
  95             } else {
  96                 cwd = "/var/krb5/rcache/";
  97             }
  98         } else {
  99             cwd = System.getProperty("user.dir");
 100         }
 101     }
 102 
 103     private static MessageDigest md5, sha256;
 104 
 105     static {
 106         try {
 107             md5 = MessageDigest.getInstance("MD5");
 108             sha256 = MessageDigest.getInstance("SHA-256");
 109         } catch (NoSuchAlgorithmException nsae) {
 110             throw new AssertionError("Impossible", nsae);
 111         }
 112     }
 113 
 114 
 115     public static void main0(String[] args) throws Exception {
 116         System.setProperty("java.security.krb5.conf", OneKDC.KRB5_CONF);
 117         if (args.length == 0) { // The controller
 118             int nc = 5;     // number of clients
 119             int ns = 5;     // number of services
 120             String[] libs;  // available acceptor types:




  72  */
  73 public class ReplayCacheTestProc {
  74 
  75     private static Proc[] pa;   // all acceptors
  76     private static Proc pi;     // the single initiator
  77     private static List<Req> reqs = new ArrayList<>();
  78     private static String HOST = "localhost";
  79 
  80     private static final String SERVICE;
  81     private static long uid;
  82     private static String cwd;
  83 
  84     static {
  85         String tmp = System.getProperty("test.service");
  86         SERVICE = (tmp == null) ? "service" : tmp;
  87         uid = jdk.internal.misc.VM.geteuid();
  88         // Where should the rcache be saved. KRB5RCACHEDIR is not
  89         // recognized on Solaris (might be supported on Solaris 12),
  90         // and directory name is different when launched by root.
  91         // See manpage krb5envvar(5) on KRB5RCNAME.







  92         cwd = System.getProperty("user.dir");

  93     }
  94 
  95     private static MessageDigest md5, sha256;
  96 
  97     static {
  98         try {
  99             md5 = MessageDigest.getInstance("MD5");
 100             sha256 = MessageDigest.getInstance("SHA-256");
 101         } catch (NoSuchAlgorithmException nsae) {
 102             throw new AssertionError("Impossible", nsae);
 103         }
 104     }
 105 
 106 
 107     public static void main0(String[] args) throws Exception {
 108         System.setProperty("java.security.krb5.conf", OneKDC.KRB5_CONF);
 109         if (args.length == 0) { // The controller
 110             int nc = 5;     // number of clients
 111             int ns = 5;     // number of services
 112             String[] libs;  // available acceptor types:


< prev index next >