Skip to content

Commit

Permalink
Apply an additional condition if -XX:-CRIUSecProvider is specified
Browse files Browse the repository at this point in the history
  • Loading branch information
WilburZjh committed Dec 8, 2023
1 parent 5495408 commit 9b316ef
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 9b316ef

Please sign in to comment.