Skip to content

Commit a3bc14a

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

File tree

1 file changed

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

1 file changed

+68
-68
lines changed

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

Lines changed: 68 additions & 68 deletions
Original file line numberDiff line numberDiff line change
@@ -568,98 +568,98 @@ void putEntries() {
568568
psA("AlgorithmParameters", "ChaCha20-Poly1305",
569569
"com.sun.crypto.provider.ChaCha20Poly1305Parameters", null);
570570

571-
if (!systemFipsEnabled) {
572-
/*
573-
* Key factories
574-
*/
575-
psA("KeyFactory", "DiffieHellman",
576-
"com.sun.crypto.provider.DHKeyFactory",
577-
null);
571+
/*
572+
* Key factories
573+
*/
574+
psA("KeyFactory", "DiffieHellman",
575+
"com.sun.crypto.provider.DHKeyFactory",
576+
null);
578577

579-
/*
580-
* Secret-key factories
581-
*/
582-
ps("SecretKeyFactory", "DES",
583-
"com.sun.crypto.provider.DESKeyFactory");
578+
/*
579+
* Secret-key factories
580+
*/
581+
ps("SecretKeyFactory", "DES",
582+
"com.sun.crypto.provider.DESKeyFactory");
584583

585-
psA("SecretKeyFactory", "DESede",
586-
"com.sun.crypto.provider.DESedeKeyFactory", null);
584+
psA("SecretKeyFactory", "DESede",
585+
"com.sun.crypto.provider.DESedeKeyFactory", null);
587586

588-
psA("SecretKeyFactory", "PBEWithMD5AndDES",
589-
"com.sun.crypto.provider.PBEKeyFactory$PBEWithMD5AndDES",
590-
null);
587+
psA("SecretKeyFactory", "PBEWithMD5AndDES",
588+
"com.sun.crypto.provider.PBEKeyFactory$PBEWithMD5AndDES",
589+
null);
591590

592-
/*
593-
* Internal in-house crypto algorithm used for
594-
* the JCEKS keystore type. Since this was developed
595-
* internally, there isn't an OID corresponding to this
596-
* algorithm.
597-
*/
598-
ps("SecretKeyFactory", "PBEWithMD5AndTripleDES",
599-
"com.sun.crypto.provider.PBEKeyFactory$PBEWithMD5AndTripleDES");
591+
/*
592+
* Internal in-house crypto algorithm used for
593+
* the JCEKS keystore type. Since this was developed
594+
* internally, there isn't an OID corresponding to this
595+
* algorithm.
596+
*/
597+
ps("SecretKeyFactory", "PBEWithMD5AndTripleDES",
598+
"com.sun.crypto.provider.PBEKeyFactory$PBEWithMD5AndTripleDES");
600599

601-
psA("SecretKeyFactory", "PBEWithSHA1AndDESede",
602-
"com.sun.crypto.provider.PBEKeyFactory$PBEWithSHA1AndDESede",
603-
null);
600+
psA("SecretKeyFactory", "PBEWithSHA1AndDESede",
601+
"com.sun.crypto.provider.PBEKeyFactory$PBEWithSHA1AndDESede",
602+
null);
604603

605-
psA("SecretKeyFactory", "PBEWithSHA1AndRC2_40",
606-
"com.sun.crypto.provider.PBEKeyFactory$PBEWithSHA1AndRC2_40",
607-
null);
604+
psA("SecretKeyFactory", "PBEWithSHA1AndRC2_40",
605+
"com.sun.crypto.provider.PBEKeyFactory$PBEWithSHA1AndRC2_40",
606+
null);
608607

609-
psA("SecretKeyFactory", "PBEWithSHA1AndRC2_128",
610-
"com.sun.crypto.provider.PBEKeyFactory$PBEWithSHA1AndRC2_128",
611-
null);
608+
psA("SecretKeyFactory", "PBEWithSHA1AndRC2_128",
609+
"com.sun.crypto.provider.PBEKeyFactory$PBEWithSHA1AndRC2_128",
610+
null);
612611

613-
psA("SecretKeyFactory", "PBEWithSHA1AndRC4_40",
614-
"com.sun.crypto.provider.PBEKeyFactory$PBEWithSHA1AndRC4_40",
615-
null);
612+
psA("SecretKeyFactory", "PBEWithSHA1AndRC4_40",
613+
"com.sun.crypto.provider.PBEKeyFactory$PBEWithSHA1AndRC4_40",
614+
null);
616615

617-
psA("SecretKeyFactory", "PBEWithSHA1AndRC4_128",
618-
"com.sun.crypto.provider.PBEKeyFactory$PBEWithSHA1AndRC4_128",
619-
null);
616+
psA("SecretKeyFactory", "PBEWithSHA1AndRC4_128",
617+
"com.sun.crypto.provider.PBEKeyFactory$PBEWithSHA1AndRC4_128",
618+
null);
620619

621-
ps("SecretKeyFactory", "PBEWithHmacSHA1AndAES_128",
622-
"com.sun.crypto.provider.PBEKeyFactory$PBEWithHmacSHA1AndAES_128");
620+
ps("SecretKeyFactory", "PBEWithHmacSHA1AndAES_128",
621+
"com.sun.crypto.provider.PBEKeyFactory$PBEWithHmacSHA1AndAES_128");
623622

624-
ps("SecretKeyFactory", "PBEWithHmacSHA224AndAES_128",
625-
"com.sun.crypto.provider.PBEKeyFactory$PBEWithHmacSHA224AndAES_128");
623+
ps("SecretKeyFactory", "PBEWithHmacSHA224AndAES_128",
624+
"com.sun.crypto.provider.PBEKeyFactory$PBEWithHmacSHA224AndAES_128");
626625

627-
ps("SecretKeyFactory", "PBEWithHmacSHA256AndAES_128",
628-
"com.sun.crypto.provider.PBEKeyFactory$PBEWithHmacSHA256AndAES_128");
626+
ps("SecretKeyFactory", "PBEWithHmacSHA256AndAES_128",
627+
"com.sun.crypto.provider.PBEKeyFactory$PBEWithHmacSHA256AndAES_128");
629628

630-
ps("SecretKeyFactory", "PBEWithHmacSHA384AndAES_128",
631-
"com.sun.crypto.provider.PBEKeyFactory$PBEWithHmacSHA384AndAES_128");
629+
ps("SecretKeyFactory", "PBEWithHmacSHA384AndAES_128",
630+
"com.sun.crypto.provider.PBEKeyFactory$PBEWithHmacSHA384AndAES_128");
632631

633-
ps("SecretKeyFactory", "PBEWithHmacSHA512AndAES_128",
634-
"com.sun.crypto.provider.PBEKeyFactory$PBEWithHmacSHA512AndAES_128");
632+
ps("SecretKeyFactory", "PBEWithHmacSHA512AndAES_128",
633+
"com.sun.crypto.provider.PBEKeyFactory$PBEWithHmacSHA512AndAES_128");
635634

636-
ps("SecretKeyFactory", "PBEWithHmacSHA512/224AndAES_128",
637-
"com.sun.crypto.provider.PBEKeyFactory$PBEWithHmacSHA512_224AndAES_128");
635+
ps("SecretKeyFactory", "PBEWithHmacSHA512/224AndAES_128",
636+
"com.sun.crypto.provider.PBEKeyFactory$PBEWithHmacSHA512_224AndAES_128");
638637

639-
ps("SecretKeyFactory", "PBEWithHmacSHA512/256AndAES_128",
640-
"com.sun.crypto.provider.PBEKeyFactory$PBEWithHmacSHA512_256AndAES_128");
638+
ps("SecretKeyFactory", "PBEWithHmacSHA512/256AndAES_128",
639+
"com.sun.crypto.provider.PBEKeyFactory$PBEWithHmacSHA512_256AndAES_128");
641640

642-
ps("SecretKeyFactory", "PBEWithHmacSHA1AndAES_256",
643-
"com.sun.crypto.provider.PBEKeyFactory$PBEWithHmacSHA1AndAES_256");
641+
ps("SecretKeyFactory", "PBEWithHmacSHA1AndAES_256",
642+
"com.sun.crypto.provider.PBEKeyFactory$PBEWithHmacSHA1AndAES_256");
644643

645-
ps("SecretKeyFactory", "PBEWithHmacSHA224AndAES_256",
646-
"com.sun.crypto.provider.PBEKeyFactory$PBEWithHmacSHA224AndAES_256");
644+
ps("SecretKeyFactory", "PBEWithHmacSHA224AndAES_256",
645+
"com.sun.crypto.provider.PBEKeyFactory$PBEWithHmacSHA224AndAES_256");
647646

648-
ps("SecretKeyFactory", "PBEWithHmacSHA256AndAES_256",
649-
"com.sun.crypto.provider.PBEKeyFactory$PBEWithHmacSHA256AndAES_256");
647+
ps("SecretKeyFactory", "PBEWithHmacSHA256AndAES_256",
648+
"com.sun.crypto.provider.PBEKeyFactory$PBEWithHmacSHA256AndAES_256");
650649

651-
ps("SecretKeyFactory", "PBEWithHmacSHA384AndAES_256",
652-
"com.sun.crypto.provider.PBEKeyFactory$PBEWithHmacSHA384AndAES_256");
650+
ps("SecretKeyFactory", "PBEWithHmacSHA384AndAES_256",
651+
"com.sun.crypto.provider.PBEKeyFactory$PBEWithHmacSHA384AndAES_256");
653652

654-
ps("SecretKeyFactory", "PBEWithHmacSHA512AndAES_256",
655-
"com.sun.crypto.provider.PBEKeyFactory$PBEWithHmacSHA512AndAES_256");
653+
ps("SecretKeyFactory", "PBEWithHmacSHA512AndAES_256",
654+
"com.sun.crypto.provider.PBEKeyFactory$PBEWithHmacSHA512AndAES_256");
656655

657-
ps("SecretKeyFactory", "PBEWithHmacSHA512/224AndAES_256",
658-
"com.sun.crypto.provider.PBEKeyFactory$PBEWithHmacSHA512_224AndAES_256");
656+
ps("SecretKeyFactory", "PBEWithHmacSHA512/224AndAES_256",
657+
"com.sun.crypto.provider.PBEKeyFactory$PBEWithHmacSHA512_224AndAES_256");
659658

660-
ps("SecretKeyFactory", "PBEWithHmacSHA512/256AndAES_256",
661-
"com.sun.crypto.provider.PBEKeyFactory$PBEWithHmacSHA512_256AndAES_256");
659+
ps("SecretKeyFactory", "PBEWithHmacSHA512/256AndAES_256",
660+
"com.sun.crypto.provider.PBEKeyFactory$PBEWithHmacSHA512_256AndAES_256");
662661

662+
if (!systemFipsEnabled) {
663663
// PBKDF2
664664
psA("SecretKeyFactory", "PBKDF2WithHmacSHA1",
665665
"com.sun.crypto.provider.PBKDF2Core$HmacSHA1",

0 commit comments

Comments
 (0)