forked from ConSol/sakuli
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ConSol#233 ConSol#255 add JCE policy check to install routine - OpenJ…
…DK of centos & ubuntu supports JCE
- Loading branch information
Tobias Schneck
committed
Jan 13, 2017
1 parent
1745179
commit 6783f75
Showing
7 changed files
with
62 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,6 @@ | ||
#!/usr/bin/env bash | ||
### every exit != 0 fails the script | ||
set -e | ||
|
||
echo "Install Java JRE 8" | ||
|
||
|
37 changes: 37 additions & 0 deletions
37
docker/sakuli-client/src/common/install/java_jce_test/KeyLengthDetector.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
/* | ||
* Sakuli - Testing and Monitoring-Tool for Websites and common UIs. | ||
* | ||
* Copyright 2013 - 2017 the original author or authors. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
import javax.crypto.Cipher; | ||
import java.security.NoSuchAlgorithmException; | ||
|
||
public class KeyLengthDetector { | ||
public static void main(String[] args) throws Exception { | ||
int allowedKeyLength = 0; | ||
|
||
try { | ||
allowedKeyLength = Cipher.getMaxAllowedKeyLength("AES"); | ||
} catch (NoSuchAlgorithmException e) { | ||
e.printStackTrace(); | ||
} | ||
|
||
if (allowedKeyLength <= 256) { | ||
throw new Exception("Detect the allowed size of AES keys on the JVM is <= 256. So in that case the Gearman encryption feature can not be supported! To fix it JCE unlimted stregth files are needed."); | ||
} | ||
System.out.println("The allowed key length for AES is: " + allowedKeyLength); | ||
} | ||
} |
Binary file added
BIN
+1.18 KB
docker/sakuli-client/src/common/install/java_jce_test/classes/KeyLengthDetector.class
Binary file not shown.
18 changes: 18 additions & 0 deletions
18
docker/sakuli-client/src/common/install/java_jce_test/jce_test.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
#!/usr/bin/env bash | ||
### every exit != 0 fails the script | ||
set -e | ||
|
||
cd $(dirname `which $0`) | ||
scriptdir=$(pwd) | ||
echo "DIR: $scriptdir" | ||
|
||
## check if installed Java JRE is supported by JCE | ||
java -cp $scriptdir/classes KeyLengthDetector | ||
|
||
### JCE Download page: http://www.oracle.com/technetwork/java/javase/downloads/index.html | ||
#mkdir -p /tmp/java-jce \ | ||
# && cd /tmp/java-jce \ | ||
# && wget --no-check-certificate -c --header "Cookie: oraclelicense=accept-securebackup-cookie" http://download.oracle.com/otn-pub/java/jce/8/jce_policy-8.zip \ | ||
# && unzip *.zip \ | ||
# && for i in $(find /usr/lib/jvm -name "security"); do /bin/cp -v -f UnlimitedJCEPolicyJDK8/*.jar $i; done \ | ||
# && rm -rf /tmp/java-jce |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,6 @@ | ||
#!/usr/bin/env bash | ||
### every exit != 0 fails the script | ||
set -e | ||
|
||
echo "Install Java JRE 8" | ||
|
||
|