You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cxf.apache.org by re...@apache.org on 2022/06/12 15:40:42 UTC
[cxf] 01/02: Fixing CryptoUtilsTest & CryptoUtils: RSA key size change from 2048 to 3072 bits in JDK-19
This is an automated email from the ASF dual-hosted git repository.
reta pushed a commit to branch 3.6.x-fixes
in repository https://gitbox.apache.org/repos/asf/cxf.git
commit 8c348a6138035882657a37b738e13b755fbe231f
Author: Andriy Redko <dr...@gmail.com>
AuthorDate: Sat Jun 11 17:03:03 2022 -0400
Fixing CryptoUtilsTest & CryptoUtils: RSA key size change from 2048 to 3072 bits in JDK-19
(cherry picked from commit 6f092abe0c542b54864754446410ed7402ba574f)
---
.../src/main/java/org/apache/cxf/rt/security/crypto/CryptoUtils.java | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/rt/security/src/main/java/org/apache/cxf/rt/security/crypto/CryptoUtils.java b/rt/security/src/main/java/org/apache/cxf/rt/security/crypto/CryptoUtils.java
index 8b135bb2d8..847200bcda 100644
--- a/rt/security/src/main/java/org/apache/cxf/rt/security/crypto/CryptoUtils.java
+++ b/rt/security/src/main/java/org/apache/cxf/rt/security/crypto/CryptoUtils.java
@@ -558,9 +558,12 @@ public final class CryptoUtils {
if (blockSize == -1) {
if (JavaUtils.isJava8Before161()) {
blockSize = secretKey instanceof PublicKey ? 117 : 128;
- } else {
+ } else if (JavaUtils.getJavaMajorVersion() < 19) {
//the default block size is 256 when use private key under java9
blockSize = secretKey instanceof PublicKey ? 117 : 256;
+ } else {
+ //the default block size is 384 when use private key after java19
+ blockSize = secretKey instanceof PublicKey ? 117 : 384;
}
}
boolean updateRequired = keyProps != null && keyProps.getAdditionalData() != null;