Skip to content

Commit

Permalink
Automatically get provider version
Browse files Browse the repository at this point in the history
The provider's version is inferred automatically based
on the `Java` version that is used at that point.

Signed-off-by: Kostas Tsiounis <[email protected]>
  • Loading branch information
KostasTsiounis committed Feb 23, 2024
1 parent 6d33c10 commit 5747bd8
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ public final class OpenJCEPlus extends OpenJCEPlusProvider {

@SuppressWarnings({"unchecked", "rawtypes"})
public OpenJCEPlus() {
super("OpenJCEPlus", 17, info);
super("OpenJCEPlus", info);

if (debug2) {
System.out.println("New OpenJCEPlus instance");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ public final class OpenJCEPlusFIPS extends OpenJCEPlusProvider {

@SuppressWarnings({"unchecked", "rawtypes"})
public OpenJCEPlusFIPS() {
super("OpenJCEPlusFIPS", 17, info);
super("OpenJCEPlusFIPS", info);
if (debug2) {
System.out.println("New OpenJCEPlusFIPS instance");
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,21 @@
//
@SuppressWarnings({"serial", "removal", "deprecation"})
abstract class OpenJCEPlusProvider extends java.security.Provider {
private static final String PROVIDER_VER = java.security.AccessController
.doPrivileged(new java.security.PrivilegedAction<String>() {
public String run() {
return (System.getProperty("java.specification.version"));
}
});

// Are we debugging? -- for developers
static final boolean debug2 = false;

// private static boolean verifiedSelfIntegrity = false;
private static boolean verifiedSelfIntegrity = true;

OpenJCEPlusProvider(String name, double version, String info) {
super(name, version, info);
OpenJCEPlusProvider(String name, String info) {
super(name, PROVIDER_VER, info);
}

static final boolean verifySelfIntegrity(Class c) {
Expand Down

0 comments on commit 5747bd8

Please sign in to comment.