Skip to content

Commit 356bde4

Browse files
franferraxgnu-andrew
authored andcommitted
RH2092507: P11Key.getEncoded does not work for DH keys in FIPS mode (openjdk#16)
Reviewed-by: @gnu-andrew
1 parent a601814 commit 356bde4

File tree

1 file changed

+60
-60
lines changed
  • src/java.base/share/classes/com/sun/crypto/provider

1 file changed

+60
-60
lines changed

src/java.base/share/classes/com/sun/crypto/provider/SunJCE.java

Lines changed: 60 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -540,86 +540,86 @@ void putEntries() {
540540
psA("AlgorithmParameters", "ChaCha20-Poly1305",
541541
"com.sun.crypto.provider.ChaCha20Poly1305Parameters", null);
542542

543-
if (!systemFipsEnabled) {
544-
/*
545-
* Key factories
546-
*/
547-
psA("KeyFactory", "DiffieHellman",
548-
"com.sun.crypto.provider.DHKeyFactory",
549-
null);
543+
/*
544+
* Key factories
545+
*/
546+
psA("KeyFactory", "DiffieHellman",
547+
"com.sun.crypto.provider.DHKeyFactory",
548+
null);
550549

551-
/*
552-
* Secret-key factories
553-
*/
554-
ps("SecretKeyFactory", "DES",
555-
"com.sun.crypto.provider.DESKeyFactory");
550+
/*
551+
* Secret-key factories
552+
*/
553+
ps("SecretKeyFactory", "DES",
554+
"com.sun.crypto.provider.DESKeyFactory");
556555

557-
psA("SecretKeyFactory", "DESede",
558-
"com.sun.crypto.provider.DESedeKeyFactory", null);
556+
psA("SecretKeyFactory", "DESede",
557+
"com.sun.crypto.provider.DESedeKeyFactory", null);
559558

560-
psA("SecretKeyFactory", "PBEWithMD5AndDES",
561-
"com.sun.crypto.provider.PBEKeyFactory$PBEWithMD5AndDES",
562-
null);
559+
psA("SecretKeyFactory", "PBEWithMD5AndDES",
560+
"com.sun.crypto.provider.PBEKeyFactory$PBEWithMD5AndDES",
561+
null);
563562

564-
/*
565-
* Internal in-house crypto algorithm used for
566-
* the JCEKS keystore type. Since this was developed
567-
* internally, there isn't an OID corresponding to this
568-
* algorithm.
569-
*/
570-
ps("SecretKeyFactory", "PBEWithMD5AndTripleDES",
571-
"com.sun.crypto.provider.PBEKeyFactory$PBEWithMD5AndTripleDES");
563+
/*
564+
* Internal in-house crypto algorithm used for
565+
* the JCEKS keystore type. Since this was developed
566+
* internally, there isn't an OID corresponding to this
567+
* algorithm.
568+
*/
569+
ps("SecretKeyFactory", "PBEWithMD5AndTripleDES",
570+
"com.sun.crypto.provider.PBEKeyFactory$PBEWithMD5AndTripleDES");
572571

573-
psA("SecretKeyFactory", "PBEWithSHA1AndDESede",
574-
"com.sun.crypto.provider.PBEKeyFactory$PBEWithSHA1AndDESede",
575-
null);
572+
psA("SecretKeyFactory", "PBEWithSHA1AndDESede",
573+
"com.sun.crypto.provider.PBEKeyFactory$PBEWithSHA1AndDESede",
574+
null);
576575

577-
psA("SecretKeyFactory", "PBEWithSHA1AndRC2_40",
578-
"com.sun.crypto.provider.PBEKeyFactory$PBEWithSHA1AndRC2_40",
579-
null);
576+
psA("SecretKeyFactory", "PBEWithSHA1AndRC2_40",
577+
"com.sun.crypto.provider.PBEKeyFactory$PBEWithSHA1AndRC2_40",
578+
null);
580579

581-
psA("SecretKeyFactory", "PBEWithSHA1AndRC2_128",
582-
"com.sun.crypto.provider.PBEKeyFactory$PBEWithSHA1AndRC2_128",
583-
null);
580+
psA("SecretKeyFactory", "PBEWithSHA1AndRC2_128",
581+
"com.sun.crypto.provider.PBEKeyFactory$PBEWithSHA1AndRC2_128",
582+
null);
584583

585-
psA("SecretKeyFactory", "PBEWithSHA1AndRC4_40",
586-
"com.sun.crypto.provider.PBEKeyFactory$PBEWithSHA1AndRC4_40",
587-
null);
584+
psA("SecretKeyFactory", "PBEWithSHA1AndRC4_40",
585+
"com.sun.crypto.provider.PBEKeyFactory$PBEWithSHA1AndRC4_40",
586+
null);
588587

589-
psA("SecretKeyFactory", "PBEWithSHA1AndRC4_128",
590-
"com.sun.crypto.provider.PBEKeyFactory$PBEWithSHA1AndRC4_128",
591-
null);
588+
psA("SecretKeyFactory", "PBEWithSHA1AndRC4_128",
589+
"com.sun.crypto.provider.PBEKeyFactory$PBEWithSHA1AndRC4_128",
590+
null);
592591

593-
ps("SecretKeyFactory", "PBEWithHmacSHA1AndAES_128",
594-
"com.sun.crypto.provider.PBEKeyFactory$PBEWithHmacSHA1AndAES_128");
592+
ps("SecretKeyFactory", "PBEWithHmacSHA1AndAES_128",
593+
"com.sun.crypto.provider.PBEKeyFactory$PBEWithHmacSHA1AndAES_128");
595594

596-
ps("SecretKeyFactory", "PBEWithHmacSHA224AndAES_128",
597-
"com.sun.crypto.provider.PBEKeyFactory$PBEWithHmacSHA224AndAES_128");
595+
ps("SecretKeyFactory", "PBEWithHmacSHA224AndAES_128",
596+
"com.sun.crypto.provider.PBEKeyFactory$PBEWithHmacSHA224AndAES_128");
598597

599-
ps("SecretKeyFactory", "PBEWithHmacSHA256AndAES_128",
600-
"com.sun.crypto.provider.PBEKeyFactory$PBEWithHmacSHA256AndAES_128");
598+
ps("SecretKeyFactory", "PBEWithHmacSHA256AndAES_128",
599+
"com.sun.crypto.provider.PBEKeyFactory$PBEWithHmacSHA256AndAES_128");
601600

602-
ps("SecretKeyFactory", "PBEWithHmacSHA384AndAES_128",
603-
"com.sun.crypto.provider.PBEKeyFactory$PBEWithHmacSHA384AndAES_128");
601+
ps("SecretKeyFactory", "PBEWithHmacSHA384AndAES_128",
602+
"com.sun.crypto.provider.PBEKeyFactory$PBEWithHmacSHA384AndAES_128");
604603

605-
ps("SecretKeyFactory", "PBEWithHmacSHA512AndAES_128",
606-
"com.sun.crypto.provider.PBEKeyFactory$PBEWithHmacSHA512AndAES_128");
604+
ps("SecretKeyFactory", "PBEWithHmacSHA512AndAES_128",
605+
"com.sun.crypto.provider.PBEKeyFactory$PBEWithHmacSHA512AndAES_128");
607606

608-
ps("SecretKeyFactory", "PBEWithHmacSHA1AndAES_256",
609-
"com.sun.crypto.provider.PBEKeyFactory$PBEWithHmacSHA1AndAES_256");
607+
ps("SecretKeyFactory", "PBEWithHmacSHA1AndAES_256",
608+
"com.sun.crypto.provider.PBEKeyFactory$PBEWithHmacSHA1AndAES_256");
610609

611-
ps("SecretKeyFactory", "PBEWithHmacSHA224AndAES_256",
612-
"com.sun.crypto.provider.PBEKeyFactory$PBEWithHmacSHA224AndAES_256");
610+
ps("SecretKeyFactory", "PBEWithHmacSHA224AndAES_256",
611+
"com.sun.crypto.provider.PBEKeyFactory$PBEWithHmacSHA224AndAES_256");
613612

614-
ps("SecretKeyFactory", "PBEWithHmacSHA256AndAES_256",
615-
"com.sun.crypto.provider.PBEKeyFactory$PBEWithHmacSHA256AndAES_256");
613+
ps("SecretKeyFactory", "PBEWithHmacSHA256AndAES_256",
614+
"com.sun.crypto.provider.PBEKeyFactory$PBEWithHmacSHA256AndAES_256");
616615

617-
ps("SecretKeyFactory", "PBEWithHmacSHA384AndAES_256",
618-
"com.sun.crypto.provider.PBEKeyFactory$PBEWithHmacSHA384AndAES_256");
616+
ps("SecretKeyFactory", "PBEWithHmacSHA384AndAES_256",
617+
"com.sun.crypto.provider.PBEKeyFactory$PBEWithHmacSHA384AndAES_256");
619618

620-
ps("SecretKeyFactory", "PBEWithHmacSHA512AndAES_256",
621-
"com.sun.crypto.provider.PBEKeyFactory$PBEWithHmacSHA512AndAES_256");
619+
ps("SecretKeyFactory", "PBEWithHmacSHA512AndAES_256",
620+
"com.sun.crypto.provider.PBEKeyFactory$PBEWithHmacSHA512AndAES_256");
622621

622+
if (!systemFipsEnabled) {
623623
// PBKDF2
624624
psA("SecretKeyFactory", "PBKDF2WithHmacSHA1",
625625
"com.sun.crypto.provider.PBKDF2Core$HmacSHA1",

0 commit comments

Comments
 (0)