File tree Expand file tree Collapse file tree 2 files changed +28
-0
lines changed
tls/src/main/java/org/bouncycastle/tls/crypto/impl/jcajce Expand file tree Collapse file tree 2 files changed +28
-0
lines changed Original file line number Diff line number Diff line change @@ -1162,6 +1162,7 @@ protected Boolean isSupportedNamedGroup(int namedGroup)
11621162 else if (NamedGroup .refersToASpecificKem (namedGroup ))
11631163 {
11641164 // TODO[tls-kem] When implemented via provider, need to check for support dynamically
1165+ // return Boolean.valueOf(KemUtil.isKemSupported(this, NamedGroup.getKemName(namedGroup)));
11651166 return Boolean .TRUE ;
11661167 }
11671168 else if (NamedGroup .refersToAnECDSACurve (namedGroup ))
Original file line number Diff line number Diff line change 1+ package org .bouncycastle .tls .crypto .impl .jcajce ;
2+
3+ import javax .crypto .Cipher ;
4+
5+ class KemUtil
6+ {
7+ static Cipher getCipher (JcaTlsCrypto crypto , String kemName )
8+ {
9+ try
10+ {
11+ return crypto .getHelper ().createCipher (kemName );
12+ }
13+ catch (AssertionError e )
14+ {
15+ return null ;
16+ }
17+ catch (Exception e )
18+ {
19+ return null ;
20+ }
21+ }
22+
23+ static boolean isKemSupported (JcaTlsCrypto crypto , String kemName )
24+ {
25+ return kemName != null && getCipher (crypto , kemName ) != null ;
26+ }
27+ }
You can’t perform that action at this time.
0 commit comments