test/jdk/sun/security/krb5/auto/OkAsDelegate.java
changeset 48668 2da4a52715d8
parent 47216 71c04702a3d5
equal deleted inserted replaced
48667:f2344724a475 48668:2da4a52715d8
     1 /*
     1 /*
     2  * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
     2  * Copyright (c) 2009, 2018, Oracle and/or its affiliates. All rights reserved.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     4  *
     4  *
     5  * This code is free software; you can redistribute it and/or modify it
     5  * This code is free software; you can redistribute it and/or modify it
     6  * under the terms of the GNU General Public License version 2 only, as
     6  * under the terms of the GNU General Public License version 2 only, as
     7  * published by the Free Software Foundation.
     7  * published by the Free Software Foundation.
    21  * questions.
    21  * questions.
    22  */
    22  */
    23 
    23 
    24 /*
    24 /*
    25  * @test
    25  * @test
    26  * @bug 6853328 7172701
    26  * @bug 6853328 7172701 8194486
    27  * @run main/othervm OkAsDelegate false true true false false false
    27  * @summary Support OK-AS-DELEGATE flag
       
    28  * @library /test/lib
       
    29  * @run main jdk.test.lib.FileInstaller TestHosts TestHosts
       
    30  * @run main/othervm -Djdk.net.hosts.file=TestHosts OkAsDelegate
       
    31  *      false true true false false false
    28  *      FORWARDABLE ticket not allowed, always fail
    32  *      FORWARDABLE ticket not allowed, always fail
    29  * @run main/othervm OkAsDelegate true false false false false false
    33  * @run main/othervm -Djdk.net.hosts.file=TestHosts OkAsDelegate
       
    34  *      true false false false false false
    30  *      Service ticket no OK-AS-DELEGATE. Request nothing, gain nothing
    35  *      Service ticket no OK-AS-DELEGATE. Request nothing, gain nothing
    31  * @run main/othervm OkAsDelegate true false true false false false
    36  * @run main/othervm -Djdk.net.hosts.file=TestHosts OkAsDelegate
       
    37  *      true false true false false false
    32  *      Service ticket no OK-AS-DELEGATE. Request deleg policy, gain nothing
    38  *      Service ticket no OK-AS-DELEGATE. Request deleg policy, gain nothing
    33  * @run main/othervm OkAsDelegate true true false true false true
    39  * @run main/othervm -Djdk.net.hosts.file=TestHosts OkAsDelegate
       
    40  *      true true false true false true
    34  *      Service ticket no OK-AS-DELEGATE. Request deleg, granted
    41  *      Service ticket no OK-AS-DELEGATE. Request deleg, granted
    35  * @run main/othervm OkAsDelegate true true true true false true
    42  * @run main/othervm -Djdk.net.hosts.file=TestHosts
       
    43  *      OkAsDelegate true true true true false true
    36  *      Service ticket no OK-AS-DELEGATE. Request deleg and deleg policy, granted, with info not by policy
    44  *      Service ticket no OK-AS-DELEGATE. Request deleg and deleg policy, granted, with info not by policy
    37  * @run main/othervm -Dtest.kdc.policy.ok-as-delegate OkAsDelegate true false true true true true
    45  * @run main/othervm -Djdk.net.hosts.file=TestHosts
       
    46  *      -Dtest.kdc.policy.ok-as-delegate OkAsDelegate
       
    47  *      true false true true true true
    38  *      Service ticket has OK-AS-DELEGATE. Request deleg policy, granted
    48  *      Service ticket has OK-AS-DELEGATE. Request deleg policy, granted
    39  * @run main/othervm -Dtest.kdc.policy.ok-as-delegate OkAsDelegate true true true true true true
    49  * @run main/othervm -Djdk.net.hosts.file=TestHosts
       
    50  *      -Dtest.kdc.policy.ok-as-delegate OkAsDelegate
       
    51  *      true true true true true true
    40  *      Service ticket has OK-AS-DELEGATE. granted, with info by policy
    52  *      Service ticket has OK-AS-DELEGATE. granted, with info by policy
    41  * @run main/othervm -Dtest.spnego OkAsDelegate false true true false false false
    53  * @run main/othervm -Djdk.net.hosts.file=TestHosts -Dtest.spnego
    42  * @run main/othervm -Dtest.spnego OkAsDelegate true false false false false false
    54  *      OkAsDelegate false true true false false false
    43  * @run main/othervm -Dtest.spnego OkAsDelegate true false true false false false
    55  * @run main/othervm -Djdk.net.hosts.file=TestHosts -Dtest.spnego
    44  * @run main/othervm -Dtest.spnego OkAsDelegate true true false true false true
    56  *      OkAsDelegate true false false false false false
    45  * @run main/othervm -Dtest.spnego OkAsDelegate true true true true false true
    57  * @run main/othervm -Djdk.net.hosts.file=TestHosts -Dtest.spnego
    46  * @run main/othervm -Dtest.spnego -Dtest.kdc.policy.ok-as-delegate OkAsDelegate true false true true true true
    58  *      OkAsDelegate true false true false false false
    47  * @run main/othervm -Dtest.spnego -Dtest.kdc.policy.ok-as-delegate OkAsDelegate true true true true true true
    59  * @run main/othervm -Djdk.net.hosts.file=TestHosts -Dtest.spnego
    48  * @summary Support OK-AS-DELEGATE flag
    60  *      OkAsDelegate true true false true false true
       
    61  * @run main/othervm -Djdk.net.hosts.file=TestHosts -Dtest.spnego
       
    62  *      OkAsDelegate true true true true false true
       
    63  * @run main/othervm -Djdk.net.hosts.file=TestHosts -Dtest.spnego
       
    64  *      -Dtest.kdc.policy.ok-as-delegate OkAsDelegate
       
    65  *      true false true true true true
       
    66  * @run main/othervm -Djdk.net.hosts.file=TestHosts -Dtest.spnego
       
    67  *      -Dtest.kdc.policy.ok-as-delegate OkAsDelegate
       
    68  *      true true true true true true
    49  */
    69  */
    50 import com.sun.security.jgss.ExtendedGSSContext;
    70 import com.sun.security.jgss.ExtendedGSSContext;
    51 import org.ietf.jgss.GSSContext;
    71 import org.ietf.jgss.GSSContext;
    52 import org.ietf.jgss.GSSCredential;
    72 import org.ietf.jgss.GSSCredential;
    53 import org.ietf.jgss.GSSException;
    73 import org.ietf.jgss.GSSException;