Skip to content

Commit bb121aa

Browse files
committed
only un-restrict jce when its restricted
... seems we got it backwards to start with? for Java 8 only and on Oracle 8 its been unlimited by default details at https://bugs.openjdk.java.net/browse/JDK-8170157
1 parent d5e3cb4 commit bb121aa

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/main/java/org/jruby/ext/openssl/util/CryptoSecurity.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -124,14 +124,14 @@ static Boolean unrestrictJceSecurity8() {
124124

125125
Field isRestricted = JceSecurity.getDeclaredField("isRestricted");
126126

127-
if ( Modifier.isFinal(isRestricted.getModifiers()) ) {
127+
if (Modifier.isFinal(isRestricted.getModifiers())) {
128128
Field modifiers = Field.class.getDeclaredField("modifiers");
129129
modifiers.setAccessible(true);
130130
modifiers.setInt(isRestricted, isRestricted.getModifiers() & ~Modifier.FINAL);
131131
}
132132

133133
isRestricted.setAccessible(true);
134-
if (isRestricted.getBoolean(null) == false) {
134+
if (isRestricted.getBoolean(null) == true) {
135135
isRestricted.setBoolean(null, false); // isRestricted = false;
136136
return true;
137137
}

0 commit comments

Comments
 (0)