You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by li...@apache.org on 2023/10/25 01:54:10 UTC

[tomcat] branch main updated: Correct exception message.

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

lihan pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/tomcat.git


The following commit(s) were added to refs/heads/main by this push:
     new 76ac8d1b55 Correct exception message.
76ac8d1b55 is described below

commit 76ac8d1b55ba5c2ca08827d793bcf6e20d6c9e4e
Author: lihan <li...@apache.org>
AuthorDate: Wed Oct 25 09:53:56 2023 +0800

    Correct exception message.
---
 java/org/apache/tomcat/util/net/jsse/PEMFile.java | 2 +-
 1 file changed, 1 insertion(+), 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 b051c539ea..b3f60ce0db 100644
--- a/java/org/apache/tomcat/util/net/jsse/PEMFile.java
+++ b/java/org/apache/tomcat/util/net/jsse/PEMFile.java
@@ -406,7 +406,7 @@ public class PEMFile {
                     byte[] oidPRF = p.parseOIDAsBytes();
                     String prf = OID_TO_PRF.get(HexUtils.toHexString(oidPRF));
                     if (prf == null) {
-                        throw new NoSuchAlgorithmException(sm.getString("pemFile.unknownPrfAlgorithm", prf));
+                        throw new NoSuchAlgorithmException(sm.getString("pemFile.unknownPrfAlgorithm", HexUtils.toHexString(oidPRF)));
                     }
                     p.parseNull();
 


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


Re: [tomcat] branch main updated: Correct exception message.

Posted by Michael Osipov <mi...@apache.org>.
Reported: https://bz.apache.org/bugzilla/show_bug.cgi?id=67926

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


Re: [tomcat] branch main updated: Correct exception message.

Posted by Michael Osipov <mi...@apache.org>.
On 2023/10/25 01:54:10 lihan@apache.org wrote:
> This is an automated email from the ASF dual-hosted git repository.
> 
> lihan pushed a commit to branch main
> in repository https://gitbox.apache.org/repos/asf/tomcat.git
> 
> 
> The following commit(s) were added to refs/heads/main by this push:
>      new 76ac8d1b55 Correct exception message.
> 76ac8d1b55 is described below
> 
> commit 76ac8d1b55ba5c2ca08827d793bcf6e20d6c9e4e
> Author: lihan <li...@apache.org>
> AuthorDate: Wed Oct 25 09:53:56 2023 +0800
> 
>     Correct exception message.
> ---
>  java/org/apache/tomcat/util/net/jsse/PEMFile.java | 2 +-
>  1 file changed, 1 insertion(+), 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 b051c539ea..b3f60ce0db 100644
> --- a/java/org/apache/tomcat/util/net/jsse/PEMFile.java
> +++ b/java/org/apache/tomcat/util/net/jsse/PEMFile.java
> @@ -406,7 +406,7 @@ public class PEMFile {
>                      byte[] oidPRF = p.parseOIDAsBytes();
>                      String prf = OID_TO_PRF.get(HexUtils.toHexString(oidPRF));
>                      if (prf == null) {
> -                        throw new NoSuchAlgorithmException(sm.getString("pemFile.unknownPrfAlgorithm", prf));
> +                        throw new NoSuchAlgorithmException(sm.getString("pemFile.unknownPrfAlgorithm", HexUtils.toHexString(oidPRF)));
>                      }
>                      p.parseNull();

Looking at this change I must say the parameters to these bundle keys aren't helpful:
pemFile.unknownEncryptionAlgorithm
pemFile.unknownPkcs8Algorithm
pemFile.notPbkdf2
pemFile.unknownPrfAlgorithm

They all print the raw ASN.1 bytes as hex for the OID in question instead of the well-known dotted representation. That output cannot be read by people.

Since we don't know the OID ahead of time, we need to covert it for logging: https://learn.microsoft.com/en-us/windows/win32/seccertenroll/about-object-identifier?redirectedfrom=MSDN

I will file a BZ issue for this.

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