Java Code Examples for sun.security.krb5.EncryptedData#ETYPE_DES_CBC_MD4

The following examples show how to use sun.security.krb5.EncryptedData#ETYPE_DES_CBC_MD4 . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: WeakCrypto.java    From openjdk-jdk9 with GNU General Public License v2.0 6 votes vote down vote up
public static void main(String[] args) throws Exception {
    String conf = "[libdefaults]\n" +
            (args.length > 0 ? ("allow_weak_crypto = " + args[0]) : "");
    Files.write(Paths.get("krb5.conf"), conf.getBytes());
    System.setProperty("java.security.krb5.conf", "krb5.conf");

    boolean expected = args.length != 0 && args[0].equals("true");
    int[] etypes = EType.getBuiltInDefaults();

    boolean found = false;
    for (int i=0, length = etypes.length; i<length; i++) {
        if (etypes[i] == EncryptedData.ETYPE_DES_CBC_CRC ||
                etypes[i] == EncryptedData.ETYPE_DES_CBC_MD4 ||
                etypes[i] == EncryptedData.ETYPE_DES_CBC_MD5) {
            found = true;
        }
    }
    if (expected != found) {
        throw new Exception();
    }
}
 
Example 2
Source File: WeakCrypto.java    From jdk8u-dev-jdk with GNU General Public License v2.0 6 votes vote down vote up
public static void main(String[] args) throws Exception {
    String conf = "[libdefaults]\n" +
            (args.length > 0 ? ("allow_weak_crypto = " + args[0]) : "");
    Files.write(Paths.get("krb5.conf"), conf.getBytes());
    System.setProperty("java.security.krb5.conf", "krb5.conf");

    boolean expected = args.length != 0 && args[0].equals("true");
    int[] etypes = EType.getBuiltInDefaults();

    boolean found = false;
    for (int i=0, length = etypes.length; i<length; i++) {
        if (etypes[i] == EncryptedData.ETYPE_DES_CBC_CRC ||
                etypes[i] == EncryptedData.ETYPE_DES_CBC_MD4 ||
                etypes[i] == EncryptedData.ETYPE_DES_CBC_MD5) {
            found = true;
        }
    }
    if (expected != found) {
        throw new Exception();
    }
}
 
Example 3
Source File: WeakCrypto.java    From jdk8u-jdk with GNU General Public License v2.0 6 votes vote down vote up
public static void main(String[] args) throws Exception {
    String conf = "[libdefaults]\n" +
            (args.length > 0 ? ("allow_weak_crypto = " + args[0]) : "");
    Files.write(Paths.get("krb5.conf"), conf.getBytes());
    System.setProperty("java.security.krb5.conf", "krb5.conf");

    boolean expected = args.length != 0 && args[0].equals("true");
    int[] etypes = EType.getBuiltInDefaults();

    boolean found = false;
    for (int i=0, length = etypes.length; i<length; i++) {
        if (etypes[i] == EncryptedData.ETYPE_DES_CBC_CRC ||
                etypes[i] == EncryptedData.ETYPE_DES_CBC_MD4 ||
                etypes[i] == EncryptedData.ETYPE_DES_CBC_MD5) {
            found = true;
        }
    }
    if (expected != found) {
        throw new Exception();
    }
}
 
Example 4
Source File: WeakCrypto.java    From jdk8u_jdk with GNU General Public License v2.0 6 votes vote down vote up
public static void main(String[] args) throws Exception {
    String conf = "[libdefaults]\n" +
            (args.length > 0 ? ("allow_weak_crypto = " + args[0]) : "");
    Files.write(Paths.get("krb5.conf"), conf.getBytes());
    System.setProperty("java.security.krb5.conf", "krb5.conf");

    boolean expected = args.length != 0 && args[0].equals("true");
    int[] etypes = EType.getBuiltInDefaults();

    boolean found = false;
    for (int i=0, length = etypes.length; i<length; i++) {
        if (etypes[i] == EncryptedData.ETYPE_DES_CBC_CRC ||
                etypes[i] == EncryptedData.ETYPE_DES_CBC_MD4 ||
                etypes[i] == EncryptedData.ETYPE_DES_CBC_MD5) {
            found = true;
        }
    }
    if (expected != found) {
        throw new Exception();
    }
}
 
Example 5
Source File: WeakCrypto.java    From openjdk-8 with GNU General Public License v2.0 6 votes vote down vote up
public static void main(String[] args) throws Exception {
    String conf = "[libdefaults]\n" +
            (args.length > 0 ? ("allow_weak_crypto = " + args[0]) : "");
    Files.write(Paths.get("krb5.conf"), conf.getBytes());
    System.setProperty("java.security.krb5.conf", "krb5.conf");

    boolean expected = args.length != 0 && args[0].equals("true");
    int[] etypes = EType.getBuiltInDefaults();

    boolean found = false;
    for (int i=0, length = etypes.length; i<length; i++) {
        if (etypes[i] == EncryptedData.ETYPE_DES_CBC_CRC ||
                etypes[i] == EncryptedData.ETYPE_DES_CBC_MD4 ||
                etypes[i] == EncryptedData.ETYPE_DES_CBC_MD5) {
            found = true;
        }
    }
    if (expected != found) {
        throw new Exception();
    }
}
 
Example 6
Source File: WeakCrypto.java    From openjdk-8-source with GNU General Public License v2.0 6 votes vote down vote up
public static void main(String[] args) throws Exception {
    String conf = "[libdefaults]\n" +
            (args.length > 0 ? ("allow_weak_crypto = " + args[0]) : "");
    Files.write(Paths.get("krb5.conf"), conf.getBytes());
    System.setProperty("java.security.krb5.conf", "krb5.conf");

    boolean expected = args.length != 0 && args[0].equals("true");
    int[] etypes = EType.getBuiltInDefaults();

    boolean found = false;
    for (int i=0, length = etypes.length; i<length; i++) {
        if (etypes[i] == EncryptedData.ETYPE_DES_CBC_CRC ||
                etypes[i] == EncryptedData.ETYPE_DES_CBC_MD4 ||
                etypes[i] == EncryptedData.ETYPE_DES_CBC_MD5) {
            found = true;
        }
    }
    if (expected != found) {
        throw new Exception();
    }
}
 
Example 7
Source File: WeakCrypto.java    From hottub with GNU General Public License v2.0 6 votes vote down vote up
public static void main(String[] args) throws Exception {
    String conf = "[libdefaults]\n" +
            (args.length > 0 ? ("allow_weak_crypto = " + args[0]) : "");
    Files.write(Paths.get("krb5.conf"), conf.getBytes());
    System.setProperty("java.security.krb5.conf", "krb5.conf");

    boolean expected = args.length != 0 && args[0].equals("true");
    int[] etypes = EType.getBuiltInDefaults();

    boolean found = false;
    for (int i=0, length = etypes.length; i<length; i++) {
        if (etypes[i] == EncryptedData.ETYPE_DES_CBC_CRC ||
                etypes[i] == EncryptedData.ETYPE_DES_CBC_MD4 ||
                etypes[i] == EncryptedData.ETYPE_DES_CBC_MD5) {
            found = true;
        }
    }
    if (expected != found) {
        throw new Exception();
    }
}
 
Example 8
Source File: WeakCrypto.java    From jdk8u-jdk with GNU General Public License v2.0 6 votes vote down vote up
public static void main(String[] args) throws Exception {
    String conf = "[libdefaults]\n" +
            (args.length > 0 ? ("allow_weak_crypto = " + args[0]) : "");
    Files.write(Paths.get("krb5.conf"), conf.getBytes());
    System.setProperty("java.security.krb5.conf", "krb5.conf");

    boolean expected = args.length != 0 && args[0].equals("true");
    int[] etypes = EType.getBuiltInDefaults();

    boolean found = false;
    for (int i=0, length = etypes.length; i<length; i++) {
        if (etypes[i] == EncryptedData.ETYPE_DES_CBC_CRC ||
                etypes[i] == EncryptedData.ETYPE_DES_CBC_MD4 ||
                etypes[i] == EncryptedData.ETYPE_DES_CBC_MD5) {
            found = true;
        }
    }
    if (expected != found) {
        throw new Exception();
    }
}
 
Example 9
Source File: WeakCrypto.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 6 votes vote down vote up
public static void main(String[] args) throws Exception {
    String conf = "[libdefaults]\n" +
            (args.length > 0 ? ("allow_weak_crypto = " + args[0]) : "");
    Files.write(Paths.get("krb5.conf"), conf.getBytes());
    System.setProperty("java.security.krb5.conf", "krb5.conf");

    boolean expected = args.length != 0 && args[0].equals("true");
    int[] etypes = EType.getBuiltInDefaults();

    boolean found = false;
    for (int i=0, length = etypes.length; i<length; i++) {
        if (etypes[i] == EncryptedData.ETYPE_DES_CBC_CRC ||
                etypes[i] == EncryptedData.ETYPE_DES_CBC_MD4 ||
                etypes[i] == EncryptedData.ETYPE_DES_CBC_MD5) {
            found = true;
        }
    }
    if (expected != found) {
        throw new Exception();
    }
}
 
Example 10
Source File: WeakCrypto.java    From openjdk-jdk8u with GNU General Public License v2.0 6 votes vote down vote up
public static void main(String[] args) throws Exception {
    String conf = "[libdefaults]\n" +
            (args.length > 0 ? ("allow_weak_crypto = " + args[0]) : "");
    Files.write(Paths.get("krb5.conf"), conf.getBytes());
    System.setProperty("java.security.krb5.conf", "krb5.conf");

    boolean expected = args.length != 0 && args[0].equals("true");
    int[] etypes = EType.getBuiltInDefaults();

    boolean found = false;
    for (int i=0, length = etypes.length; i<length; i++) {
        if (etypes[i] == EncryptedData.ETYPE_DES_CBC_CRC ||
                etypes[i] == EncryptedData.ETYPE_DES_CBC_MD4 ||
                etypes[i] == EncryptedData.ETYPE_DES_CBC_MD5) {
            found = true;
        }
    }
    if (expected != found) {
        throw new Exception();
    }
}
 
Example 11
Source File: WeakCrypto.java    From jdk8u60 with GNU General Public License v2.0 6 votes vote down vote up
public static void main(String[] args) throws Exception {
    String conf = "[libdefaults]\n" +
            (args.length > 0 ? ("allow_weak_crypto = " + args[0]) : "");
    Files.write(Paths.get("krb5.conf"), conf.getBytes());
    System.setProperty("java.security.krb5.conf", "krb5.conf");

    boolean expected = args.length != 0 && args[0].equals("true");
    int[] etypes = EType.getBuiltInDefaults();

    boolean found = false;
    for (int i=0, length = etypes.length; i<length; i++) {
        if (etypes[i] == EncryptedData.ETYPE_DES_CBC_CRC ||
                etypes[i] == EncryptedData.ETYPE_DES_CBC_MD4 ||
                etypes[i] == EncryptedData.ETYPE_DES_CBC_MD5) {
            found = true;
        }
    }
    if (expected != found) {
        throw new Exception();
    }
}
 
Example 12
Source File: WeakCrypto.java    From TencentKona-8 with GNU General Public License v2.0 6 votes vote down vote up
public static void main(String[] args) throws Exception {
    String conf = "[libdefaults]\n" +
            (args.length > 0 ? ("allow_weak_crypto = " + args[0]) : "");
    Files.write(Paths.get("krb5.conf"), conf.getBytes());
    System.setProperty("java.security.krb5.conf", "krb5.conf");

    boolean expected = args.length != 0 && args[0].equals("true");
    int[] etypes = EType.getBuiltInDefaults();

    boolean found = false;
    for (int i=0, length = etypes.length; i<length; i++) {
        if (etypes[i] == EncryptedData.ETYPE_DES_CBC_CRC ||
                etypes[i] == EncryptedData.ETYPE_DES_CBC_MD4 ||
                etypes[i] == EncryptedData.ETYPE_DES_CBC_MD5) {
            found = true;
        }
    }
    if (expected != found) {
        throw new Exception();
    }
}
 
Example 13
Source File: WeakCrypto.java    From dragonwell8_jdk with GNU General Public License v2.0 6 votes vote down vote up
public static void main(String[] args) throws Exception {
    String conf = "[libdefaults]\n" +
            (args.length > 0 ? ("allow_weak_crypto = " + args[0]) : "");
    Files.write(Paths.get("krb5.conf"), conf.getBytes());
    System.setProperty("java.security.krb5.conf", "krb5.conf");

    boolean expected = args.length != 0 && args[0].equals("true");
    int[] etypes = EType.getBuiltInDefaults();

    boolean found = false;
    for (int i=0, length = etypes.length; i<length; i++) {
        if (etypes[i] == EncryptedData.ETYPE_DES_CBC_CRC ||
                etypes[i] == EncryptedData.ETYPE_DES_CBC_MD4 ||
                etypes[i] == EncryptedData.ETYPE_DES_CBC_MD5) {
            found = true;
        }
    }
    if (expected != found) {
        throw new Exception();
    }
}
 
Example 14
Source File: EType.java    From dragonwell8_jdk with GNU General Public License v2.0 3 votes vote down vote up
/**
 * https://tools.ietf.org/html/rfc4120#section-3.1.3:
 *
 *                 A "newer" enctype is any enctype first officially
 * specified concurrently with or subsequent to the issue of this RFC.
 * The enctypes DES, 3DES, or RC4 and any defined in [RFC1510] are not
 * "newer" enctypes.
 *
 * @param eTypeConst the encryption type
 * @return true if "newer"
 */
public static boolean isNewer(int eTypeConst) {
    return eTypeConst != EncryptedData.ETYPE_DES_CBC_CRC &&
            eTypeConst != EncryptedData.ETYPE_DES_CBC_MD4 &&
            eTypeConst != EncryptedData.ETYPE_DES_CBC_MD5 &&
            eTypeConst != EncryptedData.ETYPE_DES3_CBC_HMAC_SHA1_KD &&
            eTypeConst != EncryptedData.ETYPE_ARCFOUR_HMAC &&
            eTypeConst != EncryptedData.ETYPE_ARCFOUR_HMAC_EXP;
}
 
Example 15
Source File: EType.java    From openjdk-jdk8u with GNU General Public License v2.0 3 votes vote down vote up
/**
 * https://tools.ietf.org/html/rfc4120#section-3.1.3:
 *
 *                 A "newer" enctype is any enctype first officially
 * specified concurrently with or subsequent to the issue of this RFC.
 * The enctypes DES, 3DES, or RC4 and any defined in [RFC1510] are not
 * "newer" enctypes.
 *
 * @param eTypeConst the encryption type
 * @return true if "newer"
 */
public static boolean isNewer(int eTypeConst) {
    return eTypeConst != EncryptedData.ETYPE_DES_CBC_CRC &&
            eTypeConst != EncryptedData.ETYPE_DES_CBC_MD4 &&
            eTypeConst != EncryptedData.ETYPE_DES_CBC_MD5 &&
            eTypeConst != EncryptedData.ETYPE_DES3_CBC_HMAC_SHA1_KD &&
            eTypeConst != EncryptedData.ETYPE_ARCFOUR_HMAC &&
            eTypeConst != EncryptedData.ETYPE_ARCFOUR_HMAC_EXP;
}
 
Example 16
Source File: EType.java    From jdk8u_jdk with GNU General Public License v2.0 3 votes vote down vote up
/**
 * https://tools.ietf.org/html/rfc4120#section-3.1.3:
 *
 *                 A "newer" enctype is any enctype first officially
 * specified concurrently with or subsequent to the issue of this RFC.
 * The enctypes DES, 3DES, or RC4 and any defined in [RFC1510] are not
 * "newer" enctypes.
 *
 * @param eTypeConst the encryption type
 * @return true if "newer"
 */
public static boolean isNewer(int eTypeConst) {
    return eTypeConst != EncryptedData.ETYPE_DES_CBC_CRC &&
            eTypeConst != EncryptedData.ETYPE_DES_CBC_MD4 &&
            eTypeConst != EncryptedData.ETYPE_DES_CBC_MD5 &&
            eTypeConst != EncryptedData.ETYPE_DES3_CBC_HMAC_SHA1_KD &&
            eTypeConst != EncryptedData.ETYPE_ARCFOUR_HMAC &&
            eTypeConst != EncryptedData.ETYPE_ARCFOUR_HMAC_EXP;
}
 
Example 17
Source File: EType.java    From TencentKona-8 with GNU General Public License v2.0 3 votes vote down vote up
/**
 * https://tools.ietf.org/html/rfc4120#section-3.1.3:
 *
 *                 A "newer" enctype is any enctype first officially
 * specified concurrently with or subsequent to the issue of this RFC.
 * The enctypes DES, 3DES, or RC4 and any defined in [RFC1510] are not
 * "newer" enctypes.
 *
 * @param eTypeConst the encryption type
 * @return true if "newer"
 */
public static boolean isNewer(int eTypeConst) {
    return eTypeConst != EncryptedData.ETYPE_DES_CBC_CRC &&
            eTypeConst != EncryptedData.ETYPE_DES_CBC_MD4 &&
            eTypeConst != EncryptedData.ETYPE_DES_CBC_MD5 &&
            eTypeConst != EncryptedData.ETYPE_DES3_CBC_HMAC_SHA1_KD &&
            eTypeConst != EncryptedData.ETYPE_ARCFOUR_HMAC &&
            eTypeConst != EncryptedData.ETYPE_ARCFOUR_HMAC_EXP;
}