From 6b1b012e2cbb9abbf5a46b693e794af9df2eab2c Mon Sep 17 00:00:00 2001 From: Luke Taylor Date: Thu, 20 Jan 2011 02:13:33 +0000 Subject: [PATCH] Added check for maximum AES key size in crypto.gradle to skip tests if limited strength crypto policy files are in place. --- crypto/crypto.gradle | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/crypto/crypto.gradle b/crypto/crypto.gradle index cabe085556..6b096821a7 100644 --- a/crypto/crypto.gradle +++ b/crypto/crypto.gradle @@ -1,13 +1,12 @@ // crypto module build file -jdkVersion = System.properties['java.version'] -javaClassVersion = System.properties['java.class.version'] -println "JDK Version is $jdkVersion, class version is $javaClassVersion" - -isJdk6 = jdkVersion.startsWith('1.6') +// jdkVersion = System.properties['java.version'] +// isJdk6 = jdkVersion >= '1.6' +int maxAESKeySize = javax.crypto.Cipher.getMaxAllowedKeyLength('AES') test { - if (!isJdk6) { + if (maxAESKeySize < 256) { + println "AES keysize limited to $maxAESKeySize, skipping EncryptorsTests" exclude '**/EncryptorsTests.class' } }