Skip to content

Commit

Permalink
Updated "CipherSuitesConverter" to make it public. (#11656)
Browse files Browse the repository at this point in the history
Motivation:
While using netty there is sometimes need to handle the cipher suites and
signature algorithm in more strict environment. CipherSuiteConverter is
quite helpful in converting Cipher-Suites to and from java to openSSL.
Making it public would be helpful for the project which are using netty.

Modification:
Updated "CipherSuitesConverter" to make it public.
updated "CipherSuitesConverter.toOpenssl" to public.
updated "CipherSuitesConverter.toJava" to public.

Result:
Fixes #11655
  • Loading branch information
kushalagrawal committed Sep 6, 2021
1 parent 21fb48e commit a329857
Showing 1 changed file with 5 additions and 3 deletions.
Expand Up @@ -17,6 +17,7 @@
package io.netty.handler.ssl;

import io.netty.util.internal.PlatformDependent;
import io.netty.util.internal.UnstableApi;
import io.netty.util.internal.logging.InternalLogger;
import io.netty.util.internal.logging.InternalLoggerFactory;

Expand All @@ -34,7 +35,8 @@
*
* @see <a href="https://en.wikipedia.org/wiki/Cipher_suite">Wikipedia page about cipher suite</a>
*/
final class CipherSuiteConverter {
@UnstableApi
public final class CipherSuiteConverter {

private static final InternalLogger logger = InternalLoggerFactory.getInstance(CipherSuiteConverter.class);

Expand Down Expand Up @@ -150,7 +152,7 @@ static boolean isO2JCached(String key, String protocol, String value) {
*
* @return {@code null} if the conversion has failed
*/
static String toOpenSsl(String javaCipherSuite, boolean boringSSL) {
public static String toOpenSsl(String javaCipherSuite, boolean boringSSL) {
String converted = j2o.get(javaCipherSuite);
if (converted != null) {
return converted;
Expand Down Expand Up @@ -279,7 +281,7 @@ private static String toOpenSslHmacAlgo(String hmacAlgo) {
* @param protocol The cryptographic protocol (i.e. SSL, TLS, ...).
* @return The translated cipher suite name according to java conventions. This will not be {@code null}.
*/
static String toJava(String openSslCipherSuite, String protocol) {
public static String toJava(String openSslCipherSuite, String protocol) {
Map<String, String> p2j = o2j.get(openSslCipherSuite);
if (p2j == null) {
p2j = cacheFromOpenSsl(openSslCipherSuite);
Expand Down

0 comments on commit a329857

Please sign in to comment.