From 559bf67072bcf7fe854d03aebdfb49e02bd75899 Mon Sep 17 00:00:00 2001
From: DXwangg <wangjiawei80@huawei.com>
Date: Mon, 25 Sep 2023 09:50:38 +0800
Subject: [PATCH] 8295068: SSLEngine throws NPE parsing CertificateRequests

---
 jdk/src/share/classes/sun/security/ssl/CertificateRequest.java | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/jdk/src/share/classes/sun/security/ssl/CertificateRequest.java b/jdk/src/share/classes/sun/security/ssl/CertificateRequest.java
index 475ec42c..ad0325e4 100644
--- a/jdk/src/share/classes/sun/security/ssl/CertificateRequest.java
+++ b/jdk/src/share/classes/sun/security/ssl/CertificateRequest.java
@@ -135,7 +135,7 @@ final class CertificateRequest {
             ArrayList<String> keyTypes = new ArrayList<>(3);
             for (byte id : ids) {
                 ClientCertificateType cct = ClientCertificateType.valueOf(id);
-                if (cct.isAvailable) {
+                if (cct != null && cct.isAvailable) {
                     keyTypes.add(cct.keyAlgorithm);
                 }
             }
-- 
2.39.0

