File tree Expand file tree Collapse file tree 2 files changed +25
-19
lines changed
tls/src/main/java/org/bouncycastle/tls/crypto/impl/jcajce Expand file tree Collapse file tree 2 files changed +25
-19
lines changed Original file line number Diff line number Diff line change @@ -447,19 +447,7 @@ else if (NamedGroup.refersToASpecificFiniteField(namedGroup))
447447 }
448448 else if (NamedGroup .refersToASpecificKem (namedGroup ))
449449 {
450- switch (namedGroup )
451- {
452- /*
453- * TODO[tls-kem] Return AlgorithmParameters to check against disabled algorithms?
454- */
455- case NamedGroup .OQS_mlkem512 :
456- case NamedGroup .OQS_mlkem768 :
457- case NamedGroup .OQS_mlkem1024 :
458- case NamedGroup .MLKEM512 :
459- case NamedGroup .MLKEM768 :
460- case NamedGroup .MLKEM1024 :
461- return null ;
462- }
450+ return KemUtil .getAlgorithmParameters (this , NamedGroup .getKemName (namedGroup ));
463451 }
464452
465453 throw new IllegalArgumentException ("NamedGroup not supported: " + NamedGroup .getText (namedGroup ));
@@ -1161,9 +1149,7 @@ protected Boolean isSupportedNamedGroup(int namedGroup)
11611149 }
11621150 else if (NamedGroup .refersToASpecificKem (namedGroup ))
11631151 {
1164- // TODO[tls-kem] When implemented via provider, need to check for support dynamically
1165- // return Boolean.valueOf(KemUtil.isKemSupported(this, NamedGroup.getKemName(namedGroup)));
1166- return Boolean .TRUE ;
1152+ return Boolean .valueOf (KemUtil .isKemSupported (this , NamedGroup .getKemName (namedGroup )));
11671153 }
11681154 else if (NamedGroup .refersToAnECDSACurve (namedGroup ))
11691155 {
Original file line number Diff line number Diff line change 11package org .bouncycastle .tls .crypto .impl .jcajce ;
22
3+ import java .security .AlgorithmParameters ;
4+
35import javax .crypto .Cipher ;
46
57class KemUtil
68{
9+ static AlgorithmParameters getAlgorithmParameters (JcaTlsCrypto crypto , String kemName )
10+ {
11+ try
12+ {
13+ // TODO[tls-kem] Return AlgorithmParameters to check against disabled algorithms?
14+ }
15+ catch (AssertionError e )
16+ {
17+ }
18+ catch (Exception e )
19+ {
20+ }
21+
22+ return null ;
23+ }
24+
725 static Cipher getCipher (JcaTlsCrypto crypto , String kemName )
826 {
927 try
@@ -12,16 +30,18 @@ static Cipher getCipher(JcaTlsCrypto crypto, String kemName)
1230 }
1331 catch (AssertionError e )
1432 {
15- return null ;
1633 }
1734 catch (Exception e )
1835 {
19- return null ;
2036 }
37+
38+ return null ;
2139 }
2240
2341 static boolean isKemSupported (JcaTlsCrypto crypto , String kemName )
2442 {
25- return kemName != null && getCipher (crypto , kemName ) != null ;
43+ // TODO[tls-kem] When implemented via provider, need to check for support dynamically
44+ // return kemName != null && getCipher(crypto, kemName) != null;
45+ return true ;
2646 }
2747}
You can’t perform that action at this time.
0 commit comments