/* * Copyright (c) 2010, 2021, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as * published by the Free Software Foundation. * * This code is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License * version 2 for more details (a copy is included in the LICENSE file that * accompanied this code). * * You should have received a copy of the GNU General Public License version * 2 along with this work; if not, write to the Free Software Foundation, * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. * * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA * or visit www.oracle.com if you need additional information or have any * questions.
*/
/* * @test * @bug 6932525 6951366 6959292 8194486 * @summary kerberos login failure on win2008 with AD set to win2000 compat mode * and cannot login if session key and preauth does not use the same etype * @library /test/lib * @compile -XDignore.symbol.file W83.java * @run main jdk.test.lib.FileInstaller TestHosts TestHosts * @run main/othervm -D6932525 -Djdk.net.hosts.file=TestHosts W83 * @run main/othervm -D6959292 -Djdk.net.hosts.file=TestHosts W83
*/ import com.sun.security.auth.module.Krb5LoginModule; import sun.security.krb5.Config; import sun.security.krb5.EncryptedData; import sun.security.krb5.PrincipalName; import sun.security.krb5.internal.crypto.EType; import sun.security.krb5.internal.ktab.KeyTab;
if (System.getProperty("6932525") != null) { // For 6932525 and 6951366, make sure the etypes sent in 2nd AS-REQ // is not restricted to that of preauth
kdc.setOption(KDC.Option.ONLY_RC4_TGT, true);
} if (System.getProperty("6959292") != null) { // For 6959292, make sure that when etype for enc-part in 2nd AS-REQ // is different from that of preauth, client can still decrypt it
kdc.setOption(KDC.Option.RC4_FIRST_PREAUTH, true);
}
x.go();
}
int p = execute(
cmd, "-J-Djava.security.krb5.conf=" + OneKDC.KRB5_CONF, "-c", "cache1",
OneKDC.USER, new String(OneKDC.PASS)); if (p != 0) {
error.append("kinit password login error\n");
}
p = execute(
cmd, "-J-Djava.security.krb5.conf=" + OneKDC.KRB5_CONF, "-c", "cache2", "-k", "-t", OneKDC.KTAB,
OneKDC.USER); if (p != 0) {
error.append("kinit keytab login error\n");
}
} catch (ClassNotFoundException cnfe) {
System.out.println("No kinit, test ignored."); // Ignore, not on windows
} if (error.length() != 0) { thrownew Exception(error.toString());
}
}
privatestaticint execute(String... args) throws Exception { for (String arg: args) {
System.out.printf("%s ", arg);
}
System.out.println();
Process p = Runtime.getRuntime().exec(args); return p.waitFor();
}
}
Messung V0.5
¤ Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.0.0Bemerkung:
(vorverarbeitet)
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.