biemond / biemond-jdk7

Puppet JDK7 module optimized for Oracle
Apache License 2.0
2 stars 15 forks source link

JCE on version 8u151 and above #24

Closed josealvrod closed 6 years ago

josealvrod commented 6 years ago

Version 8u151 introduces a new feature whereby the JCE jurisdiction policy files used by the JDK can be controlled via a new Security property. The download and install steps are no longer necessary. To enable unlimited cryptography, one can use the new crypto.policy Security property. If the new Security property (crypto.policy) is set in the java.security file, that setting will be honored. By default, the property will be undefined. If the property is undefined and the legacy JCE jurisdiction files don't exist in the legacy lib/security directory, then the default cryptographic level will remain at 'limited'. To configure the JDK to use unlimited cryptography, set the crypto.policy to a value of 'unlimited'.

But on version 8u161, while it maintain the logic of version 8u151, the default if the property is undefined is unlimited.

Due to this differences in recent versions, i think there is a need to add a way to add and change the value of this new property.

I jave been trying to do it without relying on other modules (such as stdlib with file_line), but the best approach I found is to use something similar to the Exec used for setting urandom, with a sed to replace the property. The problem is that in all versions starting from 8u151, the property is not defined and it only appears commented, making it only posible to uncoment and define once, but once its defined, the same exec wont work. Would it be possible to add the stdlib module as a dependency for this?

biemond commented 6 years ago

yeah indeed, also noticed that.

adding stdlib is no problem, already using it in my other modules

josealvrod commented 6 years ago

Thank you, i felt that adding a dependency was doing too much without asking.

josealvrod commented 6 years ago

Fixed with pull request https://github.com/biemond/biemond-jdk7/pull/25