Skip to content

Commit

Permalink
Merge pull request #296 from WilburZjh/EnableFullSecurityEnvCRIU
Browse files Browse the repository at this point in the history
Apply an additional condition if -XX:-CRIUSecProvider is specified
  • Loading branch information
keithc-ca committed Dec 9, 2023
2 parents 7719deb + 9b316ef commit b62222a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -119,14 +119,15 @@ public static final boolean isAllowedAndLoaded() {

/**
* Return the OpenSSL version.
* -1 is returned if CRIU is enabled and the checkpoint is allowed.
* -1 is returned if CRIU is enabled and checkpoints are allowed
* unless -XX:-CRIUSecProvider is specified.
* The libraries are to be loaded for the first reference of InstanceHolder.instance.
*
* @return the OpenSSL library version if it is available
*/
public static final long getVersionIfAvailable() {
/*[IF CRIU_SUPPORT]*/
if (InternalCRIUSupport.isCheckpointAllowed()) {
if (InternalCRIUSupport.isCheckpointAllowed() && InternalCRIUSupport.enableCRIUSecProvider()) {
return -1;
}
/*[ENDIF] CRIU_SUPPORT */
Expand Down
3 changes: 2 additions & 1 deletion src/java.base/share/classes/java/security/Security.java
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,8 @@ private static void initialize() {

/*[IF CRIU_SUPPORT]*/
// Check if CRIU checkpoint mode is enabled, if it is then reconfigure the security providers.
if (InternalCRIUSupport.isCheckpointAllowed()) {
// If -XX:-CRIUSecProvider is specified, we don't need to configure the CRIUSec provider.
if (InternalCRIUSupport.isCheckpointAllowed() && InternalCRIUSupport.enableCRIUSecProvider()) {
CRIUConfigurator.setCRIUSecMode(props);
}
/*[ENDIF] CRIU_SUPPORT */
Expand Down

0 comments on commit b62222a

Please sign in to comment.