From a329857ec20cc1b93ceead6307c6849f93b3f101 Mon Sep 17 00:00:00 2001 From: kushalagrawal Date: Mon, 6 Sep 2021 18:27:19 +0530 Subject: [PATCH] Updated "CipherSuitesConverter" to make it public. (#11656) 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 --- .../java/io/netty/handler/ssl/CipherSuiteConverter.java | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/handler/src/main/java/io/netty/handler/ssl/CipherSuiteConverter.java b/handler/src/main/java/io/netty/handler/ssl/CipherSuiteConverter.java index 2dd81371adb..a9ac8307c1d 100644 --- a/handler/src/main/java/io/netty/handler/ssl/CipherSuiteConverter.java +++ b/handler/src/main/java/io/netty/handler/ssl/CipherSuiteConverter.java @@ -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; @@ -34,7 +35,8 @@ * * @see Wikipedia page about cipher suite */ -final class CipherSuiteConverter { +@UnstableApi +public final class CipherSuiteConverter { private static final InternalLogger logger = InternalLoggerFactory.getInstance(CipherSuiteConverter.class); @@ -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; @@ -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 p2j = o2j.get(openSslCipherSuite); if (p2j == null) { p2j = cacheFromOpenSsl(openSslCipherSuite);