6 * under the terms of the GNU General Public License version 2 only, as 7 * published by the Free Software Foundation. 8 * 9 * This code is distributed in the hope that it will be useful, but WITHOUT 10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 12 * version 2 for more details (a copy is included in the LICENSE file that 13 * accompanied this code). 14 * 15 * You should have received a copy of the GNU General Public License version 16 * 2 along with this work; if not, write to the Free Software Foundation, 17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 18 * 19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 20 * or visit www.oracle.com if you need additional information or have any 21 * questions. 22 */ 23 /* 24 * @test 25 * @bug 6844909 8012679 26 * @run main/othervm WeakCrypto 27 * @run main/othervm WeakCrypto true 28 * @run main/othervm WeakCrypto false 29 * @summary support allow_weak_crypto in krb5.conf 30 */ 31 32 import java.io.File; 33 import java.lang.Exception; 34 import java.nio.file.Files; 35 import java.nio.file.Paths; 36 37 import sun.security.krb5.internal.crypto.EType; 38 import sun.security.krb5.EncryptedData; 39 40 public class WeakCrypto { 41 public static void main(String[] args) throws Exception { 42 String conf = "[libdefaults]\n" + 43 (args.length > 0 ? ("allow_weak_crypto = " + args[0]) : ""); 44 Files.write(Paths.get("krb5.conf"), conf.getBytes()); 45 System.setProperty("java.security.krb5.conf", "krb5.conf"); | 6 * under the terms of the GNU General Public License version 2 only, as 7 * published by the Free Software Foundation. 8 * 9 * This code is distributed in the hope that it will be useful, but WITHOUT 10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 12 * version 2 for more details (a copy is included in the LICENSE file that 13 * accompanied this code). 14 * 15 * You should have received a copy of the GNU General Public License version 16 * 2 along with this work; if not, write to the Free Software Foundation, 17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 18 * 19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 20 * or visit www.oracle.com if you need additional information or have any 21 * questions. 22 */ 23 /* 24 * @test 25 * @bug 6844909 8012679 26 * @modules java.security.jgss/sun.security.krb5 27 * java.security.jgss/sun.security.krb5.internal.crypto 28 * @run main/othervm WeakCrypto 29 * @run main/othervm WeakCrypto true 30 * @run main/othervm WeakCrypto false 31 * @summary support allow_weak_crypto in krb5.conf 32 */ 33 34 import java.io.File; 35 import java.lang.Exception; 36 import java.nio.file.Files; 37 import java.nio.file.Paths; 38 39 import sun.security.krb5.internal.crypto.EType; 40 import sun.security.krb5.EncryptedData; 41 42 public class WeakCrypto { 43 public static void main(String[] args) throws Exception { 44 String conf = "[libdefaults]\n" + 45 (args.length > 0 ? ("allow_weak_crypto = " + args[0]) : ""); 46 Files.write(Paths.get("krb5.conf"), conf.getBytes()); 47 System.setProperty("java.security.krb5.conf", "krb5.conf"); |