Skip to content

Commit 5bcefdf

Browse files
authored
Merge branch 'main' into charan-first-contribution
2 parents b52d802 + 8c4df45 commit 5bcefdf

File tree

53 files changed

+1210
-243
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

53 files changed

+1210
-243
lines changed

.github/workflows/ci-macos.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ jobs:
4545
4646
- name: Upload logs
4747
if: ${{ !cancelled() }}
48-
uses: actions/upload-artifact@v6
48+
uses: actions/upload-artifact@v7
4949
with:
5050
name: JDK25-macos-latest-logs
5151
path: |

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ jobs:
6464

6565
- name: Upload logs
6666
if: ${{ !cancelled() }}
67-
uses: actions/upload-artifact@v6
67+
uses: actions/upload-artifact@v7
6868
with:
6969
name: JDK${{ matrix.java }}-${{ matrix.os }}-logs
7070
path: |

README.md

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -48,11 +48,11 @@ The most up-to-date documentation for each version can be found at:
4848

4949
### Installation
5050

51-
Please see [RUNNING.txt](RUNNING.txt) for more info.
51+
Please see [RUNNING.txt](RUNNING.txt) for more information.
5252

5353
### Licensing
5454

55-
Please see [LICENSE](LICENSE) for more info.
55+
Please see [LICENSE](LICENSE) for more information.
5656

5757
### Support and Mailing List Information
5858

@@ -74,5 +74,4 @@ instructions for reporting a bug
7474

7575
### Contributing
7676

77-
For information on how to contribute to Apache Tomcat, please see
78-
[CONTRIBUTING.md](CONTRIBUTING.md).
77+
Please see [CONTRIBUTING](CONTRIBUTING.md) for more information.

build.properties.default

Lines changed: 16 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -144,30 +144,26 @@ base-maven.loc=https://repo.maven.apache.org/maven2
144144
# ----- Eclipse JDT, version 4.7 or later -----#
145145
# See https://cwiki.apache.org/confluence/display/TOMCAT/Managing+Tomcat%27s+Dependency+on+the+Eclipse+JDT+Core+Batch+Compiler
146146
#
147-
# Checksum is from "SHA512 Checksums for 4.38" link at
148-
# https://download.eclipse.org/eclipse/downloads/drops4/R-4.38-202512010920/
149-
# https://download.eclipse.org/eclipse/downloads/drops4/R-4.38-202512010920/checksum/eclipse-4.38-SUMSSHA512
150-
#
151-
jdt.version=4.38
152-
jdt.release=R-4.38-202512010920
147+
jdt.version=4.39
148+
jdt.release=R-4.39-202602260420
153149
jdt.checksum.enabled=true
154150
jdt.checksum.algorithm=SHA-512
155-
jdt.checksum.value=41d5cea69f9bdc75eee3b5e89bf29ae9cbfe8de9f1ccdc94ea9364c182463bc4003fdee19b23c17b9ddc7c8950f4d196bb4cf3d8a5c2d1af56a769905385e906
151+
jdt.checksum.value=af25493d4a429fd24256f69a085a618afffe23bb09b284976fb9e82f651715a0455b704ee800432b43dd409f74874765089cd65fc148e2175d251f9ef830ce0a
156152
jdt.home=${base.path}/ecj-${jdt.version}
157153
jdt.jar=${jdt.home}/ecj-${jdt.version}.jar
158154
# The download will be moved to the archive area eventually. We are taking care of that in advance.
159155
jdt.loc.1=https://archive.eclipse.org/eclipse/downloads/drops4/${jdt.release}/ecj-${jdt.version}.jar
160156
jdt.loc.2=https://download.eclipse.org/eclipse/downloads/drops4/${jdt.release}/ecj-${jdt.version}.jar
161157

162158
# ----- Tomcat native library -----
163-
tomcat-native.version=2.0.12
164-
tomcat-native-openssl.version=3.5.4
159+
tomcat-native.version=2.0.14
160+
tomcat-native-openssl.version=3.5.5
165161
tomcat-native.src.checksum.enabled=true
166162
tomcat-native.src.checksum.algorithm=SHA-512
167-
tomcat-native.src.checksum.value=d937e04f7c9f0fa6ef82b32928fa2d59dbdac45cb58c7ba8eff4338fbd942297b1c9512a0a8ff80cf758d9b6ca5cc5cba8cefdc91507318b72afc56888aa1f3c
163+
tomcat-native.src.checksum.value=33d626fab35cbfa7398ca90cabd99950c6362ab4e19637012850fd84ecc78184e4c6c975ece92dc8d6461b6a8c2f83221cbc7374ff154422e7722606a4a144c7
168164
tomcat-native.win.checksum.enabled=true
169165
tomcat-native.win.checksum.algorithm=SHA-512
170-
tomcat-native.win.checksum.value=f743c151a1d48a1967c08f01986b1a30176cc8a388ad760cb8aac19e6956e5630d7ddff54782c2e136e8f247809d573fd48a31ed1a756923a3ad0954e2d4a3fe
166+
tomcat-native.win.checksum.value=82c46733be9f84f11bcbf97cc1db3b9c9b861c32f30b9dee3fb3ebe1d400325587eb6b77c384622515583d455f170017201cfac62498f0a0886211839bdfa56f
171167
tomcat-native.home=${base.path}/tomcat-native-${tomcat-native.version}
172168
tomcat-native.tar.gz=${tomcat-native.home}/tomcat-native.tar.gz
173169
tomcat-native.loc.1=${base-tomcat.loc.1}/tomcat-connectors/native/${tomcat-native.version}/source/tomcat-native-${tomcat-native.version}-src.tar.gz
@@ -245,19 +241,19 @@ easymock.jar=${easymock.home}/easymock-${easymock.version}.jar
245241
easymock.loc=${base-maven.loc}/org/easymock/easymock/${easymock.version}/easymock-${easymock.version}.jar
246242

247243
# ----- objenesis, used by EasyMock, version 3.3 or later -----
248-
objenesis.version=3.4
244+
objenesis.version=3.5
249245
objenesis.checksum.enabled=true
250-
objenesis.checksum.algorithm=MD5|SHA-1
251-
objenesis.checksum.value=51242320cb2bb25a3f36e2e21fa87de0|675cbe121a68019235d27f6c34b4f0ac30e07418
246+
objenesis.checksum.algorithm=SHA-512
247+
objenesis.checksum.value=7587fabe1dd4a639e869e4478a097665d34686de8c1ec5794356a5ebc27501fdad42a365e0f000bdf30b0b0f73d6c02523346fc6cfb9109239e5b2f7876e981e
252248
objenesis.home=${base.path}/objenesis-${objenesis.version}
253249
objenesis.jar=${objenesis.home}/objenesis-${objenesis.version}.jar
254250
objenesis.loc=${base-maven.loc}/org/objenesis/objenesis/${objenesis.version}/objenesis-${objenesis.version}.jar
255251

256252
# ----- byte-buddy, used by EasyMock, version 1.12.18 or later -----
257-
bytebuddy.version=1.18.3
253+
bytebuddy.version=1.18.7
258254
bytebuddy.checksum.enabled=true
259255
bytebuddy.checksum.algorithm=SHA-512
260-
bytebuddy.checksum.value=8f35c806a25d9089a08d12a7aaf22c5bea2f356c432a21655f30a7935918b6385e1e080180b6ef5ad3638796fc3a7243220dfec08c31c1195416e6790fd797af
256+
bytebuddy.checksum.value=23333645a93afb4d0246a20c133cfac1b029e51c9b3fd6558ac75c455689f44de63e4fee3fc6a467312cfcc56aa29a76a2bb6deb2fdcf7a8033ebef18edbc888
261257
bytebuddy.home=${base.path}/byte-buddy-${bytebuddy.version}
262258
bytebuddy.jar=${bytebuddy.home}/byte-buddy-${bytebuddy.version}.jar
263259
bytebuddy.loc=${base-maven.loc}/net/bytebuddy/byte-buddy/${bytebuddy.version}/byte-buddy-${bytebuddy.version}.jar
@@ -272,10 +268,10 @@ unboundid.jar=${unboundid.home}/unboundid-ldapsdk-${unboundid.version}.jar
272268
unboundid.loc=${base-maven.loc}/com/unboundid/unboundid-ldapsdk/${unboundid.version}/unboundid-ldapsdk-${unboundid.version}.jar
273269

274270
# ----- Checkstyle, version 6.16 or later -----
275-
checkstyle.version=13.0.0
271+
checkstyle.version=13.3.0
276272
checkstyle.checksum.enabled=true
277273
checkstyle.checksum.algorithm=SHA-512
278-
checkstyle.checksum.value=95e2955274996a9f0811014bdf1e50f3f2496d2f398ef1674015286a8abcfb1c0d540406695b5a3af6b7b5dce02dafa50d854f021401ae0d78287233ba8afa3d
274+
checkstyle.checksum.value=4ed499d509f5cbd40c351da291a281d5c34d0f01811237efdabb29c6273c7a10cf823ce2428ac03b049978100b448ff628b0cb9468adc78beb84f26750deb29e
279275
checkstyle.home=${base.path}/checkstyle-${checkstyle.version}
280276
checkstyle.jar=${checkstyle.home}/checkstyle-${checkstyle.version}-all.jar
281277
checkstyle.loc=${base-gh.loc}/checkstyle/checkstyle/releases/download/checkstyle-${checkstyle.version}/checkstyle-${checkstyle.version}-all.jar
@@ -300,10 +296,10 @@ spotbugs.loc=${base-maven.loc}/com/github/spotbugs/spotbugs/${spotbugs.version}/
300296

301297
# ----- bnd, version 6.3.0 or later -----
302298
# ----- provides OSGI metadata for JARs -----
303-
bnd.version=7.2.0
299+
bnd.version=7.2.1
304300
bnd.checksum.enabled=true
305301
bnd.checksum.algorithm=MD5|SHA-1
306-
bnd.checksum.value=dea22b7afa9de21e1adb27d2e835a94c|af26ddc466eb178963d4eb800d2824f488037aec
302+
bnd.checksum.value=7c316ab40b78515251efd71bc68837ca|d18f9e95f252e2e4d9237f478e1e6f21117f97d2
307303

308304
bnd.home=${base.path}/bnd-${bnd.version}
309305
bnd.jar=${bnd.home}/biz.aQute.bnd-${bnd.version}.jar

java/org/apache/catalina/core/AprLifecycleListener.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ public class AprLifecycleListener implements LifecycleListener {
7272
protected static final int TCN_REQUIRED_PATCH = 12;
7373
protected static final int TCN_RECOMMENDED_MAJOR = 2;
7474
protected static final int TCN_RECOMMENDED_MINOR = 0;
75-
protected static final int TCN_RECOMMENDED_PV = 12;
75+
protected static final int TCN_RECOMMENDED_PV = 14;
7676

7777

7878
// ---------------------------------------------- Properties

java/org/apache/catalina/core/LocalStrings_fr.properties

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -269,7 +269,9 @@ standardHost.noContext=Aucun contexte n'est configuré pour traiter cette requê
269269
standardHost.notContext=Le fils d'un hôte (child of a Host) doit être un contexte
270270
standardHost.nullName=Le nom d'hôte est requis
271271
standardHost.problematicAppBase=Utiliser une chaîne vide pour l''appBase de l''hôte [{0}] la fera correspondre à CATALINA_BASE, ce qui causera des problèmes
272+
standardHost.problematicAppBaseParent=appBase de l''hôte [{0}] est un parent du répertoire CATALINA_BASE, ce qui est mauvais
272273
standardHost.problematicLegacyAppBase=L''utilisation d''une chaîne vide pour legacyAppBase de l''hôte [{0}] le fixera à CATALINA_BASE, ce qui n''est pas judicieux
274+
standardHost.problematicLegacyAppBaseParent=legacyAppBase de l''hôte [{0}] est un parent du répertoire CATALINA_BASE, ce qui est mauvais
273275

274276
standardHostValve.customStatusFailed=La page d''erreur personnalisée [{0}] n''a pu être redirigée correctement
275277
standardHostValve.exception=Exception lors du traitement de [{0}]

java/org/apache/catalina/tribes/group/interceptors/EncryptInterceptor.java

Lines changed: 50 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
import java.security.NoSuchProviderException;
2323
import java.security.SecureRandom;
2424
import java.security.spec.AlgorithmParameterSpec;
25+
import java.util.Locale;
2526
import java.util.concurrent.ConcurrentLinkedQueue;
2627

2728
import javax.crypto.Cipher;
@@ -42,7 +43,6 @@
4243
import org.apache.juli.logging.Log;
4344
import org.apache.juli.logging.LogFactory;
4445

45-
4646
/**
4747
* Adds encryption using a pre-shared key. The length of the key (in bytes) must be acceptable for the encryption
4848
* algorithm being used. For example, for AES, you must use a key of either 16 bytes (128 bits, 24 bytes 192 bits), or
@@ -54,7 +54,7 @@ public class EncryptInterceptor extends ChannelInterceptorBase implements Encryp
5454
private static final Log log = LogFactory.getLog(EncryptInterceptor.class);
5555
protected static final StringManager sm = StringManager.getManager(EncryptInterceptor.class);
5656

57-
private static final String DEFAULT_ENCRYPTION_ALGORITHM = "AES/CBC/PKCS5Padding";
57+
private static final String DEFAULT_ENCRYPTION_ALGORITHM = "AES/GCM/NoPadding";
5858

5959
private String providerName;
6060
private String encryptionAlgorithm = DEFAULT_ENCRYPTION_ALGORITHM;
@@ -140,17 +140,17 @@ public void messageReceived(ChannelMessage msg) {
140140
xbb.clear();
141141
xbb.append(data, 0, data.length);
142142

143-
super.messageReceived(msg);
144143
} catch (GeneralSecurityException gse) {
145144
log.error(sm.getString("encryptInterceptor.decrypt.failed"), gse);
146145
}
146+
super.messageReceived(msg);
147147
}
148148

149149
/**
150150
* Sets the encryption algorithm to be used for encrypting and decrypting channel messages. You must specify the
151151
* <code>algorithm/mode/padding</code>. Information on standard algorithm names may be found in the
152152
* <a href="https://docs.oracle.com/javase/8/docs/technotes/guides/security/StandardNames.html">Java
153-
* documentation</a>. Default is <code>AES/CBC/PKCS5Padding</code>.
153+
* documentation</a>. Default is <code>AES/GCM/NoPadding</code>.
154154
*
155155
* @param algorithm The algorithm to use.
156156
*/
@@ -314,33 +314,68 @@ private static BaseEncryptionManager createEncryptionManager(String algorithm, b
314314

315315
String algorithmName;
316316
String algorithmMode;
317+
String algorithmPadding;
317318

318-
// We need to break-apart the algorithm name e.g. AES/CBC/PKCS5Padding
319+
// We need to break-apart the algorithm name e.g. AES/GCM/NoPadding
319320
// take just the algorithm part.
320321
int pos = algorithm.indexOf('/');
321322

322323
if (pos >= 0) {
323-
algorithmName = algorithm.substring(0, pos);
324+
algorithmName = algorithm.substring(0, pos).toUpperCase(Locale.ENGLISH);
324325
int pos2 = algorithm.indexOf('/', pos + 1);
325326

326327
if (pos2 >= 0) {
327-
algorithmMode = algorithm.substring(pos + 1, pos2);
328+
algorithmMode = algorithm.substring(pos + 1, pos2).toUpperCase(Locale.ENGLISH);
329+
algorithmPadding = algorithm.substring(pos2 + 1).toUpperCase(Locale.ENGLISH);
328330
} else {
329-
algorithmMode = "CBC";
331+
algorithmMode = "GCM";
332+
algorithmPadding = "NOPADDING";
330333
}
331334
} else {
332335
algorithmName = algorithm;
333-
algorithmMode = "CBC";
336+
algorithmMode = "GCM";
337+
algorithmPadding = "NOPADDING";
334338
}
335339

336-
if ("GCM".equalsIgnoreCase(algorithmMode)) {
340+
/*
341+
* Limit the cipher algorithm modes available. The limits are based on the cipher algorithm modes listed in the
342+
* Java Standard Names documentation. Those modes that are not appropriate or provide no protection are blocked.
343+
* Where there are performance or security concerns regarding a mode, a warning is logged. Unrecognised modes,
344+
* such as those provided by custom JCA providers are allowed but will be rejected if there is no JCA provider
345+
* to support them.
346+
*/
347+
if ("NONE".equals(algorithmMode) || "ECB".equals(algorithmMode) || "PCBC".equals(algorithmMode) ||
348+
"CTS".equals(algorithmMode) || "KW".equals(algorithmMode) || "KWP".equals(algorithmMode) ||
349+
"CTR".equals(algorithmMode) ||
350+
("CBC".equals(algorithmMode) && "NOPADDING".equals(algorithmPadding)) ||
351+
("CFB".equals(algorithmMode) && "NOPADDING".equals(algorithmPadding)) ||
352+
("GCM".equals(algorithmMode) && "PKCS5PADDING".equals(algorithmPadding)) ||
353+
("OFB".equals(algorithmMode) && "NOPADDING".equals(algorithmPadding))) {
354+
// Insecure, unsuitable or unsupported
355+
throw new IllegalArgumentException(sm.getString("encryptInterceptor.algorithm.unsupported", algorithm));
356+
357+
} else if (("CBC".equals(algorithmMode) && "PKCS5PADDING".equals(algorithmPadding)) ||
358+
("CFB".equals(algorithmMode) && "PKCS5PADDING".equals(algorithmPadding)) ||
359+
("OFB".equals(algorithmMode) && "PKCS5PADDING".equals(algorithmPadding))) {
360+
// Supported but not recommended as more secure modes are available
361+
log.warn(sm.getString("encryptInterceptor.algorithm.switch", algorithm));
362+
363+
} else if (algorithmMode.startsWith("CFB") || algorithmMode.startsWith("OFB")) {
364+
// Using a non-default block size. Not supported as insecure and/or inefficient.
365+
throw new IllegalArgumentException(
366+
sm.getString("encryptInterceptor.algorithm.unsupported", algorithm));
367+
368+
} else if ("GCM".equalsIgnoreCase(algorithmMode) && "NOPADDING".equals(algorithmPadding)) {
369+
// Needs a specialised encryption manager to handle the differences between GCM and other modes
337370
return new GCMEncryptionManager(algorithm, new SecretKeySpec(encryptionKey, algorithmName), providerName);
338-
} else if ("CBC".equalsIgnoreCase(algorithmMode) || "OFB".equalsIgnoreCase(algorithmMode) ||
339-
"CFB".equalsIgnoreCase(algorithmMode)) {
371+
}
372+
373+
// Use the default encryption manager
374+
try {
340375
return new BaseEncryptionManager(algorithm, new SecretKeySpec(encryptionKey, algorithmName), providerName);
341-
} else {
342-
throw new IllegalArgumentException(
343-
sm.getString("encryptInterceptor.algorithm.unsupported-mode", algorithmMode));
376+
} catch (NoSuchAlgorithmException | NoSuchPaddingException | NoSuchProviderException ex) {
377+
throw new IllegalArgumentException(sm.getString("encryptInterceptor.algorithm.unsupported", algorithmMode),
378+
ex);
344379
}
345380
}
346381

java/org/apache/catalina/tribes/group/interceptors/LocalStrings.properties

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,9 @@
1616
domainFilterInterceptor.member.refused=Member [{0}] was refused to join cluster
1717
domainFilterInterceptor.message.refused=Received message from cluster[{0}] was refused.
1818

19-
encryptInterceptor.algorithm.required=Encryption algorithm is required, fully-specified e.g. AES/CBC/PKCS5Padding
20-
encryptInterceptor.algorithm.unsupported-mode=EncryptInterceptor does not support block cipher mode [{0}]
19+
encryptInterceptor.algorithm.required=Encryption algorithm is required, fully-specified e.g. AES/GCM/NoPadding
20+
encryptInterceptor.algorithm.switch=The EncryptInterceptor is using the algorithm [{0}]. It is recommended to switch to using AES/GCM/NoPadding.
21+
encryptInterceptor.algorithm.unsupported=EncryptInterceptor does not support algorithm [{0}]
2122
encryptInterceptor.decrypt.error.short-message=Failed to decrypt message: premature end-of-message
2223
encryptInterceptor.decrypt.failed=Failed to decrypt message
2324
encryptInterceptor.encrypt.failed=Failed to encrypt message

java/org/apache/catalina/tribes/group/interceptors/LocalStrings_fr.properties

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ domainFilterInterceptor.member.refused=Le membre [{0}] a été refusé dans le c
2020
domainFilterInterceptor.message.refused=Le message reçu du cluster [{0}] a été refusé
2121

2222
encryptInterceptor.algorithm.required=Un algorithme de cryptage est requis, avec une spécification complète telle que AES/CBC/PKCS5Padding
23-
encryptInterceptor.algorithm.unsupported-mode=L''EncryptInterceptor ne supporte pas le mode de chiffrage de bloc [{0}]
2423
encryptInterceptor.decrypt.error.short-message=Echec du décryptage du message : fin de message prématuré
2524
encryptInterceptor.decrypt.failed=Echec de décryptage du message
2625
encryptInterceptor.encrypt.failed=Erreur de cryptage du message

java/org/apache/catalina/tribes/group/interceptors/LocalStrings_ja.properties

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ domainFilterInterceptor.member.refused=メンバーはクラスター [{0}] へ
2020
domainFilterInterceptor.message.refused=クラスター [{0}] から受信したメッセージは拒否されました。
2121

2222
encryptInterceptor.algorithm.required=暗号化アルゴリズムが必要です。完全指定。 AES/CBC/PKCS5Padding
23-
encryptInterceptor.algorithm.unsupported-mode=EncryptInterceptorはブロック暗号モード [{0}]をサポートしていません。
2423
encryptInterceptor.decrypt.error.short-message=メッセージの復号に失敗: メッセージの末尾が途切れています
2524
encryptInterceptor.decrypt.failed=メッセージの復号に失敗しました。
2625
encryptInterceptor.encrypt.failed=メッセージを暗号化できません。

0 commit comments

Comments
 (0)