Skip to content

Commit cc9f5f6

Browse files
authored
Merge pull request #184 from cconlon/v1.9release
Prep for 1.9 release
2 parents c6f8855 + c72408d commit cc9f5f6

File tree

9 files changed

+144
-11
lines changed

9 files changed

+144
-11
lines changed

ChangeLog.md

Lines changed: 111 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,114 @@
1+
### wolfCrypt JNI Release 1.9.0 (12/31/2025)
2+
3+
Release 1.9.0 of wolfCrypt JNI and JCE has bug fixes and new features including:
4+
5+
**New JCE Functionality:**
6+
- Add KeyGenerator implementation (AES, HmacSHA1, HmacSHA256, HmacSHA384, HmacSHA512) (PR 98)
7+
- Add SHA-224 support to MessageDigest, Mac, Signature, KeyGenerator (PR 104)
8+
- Add SHA-3 support to MessageDigest, Mac, Signature (PR 103)
9+
- Add utility method to convert JKS/PKCS12 KeyStore to WKS type (PR 108)
10+
- Add more AES mode support to Cipher class (PR 129, 163, 173):
11+
- AES/CCM/NoPadding
12+
- AES/CTR/NoPadding
13+
- AES/ECB/NoPadding
14+
- AES/ECB/PKCS5Padding
15+
- AES/OFB/NoPadding
16+
- AES/CTS/NoPadding
17+
- Add AESCMAC (AES-CMAC), AESGMAC (AES-GMAC) to Mac class (PR 129)
18+
- Add RSA-PSS support to Signature class (PR 131):
19+
- RSASSA-PSS
20+
- SHA224withRSA/PSS
21+
- SHA256withRSA/PSS
22+
- SHA384withRSA/PSS
23+
- SHA512withRSA/PSS
24+
- Add `Cipher.engineGetParameters()` support (PR 140)
25+
- Add Cipher generic `AES` type support (PR 142)
26+
- Add AES and GCM support to AlgorithmParameters class (PR 144)
27+
- Add HmacSHA3 support to KeyGenerator class (PR 150):
28+
- HmacSHA3-224
29+
- HmacSHA3-256
30+
- HmacSHA3-384
31+
- HmacSHA3-512
32+
- Add `toString()` to WolfCryptRandom, used when printing SecureRandom object (PR 154)
33+
- Add additional ECC algorithm OIDs to Signature and KeyPairGenerator classes (PR 158)
34+
- Add EC KeyFactory support (PR 159)
35+
- Add P1363 ECDSA signature formats to Signature class (PR 160)
36+
- Add DH support to AlgorithmParameter, AlgorithmParameterGenerator, and KeyFactory classes (PR 161)
37+
- Add AES and 3DES support to SecretKeyFactory and SecretKey classes (PR 164)
38+
- Add additional AES and Hmac algorithm aliases to Cipher and Mac classes (PR 166)
39+
- Add Java ServiceLoader support for wolfJCE provider for Java Module System (JPMS) compatibility (PR 167)
40+
- Add RSA KeyFactory support (PR 169)
41+
- Add MessageDigest OID alias values for SHA-224/256/384/512 (PR 170)
42+
- Add PSS parameter encoding support in WolfCryptPSSParameters class (PR 175)
43+
- Add `engineProbe()` implementation to WolfSSLKeyStore (PR 178)
44+
- Add optional KEK caching to WolfSSLKeyStore for performance (PR 176)
45+
- Add RSASSA-PSS key support to WolfSSLKeyStore (PR 180)
46+
47+
**JNI and JCE Changes:**
48+
- Fix `Cipher.getOutputSize()` for AES/GCM/NoPadding in DECRYPT mode (PR 107)
49+
- Dynamically get algorithm and key ASN enum values from wolfSSL (PR 111)
50+
- Dynamically get hash OID sums from wolfSSL (PR 124)
51+
- Fix max secret size in DH agreement (PR 123)
52+
- Fix potential JNI-level ECC issues (PR 117)
53+
- Fix build issues with older wolfSSL and FIPS build variants (PR 133)
54+
- Fix AES-CTR IV consistency across state resets (PR 136)
55+
- Fix for using buffered data in `Cipher.engineGetOutputSize()` (PR 138)
56+
- Throw `AEADBadTagException` on AES-GCM decrypt failure (PR 139)
57+
- Fix `Cipher.engineInit()` with null parameters (PR 141)
58+
- Throw correct `InvalidAlgorithmParameterException` from `Cipher.init()` on unsupported mode (PR 143)
59+
- Fix for PKCS#7 pad/unpad operations in Cipher (PR 146)
60+
- Fix expected output size for Cipher decrypt related to pad size (PR 147)
61+
- Fix AES-GCM Cipher edge case to allow for null input or output arrays (PR 145)
62+
- Improve Cipher input validation, output buffer sizing, update behavior (PR 148)
63+
- Fix MessageDigest parameter validation (PR 149)
64+
- Fix `ArrayIndexOutOfBoundsException` in Cipher AES-GCM/CCM with zero-length plaintext (PR 151)
65+
- Throw exception if RSA `PrivateKey` does not include CRT parameters (PR 153)
66+
- Throw `IllegalArgumentException` from `WolfCryptRandom.engineGenerateSeed()` on bad input values (PR 152)
67+
- Set default key and parameter sizes in `KeyPairGenerator` if not explicitly set (PR 155)
68+
- Fix ECC `KeyPairGenerator` bits to bytes conversion (PR 157)
69+
- Check RSA key size used against min allowed in KeyPairGenerator (PR 162)
70+
- Fix SecretKey decryption to use stored PBKDF2 iteration count in WKS (PR 168)
71+
- Remove synchronization on some WolfSSLKeyStore methods (PR 165)
72+
- Validate EC key sizes in `KeyPairGenerator.initialize()` (PR 174)
73+
- Improvements to PKIXCertPathValidator with OCSP revocation checking, disabled algorithm validation, and more (PR 177, 178)
74+
75+
**Debugging Changes:**
76+
- Switch to use Java logging (`java.util.logging`) framework for debug logs (PR 110)
77+
- Refresh debug flags when WolfCryptProvider is loaded (PR 135)
78+
- Switch debug log timestamp to use Java `Instant.ofEpochMilli()`, remove dependency on `java.sql.Timestamp` (PR 137)
79+
80+
**Example Changes:**
81+
- Add RSA key generation to wolfJCE benchmark app (PR 95)
82+
- Add ECC and ECDH to wolfJCE benchmark app (PR 99, 116)
83+
- Add HMAC benchmark to wolfJCE benchmark app (PR 100)
84+
- Add DH benchmarks to wolfJCE benchmark app (PR 102)
85+
- Add PBKDF2 benchmark to wolfJCE benchmark app (PR 105)
86+
- Add MessageDigest benchmark to wolfJCE benchmark app (PR 106)
87+
- Add Signature benchmark to wolfJCE benchmark app (PR 109)
88+
- Add SHA-3 ciphers to HMAC benchmark in wolfJCE benchmark app (PR 113)
89+
- Add KeyGenerator benchmark to wolfJCE benchmark app (PR 115)
90+
- Add SecureRandom benchmark to wolfJCE benchmark app (PR 120)
91+
- Add KeyStore benchmark example app for WKS/JKS/PKCS12 (PR 118)
92+
- Add individual algorithm category options to wolfJCE benchmark app (PR 121)
93+
94+
**Testing Changes:**
95+
- Add GitHub Actions PRB test for AddressSanitizer (`-fsanitize=address`) builds (PR 119)
96+
- Add GitHub Actions PRB tests for coding style (line length, comment style) (PR 126, 127)
97+
- Add GitHub Actions PRB test for Clang scan-build static analysis (PR 128)
98+
- Add GitHub Actions PRB test for Visual Studio builds on Windows (PR 130)
99+
- Add GitHub Actions PRB test to build against last 5 stable wolfSSL releases (PR 181)
100+
- Add GitHub Actions PRB test to run unit tests on Android emulator (PR 183)
101+
- Output time taken in ms per JUnit test when ant test is run (PR 171)
102+
- JUnit test performance improvements (PR 172)
103+
104+
**Misc Changes:**
105+
- Clean up IDE warnings in Cursor and VSCode (PR 101)
106+
- Add `CLAUDE.md` for consumption by Claude Code (PR 122)
107+
108+
The wolfCrypt JNI/JCE Manual is available at:
109+
https://www.wolfssl.com/documentation/manuals/wolfcryptjni/. For build
110+
instructions and more details comments, please check the manual.
111+
1112
### wolfCrypt JNI Release 1.8.0 (01/23/2025)
2113

3114
Release 1.8.0 of wolfCrypt JNI and JCE has bug fixes and new features including:

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,7 @@ on the current release):
217217
<dependency>
218218
<groupId>com.wolfssl</groupId>
219219
<artifactId>wolfcrypt-jni</artifactId>
220-
<version>1.8.0-SNAPSHOT</version>
220+
<version>1.9.0-SNAPSHOT</version>
221221
</dependency>
222222
</dependencies>
223223
...

build.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
<!-- versioning/manifest properties -->
2020
<property name="implementation.vendor" value="wolfSSL Inc." />
2121
<property name="implementation.title" value="wolfCrypt JNI" />
22-
<property name="implementation.version" value="1.8" />
22+
<property name="implementation.version" value="1.9" />
2323

2424
<!-- set properties for this build -->
2525
<property name="src.dir" value="src/main/java/" />

jni/jni_ecc.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ JNIEXPORT void JNICALL Java_com_wolfssl_wolfcrypt_Ecc_wc_1ecc_1make_1key_1ex
164164
int ret = 0;
165165
ecc_key* ecc = NULL;
166166
RNG* rng = NULL;
167-
const char* name;
167+
const char* name = NULL;
168168
(void)size;
169169

170170
ecc = (ecc_key*) getNativeStruct(env, this);

jni/jni_rng.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -171,8 +171,9 @@ JNIEXPORT void JNICALL Java_com_wolfssl_wolfcrypt_Rng_rngGenerateBlock___3BII(
171171
buffer = getByteArray(env, buffer_buffer);
172172
bufferSz = getByteArrayLength(env, buffer_buffer);
173173

174-
if (rng == NULL || buffer == NULL || (offset + length) > bufferSz ||
175-
offset < 0 || length < 0) {
174+
if (rng == NULL || buffer == NULL ||
175+
offset < 0 || length < 0 ||
176+
((word32)(offset + length) > bufferSz)) {
176177
ret = BAD_FUNC_ARG;
177178
}
178179

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<modelVersion>4.0.0</modelVersion>
55
<groupId>com.wolfssl</groupId>
66
<artifactId>wolfcrypt-jni</artifactId>
7-
<version>1.8.0-SNAPSHOT</version>
7+
<version>1.9.0-SNAPSHOT</version>
88
<packaging>jar</packaging>
99
<name>wolfcrypt-jni</name>
1010
<url>https://www.wolfssl.com</url>

src/main/java/com/wolfssl/provider/jce/WolfCryptProvider.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ public final class WolfCryptProvider extends Provider {
3737
* Create new WolfCryptProvider object
3838
*/
3939
public WolfCryptProvider() {
40-
super("wolfJCE", 1.8, "wolfCrypt JCE Provider");
40+
super("wolfJCE", 1.9, "wolfCrypt JCE Provider");
4141

4242
/* Refresh debug flags in case system properties were set after
4343
* WolfCryptDebug class was first loaded (e.g., via JAVA_OPTS) */

src/test/java/com/wolfssl/provider/jce/test/WolfCryptRandomTest.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -302,6 +302,9 @@ public void testGenerateSeedWithNegativeArgument()
302302

303303
} catch (IllegalArgumentException e) {
304304
/* Expected exception */
305+
} catch (NegativeArraySizeException e) {
306+
/* Thrown by some Java versions before reaching the provider,
307+
* shows up on Windows */
305308
}
306309
}
307310

src/test/java/com/wolfssl/provider/jce/test/WolfCryptSignatureTest.java

Lines changed: 22 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@
4747
import java.security.AlgorithmParameters;
4848
import java.security.spec.ECGenParameterSpec;
4949
import java.security.spec.PSSParameterSpec;
50+
import java.security.spec.MGF1ParameterSpec;
5051
import java.security.interfaces.RSAKey;
5152
import java.security.interfaces.ECPrivateKey;
5253
import java.security.interfaces.ECPublicKey;
@@ -59,6 +60,7 @@
5960

6061
import com.wolfssl.wolfcrypt.Rsa;
6162
import com.wolfssl.wolfcrypt.Fips;
63+
import com.wolfssl.wolfcrypt.FeatureDetect;
6264
import com.wolfssl.provider.jce.WolfCryptProvider;
6365
import com.wolfssl.wolfcrypt.test.TimedTestWatcher;
6466

@@ -2115,27 +2117,42 @@ public void testRsaPssMultipleUpdates()
21152117
"SHA-384", "SHA-512"};
21162118

21172119
for (String digestAlg : digestAlgorithms) {
2118-
/* Create PSS parameters */
2119-
int digestLen;
2120-
java.security.spec.MGF1ParameterSpec mgfSpec;
2120+
/* Create PSS parameters, skip if digest not compiled in */
2121+
int digestLen = 0;
2122+
MGF1ParameterSpec mgfSpec;
21212123
switch (digestAlg) {
21222124
case "SHA-1":
2125+
if (!FeatureDetect.ShaEnabled()) {
2126+
continue;
2127+
}
21232128
digestLen = 20;
21242129
mgfSpec = java.security.spec.MGF1ParameterSpec.SHA1;
21252130
break;
21262131
case "SHA-224":
2132+
if (!FeatureDetect.Sha224Enabled()) {
2133+
continue;
2134+
}
21272135
digestLen = 28;
21282136
mgfSpec = java.security.spec.MGF1ParameterSpec.SHA224;
21292137
break;
21302138
case "SHA-256":
2139+
if (!FeatureDetect.Sha256Enabled()) {
2140+
continue;
2141+
}
21312142
digestLen = 32;
21322143
mgfSpec = java.security.spec.MGF1ParameterSpec.SHA256;
21332144
break;
21342145
case "SHA-384":
2146+
if (!FeatureDetect.Sha384Enabled()) {
2147+
continue;
2148+
}
21352149
digestLen = 48;
21362150
mgfSpec = java.security.spec.MGF1ParameterSpec.SHA384;
21372151
break;
21382152
case "SHA-512":
2153+
if (!FeatureDetect.Sha512Enabled()) {
2154+
continue;
2155+
}
21392156
digestLen = 64;
21402157
mgfSpec = java.security.spec.MGF1ParameterSpec.SHA512;
21412158
break;
@@ -2147,7 +2164,8 @@ public void testRsaPssMultipleUpdates()
21472164
int keySize = ((RSAKey)pub).getModulus().bitLength();
21482165
int saltLength = keySize/8 - digestLen - 2;
21492166
if (saltLength < 0) {
2150-
continue; /* Skip if salt length would be negative */
2167+
/* Should never happen, but left here for caution */
2168+
continue;
21512169
}
21522170

21532171
PSSParameterSpec pssSpec = new PSSParameterSpec(digestAlg, "MGF1",

0 commit comments

Comments
 (0)