Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding profile for using SunPKCS11-NSS-FIPS provider #6773

Merged
merged 1 commit into from
Nov 12, 2024
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
9 changes: 7 additions & 2 deletions integration-tests/crypto/README.adoc
Original file line number Diff line number Diff line change
@@ -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
```
21 changes: 19 additions & 2 deletions integration-tests/crypto/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -90,10 +90,10 @@

<profiles>
<profile>
<id>fips</id>
<id>bcfips</id>
<activation>
<property>
<name>fips</name>
<name>bcfips</name>
</property>
</activation>
<properties>
Expand All @@ -110,6 +110,23 @@
</dependency>
</dependencies>
</profile>
<profile>
<id>fips</id>
<activation>
<property>
<name>fips</name>
</property>
</activation>
<properties>
<cq-security-provider>quarkus.security.security-providers=SunPKCS11-NSS-FIPS</cq-security-provider>
</properties>
<dependencies>
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-security</artifactId>
</dependency>
</dependencies>
</profile>
<profile>
<id>native</id>
<activation>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -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}