Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions src/test/java/ibm/jceplus/junit/TestMultithread.java
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,6 @@ public class TestMultithread {
private final int numThreads = 10;
private final int timeoutSec = 4500;
private final String[] testList = {
"ibm.jceplus.junit.openjceplus.multithread.TestAESGCMCICOWithGCMAndAAD",
"ibm.jceplus.junit.openjceplus.multithread.TestAESCipherInputStreamExceptions",
"ibm.jceplus.junit.openjceplus.multithread.TestAESCopySafe",
"ibm.jceplus.junit.openjceplus.multithread.TestAESGCMLong",
"ibm.jceplus.junit.openjceplus.multithread.TestAESGCMNonExpanding",
Expand Down
2 changes: 0 additions & 2 deletions src/test/java/ibm/jceplus/junit/TestMultithreadFIPS.java
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,6 @@ public class TestMultithreadFIPS {
private final int numThreads = 10;
private final int timeoutSec = 4500;
private final String[] testList = {
"ibm.jceplus.junit.openjceplusfips.multithread.TestAESGCMCICOWithGCMAndAAD",
"ibm.jceplus.junit.openjceplusfips.multithread.TestAESCipherInputStreamExceptions",
"ibm.jceplus.junit.openjceplusfips.multithread.TestAESCopySafe",
"ibm.jceplus.junit.openjceplusfips.multithread.TestAESGCMLong",
"ibm.jceplus.junit.openjceplusfips.multithread.TestAESGCMNonExpanding",
Expand Down

This file was deleted.

This file was deleted.

2 changes: 0 additions & 2 deletions src/test/java/ibm/jceplus/junit/openjceplus/TestAll.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,10 @@
TestAESCCM2.class,
TestAESCCMInteropBC.class,
TestAESCCMParameters.class,
TestAESCipherInputStreamExceptions.class,
TestAESCopySafe.class,
TestAESGCM_ExtIV.class,
TestAESGCM_IntIV.class,
TestAESGCMBufferIV.class,
TestAESGCMCICOWithGCMAndAAD.class,
TestAESGCMLong.class,
TestAESGCMNonExpanding.class,
TestAESGCMSameBuffer.class,
Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

2 changes: 0 additions & 2 deletions src/test/java/ibm/jceplus/junit/openjceplusfips/TestAll.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,10 @@
TestAESCCM2.class,
TestAESCCMInteropBC.class,
TestAESCCMParameters.class,
TestAESCipherInputStreamExceptions.class,
TestAESCopySafe.class,
TestAESGCM_ExtIV.class,
TestAESGCM_IntIV.class,
TestAESGCMBufferIV.class,
TestAESGCMCICOWithGCMAndAAD.class,
TestAESGCMLong.class,
TestAESGCMNonExpanding.class,
TestAESGCMSameBuffer.class,
Expand Down

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
/*
* Copyright IBM Corp. 2023
* Copyright IBM Corp. 2023, 2026
*
* This code is free software; you can redistribute it and/or modify it
* under the terms provided by IBM in the LICENSE file that accompanied
* this code, including the "Classpath" Exception described therein.
*/

package ibm.jceplus.junit.base;
package ibm.jceplus.junit.tests;

import java.io.ByteArrayInputStream;
import java.io.IOException;
Expand All @@ -16,8 +16,13 @@
import javax.crypto.spec.IvParameterSpec;
import javax.crypto.spec.SecretKeySpec;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Tag;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.TestInfo;
import org.junit.jupiter.api.TestInstance;
import org.junit.jupiter.params.Parameter;
import org.junit.jupiter.params.ParameterizedClass;
import org.junit.jupiter.params.provider.MethodSource;
import static org.hamcrest.CoreMatchers.containsString;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.junit.jupiter.api.Assertions.assertEquals;
Expand All @@ -29,16 +34,27 @@
* - Make sure other algorithms do not throw exceptions when the stream
* calls close() and only throw when a invalid read() errors.
*/
public class BaseTestAESCipherInputStreamExceptions extends BaseTestJunit5 {
@Tag(Tags.OPENJCEPLUS_NAME)
@Tag(Tags.OPENJCEPLUS_FIPS_NAME)
@Tag(Tags.OPENJCEPLUS_MULTITHREAD_NAME)
@Tag(Tags.OPENJCEPLUS_FIPS_MULTITHREAD_NAME)
@TestInstance(TestInstance.Lifecycle.PER_CLASS)
@ParameterizedClass
@MethodSource("ibm.jceplus.junit.tests.TestArguments#getEnabledProviders")
public class TestAESCipherInputStreamExceptions extends BaseTest {

@Parameter(0)
TestProvider provider;

static final SecretKeySpec key = new SecretKeySpec(new byte[16], "AES");
static final GCMParameterSpec gcmspec = new GCMParameterSpec(128, new byte[16]);
static final IvParameterSpec iv = new IvParameterSpec(new byte[16]);
private TestInfo testInfo;

@BeforeEach
void init(TestInfo testInfo) {
void init(TestInfo testInfo) throws Exception {
this.testInfo = testInfo;
setAndInsertProvider(provider);
}

/**
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
/*
* Copyright IBM Corp. 2023, 2024
* Copyright IBM Corp. 2023, 2026
*
* This code is free software; you can redistribute it and/or modify it
* under the terms provided by IBM in the LICENSE file that accompanied
* this code, including the "Classpath" Exception described therein.
*/

package ibm.jceplus.junit.base;
package ibm.jceplus.junit.tests;

import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
Expand All @@ -20,11 +20,32 @@
import javax.crypto.CipherOutputStream;
import javax.crypto.KeyGenerator;
import javax.crypto.SecretKey;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Tag;
import org.junit.jupiter.api.Test;

public class BaseTestAESGCMCICOWithGCMAndAAD extends BaseTestJunit5 {
import org.junit.jupiter.api.TestInstance;
import org.junit.jupiter.params.Parameter;
import org.junit.jupiter.params.ParameterizedClass;
import org.junit.jupiter.params.provider.MethodSource;

@Tag(Tags.OPENJCEPLUS_NAME)
@Tag(Tags.OPENJCEPLUS_FIPS_NAME)
@Tag(Tags.OPENJCEPLUS_MULTITHREAD_NAME)
@Tag(Tags.OPENJCEPLUS_FIPS_MULTITHREAD_NAME)
@TestInstance(TestInstance.Lifecycle.PER_CLASS)
@ParameterizedClass
@MethodSource("ibm.jceplus.junit.tests.TestArguments#getEnabledProviders")
public class TestAESGCMCICOWithGCMAndAAD extends BaseTest {

@Parameter(0)
TestProvider provider;
protected int specifiedKeySize = 128;

@BeforeEach
public void setUp() throws Exception{
setAndInsertProvider(provider);
}

@Test
public void testGCMWithAAD() throws Exception {
//init Secret Key
Expand Down