test/jdk/sun/security/krb5/ServiceCredsCombination.java
author jboes
Fri, 08 Nov 2019 11:15:16 +0000
changeset 59029 3786a0962570
parent 47216 71c04702a3d5
permissions -rw-r--r--
8232853: AuthenticationFilter.Cache::remove may throw ConcurrentModificationException Summary: Change implementation to use iterator instead of plain LinkedList Reviewed-by: dfuchs, vtewari
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
15006
10d6aacdd67f 8005447: default principal should act as anyone
weijun
parents:
diff changeset
     1
/*
23010
6dadb192ad81 8029235: Update copyright year to match last edit in jdk8 jdk repository for 2013
lana
parents: 15649
diff changeset
     2
 * Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved.
15006
10d6aacdd67f 8005447: default principal should act as anyone
weijun
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
10d6aacdd67f 8005447: default principal should act as anyone
weijun
parents:
diff changeset
     4
 *
10d6aacdd67f 8005447: default principal should act as anyone
weijun
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
10d6aacdd67f 8005447: default principal should act as anyone
weijun
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
10d6aacdd67f 8005447: default principal should act as anyone
weijun
parents:
diff changeset
     7
 * published by the Free Software Foundation.
10d6aacdd67f 8005447: default principal should act as anyone
weijun
parents:
diff changeset
     8
 *
10d6aacdd67f 8005447: default principal should act as anyone
weijun
parents:
diff changeset
     9
 * This code is distributed in the hope that it will be useful, but WITHOUT
10d6aacdd67f 8005447: default principal should act as anyone
weijun
parents:
diff changeset
    10
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
10d6aacdd67f 8005447: default principal should act as anyone
weijun
parents:
diff changeset
    11
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
10d6aacdd67f 8005447: default principal should act as anyone
weijun
parents:
diff changeset
    12
 * version 2 for more details (a copy is included in the LICENSE file that
10d6aacdd67f 8005447: default principal should act as anyone
weijun
parents:
diff changeset
    13
 * accompanied this code).
10d6aacdd67f 8005447: default principal should act as anyone
weijun
parents:
diff changeset
    14
 *
10d6aacdd67f 8005447: default principal should act as anyone
weijun
parents:
diff changeset
    15
 * You should have received a copy of the GNU General Public License version
10d6aacdd67f 8005447: default principal should act as anyone
weijun
parents:
diff changeset
    16
 * 2 along with this work; if not, write to the Free Software Foundation,
10d6aacdd67f 8005447: default principal should act as anyone
weijun
parents:
diff changeset
    17
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
10d6aacdd67f 8005447: default principal should act as anyone
weijun
parents:
diff changeset
    18
 *
10d6aacdd67f 8005447: default principal should act as anyone
weijun
parents:
diff changeset
    19
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
10d6aacdd67f 8005447: default principal should act as anyone
weijun
parents:
diff changeset
    20
 * or visit www.oracle.com if you need additional information or have any
10d6aacdd67f 8005447: default principal should act as anyone
weijun
parents:
diff changeset
    21
 * questions.
10d6aacdd67f 8005447: default principal should act as anyone
weijun
parents:
diff changeset
    22
 */
10d6aacdd67f 8005447: default principal should act as anyone
weijun
parents:
diff changeset
    23
/*
10d6aacdd67f 8005447: default principal should act as anyone
weijun
parents:
diff changeset
    24
 * @test
10d6aacdd67f 8005447: default principal should act as anyone
weijun
parents:
diff changeset
    25
 * @bug 8005447
30820
0d4717a011d3 8081347: Add @modules to jdk_core tests
mchung
parents: 23010
diff changeset
    26
 * @modules java.security.jgss/sun.security.jgss
15006
10d6aacdd67f 8005447: default principal should act as anyone
weijun
parents:
diff changeset
    27
 * @compile -XDignore.symbol.file ServiceCredsCombination.java
10d6aacdd67f 8005447: default principal should act as anyone
weijun
parents:
diff changeset
    28
 * @run main ServiceCredsCombination
10d6aacdd67f 8005447: default principal should act as anyone
weijun
parents:
diff changeset
    29
 * @summary default principal can act as anyone
10d6aacdd67f 8005447: default principal should act as anyone
weijun
parents:
diff changeset
    30
 */
10d6aacdd67f 8005447: default principal should act as anyone
weijun
parents:
diff changeset
    31
10d6aacdd67f 8005447: default principal should act as anyone
weijun
parents:
diff changeset
    32
import java.security.PrivilegedActionException;
10d6aacdd67f 8005447: default principal should act as anyone
weijun
parents:
diff changeset
    33
import java.security.PrivilegedExceptionAction;
10d6aacdd67f 8005447: default principal should act as anyone
weijun
parents:
diff changeset
    34
import java.util.Objects;
10d6aacdd67f 8005447: default principal should act as anyone
weijun
parents:
diff changeset
    35
import javax.security.auth.Subject;
10d6aacdd67f 8005447: default principal should act as anyone
weijun
parents:
diff changeset
    36
import javax.security.auth.kerberos.KerberosKey;
10d6aacdd67f 8005447: default principal should act as anyone
weijun
parents:
diff changeset
    37
import javax.security.auth.kerberos.KerberosPrincipal;
10d6aacdd67f 8005447: default principal should act as anyone
weijun
parents:
diff changeset
    38
import javax.security.auth.kerberos.KeyTab;
10d6aacdd67f 8005447: default principal should act as anyone
weijun
parents:
diff changeset
    39
import org.ietf.jgss.GSSCredential;
10d6aacdd67f 8005447: default principal should act as anyone
weijun
parents:
diff changeset
    40
import org.ietf.jgss.GSSException;
10d6aacdd67f 8005447: default principal should act as anyone
weijun
parents:
diff changeset
    41
import org.ietf.jgss.GSSManager;
10d6aacdd67f 8005447: default principal should act as anyone
weijun
parents:
diff changeset
    42
import org.ietf.jgss.GSSName;
10d6aacdd67f 8005447: default principal should act as anyone
weijun
parents:
diff changeset
    43
import sun.security.jgss.GSSUtil;
10d6aacdd67f 8005447: default principal should act as anyone
weijun
parents:
diff changeset
    44
10d6aacdd67f 8005447: default principal should act as anyone
weijun
parents:
diff changeset
    45
public class ServiceCredsCombination {
10d6aacdd67f 8005447: default principal should act as anyone
weijun
parents:
diff changeset
    46
10d6aacdd67f 8005447: default principal should act as anyone
weijun
parents:
diff changeset
    47
    public static void main(String[] args) throws Exception {
10d6aacdd67f 8005447: default principal should act as anyone
weijun
parents:
diff changeset
    48
        // pass
10d6aacdd67f 8005447: default principal should act as anyone
weijun
parents:
diff changeset
    49
        check("a", "a", princ("a"), key("a"));
10d6aacdd67f 8005447: default principal should act as anyone
weijun
parents:
diff changeset
    50
        check(null, "a", princ("a"), key("a"));
10d6aacdd67f 8005447: default principal should act as anyone
weijun
parents:
diff changeset
    51
        check("x", "NOCRED", princ("a"), key("a"));
10d6aacdd67f 8005447: default principal should act as anyone
weijun
parents:
diff changeset
    52
        // two pass
10d6aacdd67f 8005447: default principal should act as anyone
weijun
parents:
diff changeset
    53
        check("a", "a", princ("a"), key("a"), princ("b"), key("b"));
10d6aacdd67f 8005447: default principal should act as anyone
weijun
parents:
diff changeset
    54
        check("b", "b", princ("a"), key("a"), princ("b"), key("b"));
10d6aacdd67f 8005447: default principal should act as anyone
weijun
parents:
diff changeset
    55
        check(null, null, princ("a"), key("a"), princ("b"), key("b"));
10d6aacdd67f 8005447: default principal should act as anyone
weijun
parents:
diff changeset
    56
        check("x", "NOCRED", princ("a"), key("a"), princ("b"), key("b"));
10d6aacdd67f 8005447: default principal should act as anyone
weijun
parents:
diff changeset
    57
        // old ktab
10d6aacdd67f 8005447: default principal should act as anyone
weijun
parents:
diff changeset
    58
        check("b", "b", princ("b"), oldktab());
10d6aacdd67f 8005447: default principal should act as anyone
weijun
parents:
diff changeset
    59
        check("x", "NOCRED", princ("b"), oldktab());
10d6aacdd67f 8005447: default principal should act as anyone
weijun
parents:
diff changeset
    60
        check(null, "b", princ("b"), oldktab());
10d6aacdd67f 8005447: default principal should act as anyone
weijun
parents:
diff changeset
    61
        // Two old ktab
10d6aacdd67f 8005447: default principal should act as anyone
weijun
parents:
diff changeset
    62
        check("a", "a", princ("a"), princ("b"), oldktab(), oldktab());
10d6aacdd67f 8005447: default principal should act as anyone
weijun
parents:
diff changeset
    63
        check("b", "b", princ("a"), princ("b"), oldktab(), oldktab());
10d6aacdd67f 8005447: default principal should act as anyone
weijun
parents:
diff changeset
    64
        check(null, null, princ("a"), princ("b"), oldktab(), oldktab());
10d6aacdd67f 8005447: default principal should act as anyone
weijun
parents:
diff changeset
    65
        check("x", "NOCRED", princ("a"), princ("b"), oldktab(), oldktab());
15649
f6bd3d34f844 8001104: Unbound SASL service: the GSSAPI/krb5 mech
weijun
parents: 15006
diff changeset
    66
        // bound ktab
f6bd3d34f844 8001104: Unbound SASL service: the GSSAPI/krb5 mech
weijun
parents: 15006
diff changeset
    67
        check("c", "c", princ("c"), ktab("c"));
f6bd3d34f844 8001104: Unbound SASL service: the GSSAPI/krb5 mech
weijun
parents: 15006
diff changeset
    68
        check(null, "c", princ("c"), ktab("c"));
f6bd3d34f844 8001104: Unbound SASL service: the GSSAPI/krb5 mech
weijun
parents: 15006
diff changeset
    69
        // unbound ktab
f6bd3d34f844 8001104: Unbound SASL service: the GSSAPI/krb5 mech
weijun
parents: 15006
diff changeset
    70
        check("x", "x", ktab());
f6bd3d34f844 8001104: Unbound SASL service: the GSSAPI/krb5 mech
weijun
parents: 15006
diff changeset
    71
        check(null, null, ktab());
f6bd3d34f844 8001104: Unbound SASL service: the GSSAPI/krb5 mech
weijun
parents: 15006
diff changeset
    72
        // Two bound ktab
f6bd3d34f844 8001104: Unbound SASL service: the GSSAPI/krb5 mech
weijun
parents: 15006
diff changeset
    73
        check("c1", "c1", princ("c1"), princ("c2"), ktab("c1"), ktab("c2"));
f6bd3d34f844 8001104: Unbound SASL service: the GSSAPI/krb5 mech
weijun
parents: 15006
diff changeset
    74
        check("c2", "c2", princ("c1"), princ("c2"), ktab("c1"), ktab("c2"));
f6bd3d34f844 8001104: Unbound SASL service: the GSSAPI/krb5 mech
weijun
parents: 15006
diff changeset
    75
        check("x", "NOCRED", princ("c1"), princ("c2"), ktab("c1"), ktab("c2"));
f6bd3d34f844 8001104: Unbound SASL service: the GSSAPI/krb5 mech
weijun
parents: 15006
diff changeset
    76
        check(null, null, princ("c1"), princ("c2"), ktab("c1"), ktab("c2"));
f6bd3d34f844 8001104: Unbound SASL service: the GSSAPI/krb5 mech
weijun
parents: 15006
diff changeset
    77
        // One bound, one unbound
f6bd3d34f844 8001104: Unbound SASL service: the GSSAPI/krb5 mech
weijun
parents: 15006
diff changeset
    78
        check("c1", "c1", princ("c1"), ktab("c1"), ktab());
f6bd3d34f844 8001104: Unbound SASL service: the GSSAPI/krb5 mech
weijun
parents: 15006
diff changeset
    79
        check("x", "x", princ("c1"), ktab("c1"), ktab());
f6bd3d34f844 8001104: Unbound SASL service: the GSSAPI/krb5 mech
weijun
parents: 15006
diff changeset
    80
        check(null, null, princ("c1"), ktab("c1"), ktab());
f6bd3d34f844 8001104: Unbound SASL service: the GSSAPI/krb5 mech
weijun
parents: 15006
diff changeset
    81
        // Two unbound ktab
f6bd3d34f844 8001104: Unbound SASL service: the GSSAPI/krb5 mech
weijun
parents: 15006
diff changeset
    82
        check("x", "x", ktab(), ktab());
f6bd3d34f844 8001104: Unbound SASL service: the GSSAPI/krb5 mech
weijun
parents: 15006
diff changeset
    83
        check(null, null, ktab(), ktab());
15006
10d6aacdd67f 8005447: default principal should act as anyone
weijun
parents:
diff changeset
    84
        // pass + old ktab
10d6aacdd67f 8005447: default principal should act as anyone
weijun
parents:
diff changeset
    85
        check("a", "a", princ("a"), princ("b"), key("a"), oldktab());
10d6aacdd67f 8005447: default principal should act as anyone
weijun
parents:
diff changeset
    86
        check("b", "b", princ("a"), princ("b"), key("a"), oldktab());
10d6aacdd67f 8005447: default principal should act as anyone
weijun
parents:
diff changeset
    87
        check(null, null, princ("a"), princ("b"), key("a"), oldktab());
10d6aacdd67f 8005447: default principal should act as anyone
weijun
parents:
diff changeset
    88
        check("x", "NOCRED", princ("a"), princ("b"), key("a"), oldktab());
15649
f6bd3d34f844 8001104: Unbound SASL service: the GSSAPI/krb5 mech
weijun
parents: 15006
diff changeset
    89
        // pass + bound ktab
f6bd3d34f844 8001104: Unbound SASL service: the GSSAPI/krb5 mech
weijun
parents: 15006
diff changeset
    90
        check("a", "a", princ("a"), princ("c"), key("a"), ktab("c"));
f6bd3d34f844 8001104: Unbound SASL service: the GSSAPI/krb5 mech
weijun
parents: 15006
diff changeset
    91
        check("c", "c", princ("a"), princ("c"), key("a"), ktab("c"));
f6bd3d34f844 8001104: Unbound SASL service: the GSSAPI/krb5 mech
weijun
parents: 15006
diff changeset
    92
        check("x", "NOCRED", princ("a"), princ("c"), key("a"), ktab("c"));
f6bd3d34f844 8001104: Unbound SASL service: the GSSAPI/krb5 mech
weijun
parents: 15006
diff changeset
    93
        check(null, null, princ("a"), princ("c"), key("a"), ktab("c"));
f6bd3d34f844 8001104: Unbound SASL service: the GSSAPI/krb5 mech
weijun
parents: 15006
diff changeset
    94
        // pass + unbound ktab
f6bd3d34f844 8001104: Unbound SASL service: the GSSAPI/krb5 mech
weijun
parents: 15006
diff changeset
    95
        check("a", "a", princ("a"), key("a"), ktab());
f6bd3d34f844 8001104: Unbound SASL service: the GSSAPI/krb5 mech
weijun
parents: 15006
diff changeset
    96
        check("x", "x", princ("a"), key("a"), ktab());
f6bd3d34f844 8001104: Unbound SASL service: the GSSAPI/krb5 mech
weijun
parents: 15006
diff changeset
    97
        check(null, null, princ("a"), key("a"), ktab());
15006
10d6aacdd67f 8005447: default principal should act as anyone
weijun
parents:
diff changeset
    98
        // Compatibility, automatically add princ for keys
10d6aacdd67f 8005447: default principal should act as anyone
weijun
parents:
diff changeset
    99
        check(null, "a", key("a"));
10d6aacdd67f 8005447: default principal should act as anyone
weijun
parents:
diff changeset
   100
        check("x", "NOCRED", key("a"));
10d6aacdd67f 8005447: default principal should act as anyone
weijun
parents:
diff changeset
   101
        check(null, "a", key("a"), oldktab());
10d6aacdd67f 8005447: default principal should act as anyone
weijun
parents:
diff changeset
   102
        check("x", "NOCRED", key("a"), oldktab());
10d6aacdd67f 8005447: default principal should act as anyone
weijun
parents:
diff changeset
   103
        // Limitation, "a" has no key, but we don't know oldktab() is for "b"
10d6aacdd67f 8005447: default principal should act as anyone
weijun
parents:
diff changeset
   104
        check("a", "a", princ("a"), princ("b"), oldktab());
10d6aacdd67f 8005447: default principal should act as anyone
weijun
parents:
diff changeset
   105
    }
10d6aacdd67f 8005447: default principal should act as anyone
weijun
parents:
diff changeset
   106
10d6aacdd67f 8005447: default principal should act as anyone
weijun
parents:
diff changeset
   107
    /**
10d6aacdd67f 8005447: default principal should act as anyone
weijun
parents:
diff changeset
   108
     * Checks the correct bound
10d6aacdd67f 8005447: default principal should act as anyone
weijun
parents:
diff changeset
   109
     * @param a get a creds for this principal, null for default one
10d6aacdd67f 8005447: default principal should act as anyone
weijun
parents:
diff changeset
   110
     * @param b expected name, null for still unbound, "NOCRED" for no creds
10d6aacdd67f 8005447: default principal should act as anyone
weijun
parents:
diff changeset
   111
     * @param objs princs, keys and keytabs in the subject
10d6aacdd67f 8005447: default principal should act as anyone
weijun
parents:
diff changeset
   112
     */
10d6aacdd67f 8005447: default principal should act as anyone
weijun
parents:
diff changeset
   113
    private static void check(final String a, String b, Object... objs)
10d6aacdd67f 8005447: default principal should act as anyone
weijun
parents:
diff changeset
   114
            throws Exception {
10d6aacdd67f 8005447: default principal should act as anyone
weijun
parents:
diff changeset
   115
        Subject subj = new Subject();
10d6aacdd67f 8005447: default principal should act as anyone
weijun
parents:
diff changeset
   116
        for (Object obj: objs) {
10d6aacdd67f 8005447: default principal should act as anyone
weijun
parents:
diff changeset
   117
            if (obj instanceof KerberosPrincipal) {
10d6aacdd67f 8005447: default principal should act as anyone
weijun
parents:
diff changeset
   118
                subj.getPrincipals().add((KerberosPrincipal)obj);
10d6aacdd67f 8005447: default principal should act as anyone
weijun
parents:
diff changeset
   119
            } else if (obj instanceof KerberosKey || obj instanceof KeyTab) {
10d6aacdd67f 8005447: default principal should act as anyone
weijun
parents:
diff changeset
   120
                subj.getPrivateCredentials().add(obj);
10d6aacdd67f 8005447: default principal should act as anyone
weijun
parents:
diff changeset
   121
            }
10d6aacdd67f 8005447: default principal should act as anyone
weijun
parents:
diff changeset
   122
        }
10d6aacdd67f 8005447: default principal should act as anyone
weijun
parents:
diff changeset
   123
        final GSSManager man = GSSManager.getInstance();
10d6aacdd67f 8005447: default principal should act as anyone
weijun
parents:
diff changeset
   124
        try {
10d6aacdd67f 8005447: default principal should act as anyone
weijun
parents:
diff changeset
   125
            String result = Subject.doAs(
10d6aacdd67f 8005447: default principal should act as anyone
weijun
parents:
diff changeset
   126
                    subj, new PrivilegedExceptionAction<String>() {
10d6aacdd67f 8005447: default principal should act as anyone
weijun
parents:
diff changeset
   127
                @Override
10d6aacdd67f 8005447: default principal should act as anyone
weijun
parents:
diff changeset
   128
                public String run() throws GSSException {
10d6aacdd67f 8005447: default principal should act as anyone
weijun
parents:
diff changeset
   129
                    GSSCredential cred = man.createCredential(
10d6aacdd67f 8005447: default principal should act as anyone
weijun
parents:
diff changeset
   130
                            a == null ? null : man.createName(r(a), null),
10d6aacdd67f 8005447: default principal should act as anyone
weijun
parents:
diff changeset
   131
                            GSSCredential.INDEFINITE_LIFETIME,
10d6aacdd67f 8005447: default principal should act as anyone
weijun
parents:
diff changeset
   132
                            GSSUtil.GSS_KRB5_MECH_OID,
10d6aacdd67f 8005447: default principal should act as anyone
weijun
parents:
diff changeset
   133
                            GSSCredential.ACCEPT_ONLY);
10d6aacdd67f 8005447: default principal should act as anyone
weijun
parents:
diff changeset
   134
                    GSSName name = cred.getName();
10d6aacdd67f 8005447: default principal should act as anyone
weijun
parents:
diff changeset
   135
                    return name == null ? null : name.toString();
10d6aacdd67f 8005447: default principal should act as anyone
weijun
parents:
diff changeset
   136
                }
10d6aacdd67f 8005447: default principal should act as anyone
weijun
parents:
diff changeset
   137
            });
10d6aacdd67f 8005447: default principal should act as anyone
weijun
parents:
diff changeset
   138
            if (!Objects.equals(result, r(b))) {
10d6aacdd67f 8005447: default principal should act as anyone
weijun
parents:
diff changeset
   139
                throw new Exception("Check failed: getInstance(" + a
10d6aacdd67f 8005447: default principal should act as anyone
weijun
parents:
diff changeset
   140
                        + ") has name " + result + ", not " + b);
10d6aacdd67f 8005447: default principal should act as anyone
weijun
parents:
diff changeset
   141
            }
10d6aacdd67f 8005447: default principal should act as anyone
weijun
parents:
diff changeset
   142
        } catch (PrivilegedActionException e) {
10d6aacdd67f 8005447: default principal should act as anyone
weijun
parents:
diff changeset
   143
            if (!"NOCRED".equals(b)) {
10d6aacdd67f 8005447: default principal should act as anyone
weijun
parents:
diff changeset
   144
                throw new Exception("Check failed: getInstance(" + a
10d6aacdd67f 8005447: default principal should act as anyone
weijun
parents:
diff changeset
   145
                        + ") is null " + ", but not one with name " + b);
10d6aacdd67f 8005447: default principal should act as anyone
weijun
parents:
diff changeset
   146
            }
10d6aacdd67f 8005447: default principal should act as anyone
weijun
parents:
diff changeset
   147
        }
10d6aacdd67f 8005447: default principal should act as anyone
weijun
parents:
diff changeset
   148
    }
10d6aacdd67f 8005447: default principal should act as anyone
weijun
parents:
diff changeset
   149
    private static String r(String s) {
10d6aacdd67f 8005447: default principal should act as anyone
weijun
parents:
diff changeset
   150
        return s == null ? null : (s+"@REALM");
10d6aacdd67f 8005447: default principal should act as anyone
weijun
parents:
diff changeset
   151
    }
10d6aacdd67f 8005447: default principal should act as anyone
weijun
parents:
diff changeset
   152
    private static KerberosPrincipal princ(String s) {
10d6aacdd67f 8005447: default principal should act as anyone
weijun
parents:
diff changeset
   153
        return new KerberosPrincipal(r(s));
10d6aacdd67f 8005447: default principal should act as anyone
weijun
parents:
diff changeset
   154
    }
10d6aacdd67f 8005447: default principal should act as anyone
weijun
parents:
diff changeset
   155
    private static KerberosKey key(String s) {
10d6aacdd67f 8005447: default principal should act as anyone
weijun
parents:
diff changeset
   156
        return new KerberosKey(princ(s), new byte[0], 0, 0);
10d6aacdd67f 8005447: default principal should act as anyone
weijun
parents:
diff changeset
   157
    }
10d6aacdd67f 8005447: default principal should act as anyone
weijun
parents:
diff changeset
   158
    private static KeyTab oldktab() {
10d6aacdd67f 8005447: default principal should act as anyone
weijun
parents:
diff changeset
   159
        return KeyTab.getInstance();
10d6aacdd67f 8005447: default principal should act as anyone
weijun
parents:
diff changeset
   160
    }
15649
f6bd3d34f844 8001104: Unbound SASL service: the GSSAPI/krb5 mech
weijun
parents: 15006
diff changeset
   161
    static KeyTab ktab(String s) {
f6bd3d34f844 8001104: Unbound SASL service: the GSSAPI/krb5 mech
weijun
parents: 15006
diff changeset
   162
        return KeyTab.getInstance(princ(s));
f6bd3d34f844 8001104: Unbound SASL service: the GSSAPI/krb5 mech
weijun
parents: 15006
diff changeset
   163
    }
f6bd3d34f844 8001104: Unbound SASL service: the GSSAPI/krb5 mech
weijun
parents: 15006
diff changeset
   164
    static KeyTab ktab() {
f6bd3d34f844 8001104: Unbound SASL service: the GSSAPI/krb5 mech
weijun
parents: 15006
diff changeset
   165
        return KeyTab.getUnboundInstance();
f6bd3d34f844 8001104: Unbound SASL service: the GSSAPI/krb5 mech
weijun
parents: 15006
diff changeset
   166
    }
15006
10d6aacdd67f 8005447: default principal should act as anyone
weijun
parents:
diff changeset
   167
}