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

Add a check to detect the OpenJCEPlus module #924

Open
wants to merge 1 commit into
base: openj9
Choose a base branch
from

Conversation

taoliult
Copy link
Contributor

Add a check to detect the OpenJCEPlus module. If the module is missing but the restricted security profile requires it, print an error message and exit.

Signed-off-by: Tao Liu [email protected]

Comment on lines 146 to 148
if (module.isPresent()) {
isOpenJCEPlusModuleExist = true;
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The field should be final and initialized as:

        isOpenJCEPlusModuleExist = module.isPresent();

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

@@ -387,6 +397,11 @@ private static void checkIfKnownProfileSupported() {
+ " on this platform.");
}

if (profileID.contains("OpenJCEPlus") && !isOpenJCEPlusModuleExist) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The operands of && should be reversed (doing the cheaper test first).

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

Add a check to detect the OpenJCEPlus module. If the module
is missing but the restricted security profile requires it,
print an error message and exit.

Signed-off-by: Tao Liu <[email protected]>
@@ -387,6 +394,11 @@ private static void checkIfKnownProfileSupported() {
+ " on this platform.");
}

if (!isOpenJCEPlusModuleExist && profileID.contains("OpenJCEPlus")) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This doesn't seem right. Trying to use a profile called "not-OpenJCEPlus" shouldn't demand the presence of the openjceplus module. Also profiles that don't contain that string might actually depend on the openjceplus module.

I would expect to just get "no such provider" or something similar if I try to use an algorithm that requires a module (perhaps openjceplus, but it could be another module) that isn't present in the runtime in use. What are the current symptoms of that situation? Are they really worth potentially breaking legitimate use-cases?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants