Skip to content

Commit e965243

Browse files
committed
JNI: add missing releaseNativeStruct calls in RSA test cleanup paths
1 parent 2f5c2dd commit e965243

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

src/test/java/com/wolfssl/wolfcrypt/test/RsaTest.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -364,6 +364,7 @@ public void rsaPkcs8DecodeAndVerify() {
364364
/* FIPS after 2425 doesn't allow 1024-bit RSA */
365365
if ((Fips.enabled && Fips.fipsVersion >= 5) ||
366366
(Rsa.RSA_MIN_SIZE > 1024)) {
367+
key.releaseNativeStruct();
367368
return;
368369
}
369370

@@ -502,6 +503,8 @@ public void exportRawPublicKeySizesCorrect() {
502503

503504
assertArrayEquals(n_in, Arrays.copyOf(n_out, (int)n_len[0]));
504505
assertArrayEquals(e_in, Arrays.copyOf(e_out, (int)e_len[0]));
506+
507+
key.releaseNativeStruct();
505508
}
506509

507510
@Test
@@ -625,6 +628,8 @@ public void exportRawPrivateKeySizesCorrect() {
625628
assertTrue(dPSz[0] >= 127 && dPSz[0] <= 129);
626629
assertTrue(dQSz[0] >= 127 && dQSz[0] <= 129);
627630
assertTrue(uSz[0] >= 127 && uSz[0] <= 129);
631+
632+
key.releaseNativeStruct();
628633
}
629634

630635
@Test

0 commit comments

Comments
 (0)