You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by jf...@apache.org on 2022/05/25 16:55:38 UTC

[tomcat] 01/01: Fix BZ 66089

This is an automated email from the ASF dual-hosted git repository.

jfclere pushed a commit to branch jfclere-patch-1
in repository https://gitbox.apache.org/repos/asf/tomcat.git

commit 0ca5bf9616891ac4fa6ce30cd17f323bdb5079a1
Author: Jean-Frederic Clere <jf...@gmail.com>
AuthorDate: Wed May 25 18:55:28 2022 +0200

    Fix BZ 66089
    
    Sorry encrypted RSA PRIVATE KEY need null password
---
 java/org/apache/tomcat/util/net/jsse/PEMFile.java | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/java/org/apache/tomcat/util/net/jsse/PEMFile.java b/java/org/apache/tomcat/util/net/jsse/PEMFile.java
index 80c585d3b8..5397012b3f 100644
--- a/java/org/apache/tomcat/util/net/jsse/PEMFile.java
+++ b/java/org/apache/tomcat/util/net/jsse/PEMFile.java
@@ -143,7 +143,10 @@ public class PEMFile {
                     privateKey = part.toPrivateKey(password, keyAlgorithm, Format.PKCS8);
                     break;
                 case Part.RSA_PRIVATE_KEY:
-                    privateKey = part.toPrivateKey(password, keyAlgorithm, Format.PKCS1);
+                    if (part.algorithm != null)
+                        privateKey = part.toPrivateKey(password, keyAlgorithm, Format.PKCS1);
+                    else
+                        privateKey = part.toPrivateKey(null, keyAlgorithm, Format.PKCS1);
                     break;
                 case Part.CERTIFICATE:
                 case Part.X509_CERTIFICATE:


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org