This is an automated email from the ASF dual-hosted git repository.
remm 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 34a083537b Fix possible NPEs
34a083537b is described below
commit 34a083537ba777f4744784b25444f446222d3a95
Author: remm <[email protected]>
AuthorDate: Wed Sep 13 17:38:23 2023 +0200
Fix possible NPEs
---
.../catalina/valves/rewrite/ResolverImpl.java | 21 ++++++++++++---------
1 file changed, 12 insertions(+), 9 deletions(-)
diff --git a/java/org/apache/catalina/valves/rewrite/ResolverImpl.java
b/java/org/apache/catalina/valves/rewrite/ResolverImpl.java
index ce66f860a7..b6fa2d01cc 100644
--- a/java/org/apache/catalina/valves/rewrite/ResolverImpl.java
+++ b/java/org/apache/catalina/valves/rewrite/ResolverImpl.java
@@ -171,14 +171,16 @@ public class ResolverImpl extends Resolver {
return sslSupport.getCipherSuite();
} else if (key.equals("SSL_CIPHER_EXPORT")) {
String cipherSuite = sslSupport.getCipherSuite();
- Set<Cipher> cipherList =
OpenSSLCipherConfigurationParser.parse(cipherSuite);
- if (cipherList.size() == 1) {
- Cipher cipher = cipherList.iterator().next();
- if (cipher.getLevel().equals(EncryptionLevel.EXP40)
- ||
cipher.getLevel().equals(EncryptionLevel.EXP56)) {
- return "true";
- } else {
- return "false";
+ if (cipherSuite != null) {
+ Set<Cipher> cipherList =
OpenSSLCipherConfigurationParser.parse(cipherSuite);
+ if (cipherList.size() == 1) {
+ Cipher cipher = cipherList.iterator().next();
+ if (cipher.getLevel().equals(EncryptionLevel.EXP40)
+ ||
cipher.getLevel().equals(EncryptionLevel.EXP56)) {
+ return "true";
+ } else {
+ return "false";
+ }
}
}
} else if (key.equals("SSL_CIPHER_ALGKEYSIZE")) {
@@ -189,7 +191,8 @@ public class ResolverImpl extends Resolver {
return String.valueOf(cipher.getAlg_bits());
}
} else if (key.equals("SSL_CIPHER_USEKEYSIZE")) {
- return sslSupport.getKeySize().toString();
+ Integer keySize = sslSupport.getKeySize();
+ return (keySize == null) ? null :
sslSupport.getKeySize().toString();
} else if (key.startsWith("SSL_CLIENT_")) {
X509Certificate[] certificates =
sslSupport.getPeerCertificateChain();
if (certificates != null && certificates.length > 0) {
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]