1943N/A/*
3882N/A * Copyright (c) 2009, 2011, Oracle and/or its affiliates. All rights reserved.
1943N/A * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
1943N/A *
1943N/A * This code is free software; you can redistribute it and/or modify it
1943N/A * under the terms of the GNU General Public License version 2 only, as
1943N/A * published by the Free Software Foundation.
1943N/A *
1943N/A * This code is distributed in the hope that it will be useful, but WITHOUT
1943N/A * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
1943N/A * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
1943N/A * version 2 for more details (a copy is included in the LICENSE file that
1943N/A * accompanied this code).
1943N/A *
1943N/A * You should have received a copy of the GNU General Public License version
1943N/A * 2 along with this work; if not, write to the Free Software Foundation,
1943N/A * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
1943N/A *
2362N/A * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
2362N/A * or visit www.oracle.com if you need additional information or have any
2362N/A * questions.
1943N/A */
1943N/A
1943N/A/*
1943N/A * @test
1943N/A * @bug 6770883
3882N/A * @run main/othervm NoSpnegoAsDefMech
1943N/A * @summary Infinite loop if SPNEGO specified as sun.security.jgss.mechanism
1943N/A */
1943N/A
1943N/Aimport org.ietf.jgss.*;
1943N/Aimport sun.security.jgss.*;
1943N/A
1943N/Apublic class NoSpnegoAsDefMech {
1943N/A
1943N/A public static void main(String[] argv) throws Exception {
1943N/A System.setProperty("sun.security.jgss.mechanism", GSSUtil.GSS_SPNEGO_MECH_OID.toString());
1943N/A try {
5361N/A GSSManager.getInstance().createName("service@localhost", GSSName.NT_HOSTBASED_SERVICE, new Oid("1.3.6.1.5.5.2"));
1943N/A } catch (GSSException e) {
1943N/A // This is OK, for example, krb5.conf is missing or other problems
1943N/A }
1943N/A }
1943N/A}