diff --git a/integration-tests/crypto/README.adoc b/integration-tests/crypto/README.adoc index 2822e0a8338..70c1f907361 100644 --- a/integration-tests/crypto/README.adoc +++ b/integration-tests/crypto/README.adoc @@ -1,8 +1,13 @@ == FIPS -Please utilize the fips profile when executing tests within a FIPS-enabled environment. The tests must employ the BouncyCastle-FIPS dependency instead of the standard BouncyCastle library. +Please utilize the fips profile when executing tests within a FIPS-enabled environment. +There are two profiles: + +* Use `bcfips` profile to employ the BouncyCastle-FIPS security provider. +* Use `fips` profile to employ the SunPKCS11-NSS-FIPS security provider. + Example of usage: ``` -mvn clean test -Dfips +mvn clean test -Dfips or mvn clean test -Dbcfips ``` diff --git a/integration-tests/crypto/pom.xml b/integration-tests/crypto/pom.xml index de42e90c751..6a7ffd34198 100644 --- a/integration-tests/crypto/pom.xml +++ b/integration-tests/crypto/pom.xml @@ -90,10 +90,10 @@ - fips + bcfips - fips + bcfips @@ -110,6 +110,23 @@ + + fips + + + fips + + + + quarkus.security.security-providers=SunPKCS11-NSS-FIPS + + + + io.quarkus + quarkus-security + + + native diff --git a/integration-tests/crypto/src/main/java/org/apache/camel/quarkus/component/crypto/it/CryptoRoutes.java b/integration-tests/crypto/src/main/java/org/apache/camel/quarkus/component/crypto/it/CryptoRoutes.java index acc93990de7..56461cb93f5 100644 --- a/integration-tests/crypto/src/main/java/org/apache/camel/quarkus/component/crypto/it/CryptoRoutes.java +++ b/integration-tests/crypto/src/main/java/org/apache/camel/quarkus/component/crypto/it/CryptoRoutes.java @@ -63,7 +63,10 @@ public void configure() throws Exception { private CryptoDataFormat getCryptoDataFormat() throws NoSuchAlgorithmException { KeyGenerator generator = KeyGenerator.getInstance("DES"); - return new CryptoDataFormat("DES", generator.generateKey()); + CryptoDataFormat cdf = new CryptoDataFormat("DES", generator.generateKey()); + //workaround for SunPKCS11-NSS-FIPS + cdf.setShouldAppendHMAC(false); + return cdf; } } diff --git a/integration-tests/crypto/src/main/resources/application.properties b/integration-tests/crypto/src/main/resources/application.properties index 03d1e5fb7d7..6df55e4420f 100644 --- a/integration-tests/crypto/src/main/resources/application.properties +++ b/integration-tests/crypto/src/main/resources/application.properties @@ -16,6 +16,5 @@ ## --------------------------------------------------------------------------- quarkus.native.resources.includes=*.jks -#FIPS profile adds BCFIPS provider +#profile adds SunPKCS11-NSS-FIPS or BCFIPS provider ${cq-security-provider} -