diff --git a/src/jdk.crypto.cryptoki/share/classes/sun/security/pkcs11/P11SecretKeyFactory.java b/src/jdk.crypto.cryptoki/share/classes/sun/security/pkcs11/P11SecretKeyFactory.java index 7f8dbc067f88a..7edc7f2bc50a2 100644 --- a/src/jdk.crypto.cryptoki/share/classes/sun/security/pkcs11/P11SecretKeyFactory.java +++ b/src/jdk.crypto.cryptoki/share/classes/sun/security/pkcs11/P11SecretKeyFactory.java @@ -247,11 +247,11 @@ static final class P12MacPBEKeyInfo extends PBEKeyInfo { putKeyInfo(new HMACKeyInfo("SslMacMD5", CKM_SSL3_MD5_MAC, 128)); putKeyInfo(new HMACKeyInfo("SslMacSHA1", CKM_SSL3_SHA1_MAC, 160)); - putKeyInfo(new HKDFKeyInfo("HKDFWithHmacSHA1", hmacSHA1)); - putKeyInfo(new HKDFKeyInfo("HKDFWithHmacSHA224", hmacSHA224)); - putKeyInfo(new HKDFKeyInfo("HKDFWithHmacSHA256", hmacSHA256)); - putKeyInfo(new HKDFKeyInfo("HKDFWithHmacSHA384", hmacSHA384)); - putKeyInfo(new HKDFKeyInfo("HKDFWithHmacSHA512", hmacSHA512)); + putKeyInfo(new HKDFKeyInfo("HKDF-SHA1", hmacSHA1)); + putKeyInfo(new HKDFKeyInfo("HKDF-SHA224", hmacSHA224)); + putKeyInfo(new HKDFKeyInfo("HKDF-SHA256", hmacSHA256)); + putKeyInfo(new HKDFKeyInfo("HKDF-SHA384", hmacSHA384)); + putKeyInfo(new HKDFKeyInfo("HKDF-SHA512", hmacSHA512)); putKeyInfo(new AESPBEKeyInfo("PBEWithHmacSHA1AndAES_128", CKP_PKCS5_PBKD2_HMAC_SHA1, 128)); diff --git a/src/jdk.crypto.cryptoki/share/classes/sun/security/pkcs11/SunPKCS11.java b/src/jdk.crypto.cryptoki/share/classes/sun/security/pkcs11/SunPKCS11.java index ce29c94ad641d..d55fe999e2711 100644 --- a/src/jdk.crypto.cryptoki/share/classes/sun/security/pkcs11/SunPKCS11.java +++ b/src/jdk.crypto.cryptoki/share/classes/sun/security/pkcs11/SunPKCS11.java @@ -1080,15 +1080,15 @@ private static void register(Descriptor d) { d(KG, "SunTls12Prf", "sun.security.pkcs11.P11TlsPrfGenerator", m(CKM_TLS_MAC)); - d(KDF, "HKDFWithHmacSHA1", P11KDF, m(CKM_SHA_1_HMAC), + d(KDF, "HKDF-SHA1", P11KDF, m(CKM_SHA_1_HMAC), m(CKM_HKDF_DERIVE, CKM_HKDF_DATA)); - d(KDF, "HKDFWithHmacSHA224", P11KDF, m(CKM_SHA224_HMAC), + d(KDF, "HKDF-SHA224", P11KDF, m(CKM_SHA224_HMAC), m(CKM_HKDF_DERIVE, CKM_HKDF_DATA)); - d(KDF, "HKDFWithHmacSHA256", P11KDF, m(CKM_SHA256_HMAC), + d(KDF, "HKDF-SHA256", P11KDF, m(CKM_SHA256_HMAC), m(CKM_HKDF_DERIVE, CKM_HKDF_DATA)); - d(KDF, "HKDFWithHmacSHA384", P11KDF, m(CKM_SHA384_HMAC), + d(KDF, "HKDF-SHA384", P11KDF, m(CKM_SHA384_HMAC), m(CKM_HKDF_DERIVE, CKM_HKDF_DATA)); - d(KDF, "HKDFWithHmacSHA512", P11KDF, m(CKM_SHA512_HMAC), + d(KDF, "HKDF-SHA512", P11KDF, m(CKM_SHA512_HMAC), m(CKM_HKDF_DERIVE, CKM_HKDF_DATA)); } diff --git a/test/jdk/sun/security/pkcs11/KDF/TestHKDF.java b/test/jdk/sun/security/pkcs11/KDF/TestHKDF.java index 996e722c5e4e0..98879c5efb33b 100644 --- a/test/jdk/sun/security/pkcs11/KDF/TestHKDF.java +++ b/test/jdk/sun/security/pkcs11/KDF/TestHKDF.java @@ -424,7 +424,7 @@ private static SecretKey getTlsPremasterSecretWithECDHExchange(String s, private static void test_RFC_5869_case_1() { executeTest("RFC 5869 - Test Case 1", - "HKDFWithHmacSHA256", + "HKDF-SHA256", "Generic", "0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b", "000102030405060708090a0b0c", @@ -439,7 +439,7 @@ private static void test_RFC_5869_case_1() { private static void test_RFC_5869_case_2() { executeTest("RFC 5869 - Test Case 2", - "HKDFWithHmacSHA256", + "HKDF-SHA256", "Generic", "000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d" + "1e1f202122232425262728292a2b2c2d2e2f303132333435363738393a3b" + @@ -461,7 +461,7 @@ private static void test_RFC_5869_case_2() { private static void test_RFC_5869_case_3() { executeTest("RFC 5869 - Test Case 3", - "HKDFWithHmacSHA256", + "HKDF-SHA256", "Generic", "0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b", null, @@ -476,7 +476,7 @@ private static void test_RFC_5869_case_3() { private static void test_RFC_5869_case_4() { executeTest("RFC 5869 - Test Case 4", - "HKDFWithHmacSHA1", + "HKDF-SHA1", "Generic", "0b0b0b0b0b0b0b0b0b0b0b", "000102030405060708090a0b0c", @@ -490,7 +490,7 @@ private static void test_RFC_5869_case_4() { private static void test_RFC_5869_case_5() { executeTest("RFC 5869 - Test Case 5", - "HKDFWithHmacSHA1", + "HKDF-SHA1", "Generic", "000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d" + "1e1f202122232425262728292a2b2c2d2e2f303132333435363738393a3b" + @@ -511,7 +511,7 @@ private static void test_RFC_5869_case_5() { private static void test_RFC_5869_case_6() { executeTest("RFC 5869 - Test Case 6", - "HKDFWithHmacSHA1", + "HKDF-SHA1", "Generic", "0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b", null, @@ -525,7 +525,7 @@ private static void test_RFC_5869_case_6() { private static void test_RFC_5869_case_7() { executeTest("RFC 5869 - Test Case 7", - "HKDFWithHmacSHA1", + "HKDF-SHA1", "Generic", "0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c", "0000000000000000000000000000000000000000", @@ -538,8 +538,8 @@ private static void test_RFC_5869_case_7() { } private static void test_AES_HKDFWithHmacSHA1() { - executeTest("AES - HKDFWithHmacSHA1", - "HKDFWithHmacSHA1", + executeTest("AES - HKDF-SHA1", + "HKDF-SHA1", "AES", "000102030405060708090a0b0c0d0e0f", "101112131415161718191a1b1c1d1e1f", @@ -552,8 +552,8 @@ private static void test_AES_HKDFWithHmacSHA1() { } private static void test_AES_HKDFWithHmacSHA224() { - executeTest("AES - HKDFWithHmacSHA224", - "HKDFWithHmacSHA224", + executeTest("AES - HKDF-SHA224", + "HKDF-SHA224", "AES", "000102030405060708090a0b0c0d0e0f", "101112131415161718191a1b1c1d1e1f", @@ -566,8 +566,8 @@ private static void test_AES_HKDFWithHmacSHA224() { } private static void test_AES_HKDFWithHmacSHA256() { - executeTest("AES - HKDFWithHmacSHA256", - "HKDFWithHmacSHA256", + executeTest("AES - HKDF-SHA256", + "HKDF-SHA256", "AES", "000102030405060708090a0b0c0d0e0f", "101112131415161718191a1b1c1d1e1f", @@ -581,8 +581,8 @@ private static void test_AES_HKDFWithHmacSHA256() { } private static void test_AES_HKDFWithHmacSHA384() { - executeTest("AES - HKDFWithHmacSHA384", - "HKDFWithHmacSHA384", + executeTest("AES - HKDF-SHA384", + "HKDF-SHA384", "AES", "000102030405060708090a0b0c0d0e0f", "101112131415161718191a1b1c1d1e1f", @@ -596,8 +596,8 @@ private static void test_AES_HKDFWithHmacSHA384() { } private static void test_AES_HKDFWithHmacSHA512() { - executeTest("AES - HKDFWithHmacSHA512", - "HKDFWithHmacSHA512", + executeTest("AES - HKDF-SHA512", + "HKDF-SHA512", "AES", "000102030405060708090a0b0c0d0e0f", "101112131415161718191a1b1c1d1e1f", @@ -634,8 +634,8 @@ private static void test_HKDF_after_DH_HkdfSHA256() throws Exception { "1015728e5a8aacaa68ffffffffffffffff", "02" ); - executeTest("Test HKDFWithHmacSHA256 after DH exchange (TLS)", - "HKDFWithHmacSHA256", + executeTest("Test HKDF-SHA256 after DH exchange (TLS)", + "HKDF-SHA256", "Generic", tlsPremasterSecret, null, @@ -656,8 +656,8 @@ private static void test_HKDF_after_ECDH_HkdfSHA256() throws Exception { "34333070929362623", "531080873930420952237875954830357399317339863932672261700603" + "26242234504331049"); - executeTest("Test HKDFWithHmacSHA256 after ECDH exchange (TLS)", - "HKDFWithHmacSHA256", + executeTest("Test HKDF-SHA256 after ECDH exchange (TLS)", + "HKDF-SHA256", "Generic", tlsPremasterSecret, null,