From f0bc2e5cf6bcce46d1b09ef9a0b5c497ce60a3bf Mon Sep 17 00:00:00 2001 From: "Endi S. Dewata" Date: Sun, 19 Mar 2017 20:23:23 +0100 Subject: Added support for hex cipher IDs in pki.conf. The CryptoUtil.setSSLCipher() has been modified to support ciphers specified using hex ID. --- base/util/src/com/netscape/cmsutil/crypto/CryptoUtil.java | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'base/util/src/com') diff --git a/base/util/src/com/netscape/cmsutil/crypto/CryptoUtil.java b/base/util/src/com/netscape/cmsutil/crypto/CryptoUtil.java index fd7b1bb23..5e6659363 100644 --- a/base/util/src/com/netscape/cmsutil/crypto/CryptoUtil.java +++ b/base/util/src/com/netscape/cmsutil/crypto/CryptoUtil.java @@ -961,9 +961,15 @@ public class CryptoUtil { public static void setSSLCipher(String cipher, boolean enabled) throws SocketException { - Integer cipherID = cipherMap.get(cipher); - if (cipherID == null) { - throw new SocketException("Unsupported cipher: " + cipher); + Integer cipherID; + if (cipher.toLowerCase().startsWith("0x")) { + cipherID = Integer.parseInt(cipher.substring(2), 16); + + } else { + cipherID = cipherMap.get(cipher); + if (cipherID == null) { + throw new SocketException("Unsupported cipher: " + cipher); + } } SSLSocket.setCipherPreferenceDefault(cipherID, enabled); -- cgit