-
Notifications
You must be signed in to change notification settings - Fork 77
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
base: openj9
Are you sure you want to change the base?
Conversation
2126df6
to
81d196e
Compare
if (module.isPresent()) { | ||
isOpenJCEPlusModuleExist = true; | ||
} |
There was a problem hiding this comment.
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();
There was a problem hiding this comment.
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) { |
There was a problem hiding this comment.
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).
There was a problem hiding this comment.
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]>
15ac91d
to
47366a5
Compare
@@ -387,6 +394,11 @@ private static void checkIfKnownProfileSupported() { | |||
+ " on this platform."); | |||
} | |||
|
|||
if (!isOpenJCEPlusModuleExist && profileID.contains("OpenJCEPlus")) { |
There was a problem hiding this comment.
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?
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]