Skip to content

Commit

Permalink
Showing 1 changed file with 2 additions and 15 deletions.
17 changes: 2 additions & 15 deletions core/src/main/java/org/jruby/util/SecurityHelper.java
Original file line number Diff line number Diff line change
@@ -14,9 +14,9 @@ public abstract class SecurityHelper {

// attempt to enable unlimited-strength crypto on OracleJDK

This comment has been minimized.

Copy link
@etehtsea

etehtsea Aug 30, 2016

Contributor

seems that comment should also be updated

public static void checkCryptoRestrictions(final Ruby runtime) {
if ( isOracleJRE() && !attempted) {
setNonRestricted();
if ( !attempted) {
attempted = true;
setNonRestricted();
// NOTE: this is not 'really' enough and there's more to be done :
// JceSecurity#defaultPolicy should add: javax.crypto.CryptoAllPermission
//
@@ -51,17 +51,4 @@ private static boolean setNonRestricted() {
return false;
}

private static boolean isOracleJRE() {
try {
String name = System.getProperty("java.vendor"); // "Oracle Corporation"
if ( name == null || ! name.contains("Oracle") ) return false;
name = System.getProperty("java.runtime.name"); // make sure we're not OpenJDK
if ( name == null || name.contains("OpenJDK") ) return false;
return true;
}
catch (SecurityException e) {
return false;
}
}

}

0 comments on commit 0312587

Please sign in to comment.