Skip to content

Commit b75d8aa

Browse files
Merge pull request #81 from cconlon/1.7release
Prep for 1.7 Release
2 parents 280032d + 2cb30f7 commit b75d8aa

File tree

19 files changed

+592
-139
lines changed

19 files changed

+592
-139
lines changed

ChangeLog.md

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,27 @@
1+
### wolfCrypt JNI Release 1.7.0 (11/11/2024)
2+
3+
Release 1.7.0 of wolfCrypt JNI and JCE has bug fixes and new features including:
4+
5+
**New JCE Functionality:**
6+
- New WolfSSLKeyStore (WKS) KeyStore implementation for FIPS 140-2/3 compliance (PR 67)
7+
8+
**JNI and JCE Changes:**
9+
- Remove call to BigInteger.longValueExact(), not available on some Java versions (PR 76)
10+
- Detect `RSA_MIN_SIZE` in tests, add `Rsa.RSA_MIN_SIZE` helper (PR 77)
11+
- Fix pointer use in native `X509CheckPrivateKey()` (PR 80)
12+
13+
**Example Changes:**
14+
- Set keytool path correctly in `system-cacerts-to-wks.sh` (PR 78)
15+
- Add example Android Studio project (IDE/Android) (PR 79)
16+
17+
**Testing Changes:**
18+
- Run Facebook Infer on pull requests with GitHub Actions (PR 74)
19+
- Add Android Gradle build with GitHub Actions to run on all pull requests (PR 79)
20+
21+
The wolfCrypt JNI/JCE Manual is available at:
22+
https://www.wolfssl.com/documentation/manuals/wolfcryptjni/. For build
23+
instructions and more details comments, please check the manual.
24+
125
### wolfCrypt JNI Release 1.6.0 (4/17/2024)
226

327
Release 1.6.0 of wolfCrypt JNI and JCE has bug fixes and new features including:

IDE/WIN/README.md

Lines changed: 24 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -137,8 +137,12 @@ section titled `/* Configuration */`:
137137
```
138138
#define WOLFSSL_KEY_GEN
139139
#define HAVE_CRL
140+
#define OPENSSL_ALL
140141
```
141142

143+
If also building wolfSSL JNI/JSSE, additional defines may be needed. Please
144+
reference the Windows build documentation for wolfSSL JNI/JSSE if so.
145+
142146
After editing and saving the `user_settings.h` file, select one of the following
143147
DLL Library configurations and build the wolfSSL library solution:
144148

@@ -204,8 +208,12 @@ and set the values for `HAVE_FIPS`, `HAVE_FIPS_VERSION`, and
204208
```
205209
#define WOLFSSL_KEY_GEN
206210
#define HAVE_CRL
211+
#define OPENSSL_ALL
207212
```
208213

214+
If also building wolfSSL JNI/JSSE, additional defines may be needed. Please
215+
reference the Windows build documentation for wolfSSL JNI/JSSE if so.
216+
209217
6. Build the `wolfssl-fips` project, which will create a DLL in one of the
210218
following locations:
211219

@@ -230,28 +238,33 @@ in the wolfCrypt tests successfully running.
230238
See the FIPS User Guide for more details on the FIPS verifyCore hash, or
231239
232240

233-
## wolfSSL FIPS 140-3 (Upcoming)
241+
## wolfSSL FIPS 140-3 (Certificate #4718)
234242

235-
To build a version of wolfSSL that has been submitted for FIPS 140-3, use
236-
the Visual Studio solution file under the `IDE\WIN10` directory inside the
237-
wolfSSL package:
243+
To build a wolfSSL FIPS 140-3 variant for use with FIPS 140-3 certificate
244+
#4718, use the Visual Studio solution file located in the `IDE/WIN10`
245+
directory inside the wolfSSL package:
238246

239247
```
240248
<wolfssl>\IDE\WIN10\wolfssl-fips.sln
241249
```
242250

243251
Follow instructions in the above section for 140-2 / 3389, except use the
244-
following values for `HAVE_FIPS`, `HAVE_FIPS_VERSION`, and
245-
`HAVE_FIPS_VERSION_MINOR` in `user_settings.h`:
252+
following values for `HAVE_FIPS`, `HAVE_FIPS_VERSION`,
253+
`HAVE_FIPS_VERSION_MAJOR`, `HAVE_FIPS_VERSION_MINOR`, and
254+
`HAVE_FIPS_VERSION_PATCH` in `user_settings.h`:
246255

247256
```
248257
#if 1
249258
#undef HAVE_FIPS
250259
#define HAVE_FIPS
251260
#undef HAVE_FIPS_VERSION
252261
#define HAVE_FIPS_VERSION 5
262+
#undef HAVE_FIPS_VERSION_MAJOR
263+
#define HAVE_FIPS_VERSION_MAJOR 5
253264
#undef HAVE_FIPS_VERSION_MINOR
254-
#define HAVE_FIPS_VERSION_MINOR 1
265+
#define HAVE_FIPS_VERSION_MINOR 2
266+
#undef HAVE_FIPS_VERSION_PATCH
267+
#define HAVE_FIPS_VERSION_PATCH 0
255268
#endif
256269
```
257270

@@ -261,8 +274,12 @@ The following additional defines will also need to be added to
261274
```
262275
#define WOLFSSL_KEY_GEN
263276
#define HAVE_CRL
277+
#define OPENSSL_ALL
264278
```
265279

280+
If also building wolfSSL JNI/JSSE, additional defines may be needed. Please
281+
reference the Windows build documentation for wolfSSL JNI/JSSE if so.
282+
266283
For additional help, contact [email protected].
267284

268285
# Building wolfCrypt JNI/JCE Library

IDE/WIN/wolfcryptjni.vcxproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,7 @@
7878
<ClCompile Include="..\..\jni\jni_feature_detect.c" />
7979
<ClCompile Include="..\..\jni\jni_fips.c" />
8080
<ClCompile Include="..\..\jni\jni_hmac.c" />
81+
<ClCompile Include="..\..\jni\jni_jce_wolfsslkeystore.c" />
8182
<ClCompile Include="..\..\jni\jni_logging.c" />
8283
<ClCompile Include="..\..\jni\jni_md5.c" />
8384
<ClCompile Include="..\..\jni\jni_native_struct.c" />

IDE/WIN/wolfcryptjni.vcxproj.filters

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -170,5 +170,8 @@
170170
<ClCompile Include="..\..\jni\jni_wolfssl_cert_manager.c">
171171
<Filter>Source Files</Filter>
172172
</ClCompile>
173+
<ClCompile Include="..\..\jni\jni_jce_wolfsslkeystore.c">
174+
<Filter>Source Files</Filter>
175+
</ClCompile>
173176
</ItemGroup>
174177
</Project>

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,7 @@ on the current release):
208208
<dependency>
209209
<groupId>com.wolfssl</groupId>
210210
<artifactId>wolfcrypt-jni</artifactId>
211-
<version>1.6.0-SNAPSHOT</version>
211+
<version>1.7.0-SNAPSHOT</version>
212212
</dependency>
213213
</dependencies>
214214
...

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.6" />
22+
<property name="implementation.version" value="1.7" />
2323

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

examples/WindowsConfig.bat

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
:: included by other example .bat files.
1010

1111
:: wolfSSL Normal non-FIPS (DLL Debug x64)
12-
SET WOLFSSL_DLL_DIR=..\..\..\wolfssl\IDE\WIN10\DLL Debug\x64
12+
SET WOLFSSL_DLL_DIR=..\..\..\wolfssl\DLL Debug\x64
1313
SET WOLFCRYPTJNI_DLL_DIR=..\..\IDE\WIN\DLL Debug\x64
1414

1515
:: wolfSSL Normal non-FIPS (DLL Release x64)

examples/certs/systemcerts/system-cacerts-to-wks.sh

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,19 @@ export DYLD_LIBRARY_PATH=../../../lib:$DYLD_LIBRARY_PATH
2929

3030
OUTDIR=`pwd`
3131

32+
# First argument can be passed in to represent path to
33+
# wolfcrypt-jni.jar provider JAR. If not given, use default.
34+
if [ -z "$1" ]; then
35+
# default wolfcrypt-jni.jar path
36+
PROVIDER_PATH="../../../lib/wolfcrypt-jni.jar"
37+
else
38+
# use custom provider path
39+
PROVIDER_PATH=$1
40+
fi
41+
3242
# ARGS: <input-keystore-name> <output-keystore-name> <in-password> <out-password> <java home>
3343
jks_to_wks() {
34-
${5}/bin/keytool -importkeystore -srckeystore ${1} -destkeystore ${2}.wks -srcstoretype JKS -deststoretype WKS -srcstorepass "$3" -deststorepass "$3" -deststorepass "$4" -provider com.wolfssl.provider.jce.WolfCryptProvider --providerpath ../../../lib/wolfcrypt-jni.jar &> /dev/null
44+
${5}/bin/keytool -importkeystore -srckeystore ${1} -destkeystore ${2}.wks -srcstoretype JKS -deststoretype WKS -srcstorepass "$3" -deststorepass "$3" -deststorepass "$4" -provider com.wolfssl.provider.jce.WolfCryptProvider --providerpath "$PROVIDER_PATH"
3545
if [ $? -ne 0 ]; then
3646
printf "Failed to convert JKS to WKS!"
3747
exit 1
@@ -58,6 +68,8 @@ else
5868
javaHome="$JAVA_HOME"
5969
fi
6070

71+
echo "PROVIDER_PATH: $PROVIDER_PATH"
72+
6173
# Set up Java include and library paths for OS X and Linux
6274
# NOTE: you may need to modify these if your platform uses different locations
6375
if [ "$OS" == "Darwin" ]; then

jni/jni_ecc.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -338,7 +338,9 @@ Java_com_wolfssl_wolfcrypt_Ecc_wc_1ecc_1export_1private(
338338
}
339339

340340
if (ret == 0) {
341+
PRIVATE_KEY_UNLOCK();
341342
ret = wc_ecc_export_private_only(ecc, output, &outputSz);
343+
PRIVATE_KEY_LOCK();
342344
}
343345

344346
if (ret == 0) {
@@ -1054,7 +1056,9 @@ JNIEXPORT jbyteArray JNICALL Java_com_wolfssl_wolfcrypt_Ecc_wc_1ecc_1private_1ke
10541056
}
10551057

10561058
if (ret == 0) {
1059+
PRIVATE_KEY_UNLOCK();
10571060
ret = wc_EccPrivateKeyToDer(ecc, derKey, derKeySz);
1061+
PRIVATE_KEY_LOCK();
10581062
if (ret >= 0) {
10591063
derKeySz = ret;
10601064
ret = 0;

0 commit comments

Comments
 (0)