Skip to content

Commit 0c52ff7

Browse files
Always report FIPS mode true on developer platforms (#1177)
The OpenJCEPlusFIPS provider may run on platforms that support developer mode. On these systems, the provider should always report that it is operating in FIPS mode to ensure behavior is consistent with fully FIPS-certified platforms. This change simulates FIPS operation as closely as possible in development environments. Fixes: https://github.ibm.com/runtimes/jit-crypto/issues/1076 Signed-off-by: Mohit Rajbhar <mohit.rajbhar@ibm.com>
1 parent 7a9b408 commit 0c52ff7

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

src/main/java/com/ibm/crypto/plus/provider/OpenJCEPlusFIPS.java

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -689,6 +689,15 @@ ProviderContext getProviderContext() {
689689
return new OpenJCEPlusFIPSContext();
690690
}
691691

692+
/**
693+
* Indicate whether the platform is certified FIPS or when FIPS is simulated on non-certified platforms.
694+
* @return true if FIPS is active (certified or simulated)
695+
*/
696+
@Override
697+
boolean isFIPS() {
698+
return super.isFIPS() || !isFIPSCertifiedPlatform;
699+
}
700+
692701
// Get SecureRandom to use for crypto operations. Returns a FIPS
693702
// approved SecureRandom to use. Ignore any user supplied
694703
// SecureRandom in FIPS mode.

0 commit comments

Comments
 (0)