You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cassandra.apache.org by Mahdi Mohammadi <ma...@gmail.com> on 2016/05/17 21:58:25 UTC

Error running tests: java.security.InvalidKeyException: Illegal key size

I can successfully compile cassandra source using `ant` command but when
running `ant test` for EncryptionUtilsTest I am getting this error:

*    [junit] ------------- Standard Output ---------------*
*    [junit] ERROR 21:55:32 SLF4J: stderr*
*    [junit] INFO  21:55:32 initializing CipherFactory*
*    [junit] INFO  21:55:32 initializing keystore from file
test/conf/cassandra.keystore*
*    [junit] INFO  21:55:32 loading secret key for alias testing:1*
*    [junit] ERROR 21:55:32 could not build cipher*
*    [junit] java.security.InvalidKeyException: Illegal key size*
*    [junit]     at javax.crypto.Cipher.checkCryptoPerm(Cipher.java:1039)
~[na:1.8.0_71]*
*    [junit]     at javax.crypto.Cipher.implInit(Cipher.java:805)
~[na:1.8.0_71]*
*    [junit]     at javax.crypto.Cipher.chooseProvider(Cipher.java:864)
~[na:1.8.0_71]*
*    [junit]     at javax.crypto.Cipher.init(Cipher.java:1396)
~[na:1.8.0_71]*
*    [junit]     at javax.crypto.Cipher.init(Cipher.java:1327)
~[na:1.8.0_71]*
*    [junit]     at
org.apache.cassandra.security.CipherFactory.buildCipher(CipherFactory.java:133)
[main/:na]*
*    [junit]     at
org.apache.cassandra.security.CipherFactory.getEncryptor(CipherFactory.java:107)
[main/:na]*
*    [junit]     at
org.apache.cassandra.security.EncryptionUtilsTest.fullRoundTrip(EncryptionUtilsTest.java:102)
[classes/:na]*
*    [junit]     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native
Method) ~[na:1.8.0_74]*
*    [junit]     at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
~[na:1.8.0_74]*
*    [junit]     at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
~[na:1.8.0_74]*
*    [junit]     at java.lang.reflect.Method.invoke(Method.java:498)
~[na:1.8.0_74]*
*    [junit]     at
org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:44)
[junit-4.6.jar:na]*


Any idea?


Best Regards

Re: Error running tests: java.security.InvalidKeyException: Illegal key size

Posted by Mahdi Mohammadi <ma...@gmail.com>.
Thanks. That error is fixed but I still get other test failures. Will send
a separate email.

Best Regards

On Wed, May 18, 2016 at 5:18 PM, Mike Adamson <ma...@datastax.com> wrote:

> Do you have the JCE unlimited strength policy files installed in you JDK?
>
>
> http://www.oracle.com/technetwork/java/javase/downloads/jce8-download-2133166.html
>
> On Tue, 17 May 2016 at 22:58 Mahdi Mohammadi <ma...@gmail.com> wrote:
>
> > I can successfully compile cassandra source using `ant` command but when
> > running `ant test` for EncryptionUtilsTest I am getting this error:
> >
> > *    [junit] ------------- Standard Output ---------------*
> > *    [junit] ERROR 21:55:32 SLF4J: stderr*
> > *    [junit] INFO  21:55:32 initializing CipherFactory*
> > *    [junit] INFO  21:55:32 initializing keystore from file
> > test/conf/cassandra.keystore*
> > *    [junit] INFO  21:55:32 loading secret key for alias testing:1*
> > *    [junit] ERROR 21:55:32 could not build cipher*
> > *    [junit] java.security.InvalidKeyException: Illegal key size*
> > *    [junit]     at javax.crypto.Cipher.checkCryptoPerm(Cipher.java:1039)
> > ~[na:1.8.0_71]*
> > *    [junit]     at javax.crypto.Cipher.implInit(Cipher.java:805)
> > ~[na:1.8.0_71]*
> > *    [junit]     at javax.crypto.Cipher.chooseProvider(Cipher.java:864)
> > ~[na:1.8.0_71]*
> > *    [junit]     at javax.crypto.Cipher.init(Cipher.java:1396)
> > ~[na:1.8.0_71]*
> > *    [junit]     at javax.crypto.Cipher.init(Cipher.java:1327)
> > ~[na:1.8.0_71]*
> > *    [junit]     at
> >
> >
> org.apache.cassandra.security.CipherFactory.buildCipher(CipherFactory.java:133)
> > [main/:na]*
> > *    [junit]     at
> >
> >
> org.apache.cassandra.security.CipherFactory.getEncryptor(CipherFactory.java:107)
> > [main/:na]*
> > *    [junit]     at
> >
> >
> org.apache.cassandra.security.EncryptionUtilsTest.fullRoundTrip(EncryptionUtilsTest.java:102)
> > [classes/:na]*
> > *    [junit]     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native
> > Method) ~[na:1.8.0_74]*
> > *    [junit]     at
> >
> >
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
> > ~[na:1.8.0_74]*
> > *    [junit]     at
> >
> >
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
> > ~[na:1.8.0_74]*
> > *    [junit]     at java.lang.reflect.Method.invoke(Method.java:498)
> > ~[na:1.8.0_74]*
> > *    [junit]     at
> >
> >
> org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:44)
> > [junit-4.6.jar:na]*
> >
> >
> > Any idea?
> >
> >
> > Best Regards
> >
>

Re: Error running tests: java.security.InvalidKeyException: Illegal key size

Posted by Mike Adamson <ma...@datastax.com>.
Do you have the JCE unlimited strength policy files installed in you JDK?

http://www.oracle.com/technetwork/java/javase/downloads/jce8-download-2133166.html

On Tue, 17 May 2016 at 22:58 Mahdi Mohammadi <ma...@gmail.com> wrote:

> I can successfully compile cassandra source using `ant` command but when
> running `ant test` for EncryptionUtilsTest I am getting this error:
>
> *    [junit] ------------- Standard Output ---------------*
> *    [junit] ERROR 21:55:32 SLF4J: stderr*
> *    [junit] INFO  21:55:32 initializing CipherFactory*
> *    [junit] INFO  21:55:32 initializing keystore from file
> test/conf/cassandra.keystore*
> *    [junit] INFO  21:55:32 loading secret key for alias testing:1*
> *    [junit] ERROR 21:55:32 could not build cipher*
> *    [junit] java.security.InvalidKeyException: Illegal key size*
> *    [junit]     at javax.crypto.Cipher.checkCryptoPerm(Cipher.java:1039)
> ~[na:1.8.0_71]*
> *    [junit]     at javax.crypto.Cipher.implInit(Cipher.java:805)
> ~[na:1.8.0_71]*
> *    [junit]     at javax.crypto.Cipher.chooseProvider(Cipher.java:864)
> ~[na:1.8.0_71]*
> *    [junit]     at javax.crypto.Cipher.init(Cipher.java:1396)
> ~[na:1.8.0_71]*
> *    [junit]     at javax.crypto.Cipher.init(Cipher.java:1327)
> ~[na:1.8.0_71]*
> *    [junit]     at
>
> org.apache.cassandra.security.CipherFactory.buildCipher(CipherFactory.java:133)
> [main/:na]*
> *    [junit]     at
>
> org.apache.cassandra.security.CipherFactory.getEncryptor(CipherFactory.java:107)
> [main/:na]*
> *    [junit]     at
>
> org.apache.cassandra.security.EncryptionUtilsTest.fullRoundTrip(EncryptionUtilsTest.java:102)
> [classes/:na]*
> *    [junit]     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native
> Method) ~[na:1.8.0_74]*
> *    [junit]     at
>
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
> ~[na:1.8.0_74]*
> *    [junit]     at
>
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
> ~[na:1.8.0_74]*
> *    [junit]     at java.lang.reflect.Method.invoke(Method.java:498)
> ~[na:1.8.0_74]*
> *    [junit]     at
>
> org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:44)
> [junit-4.6.jar:na]*
>
>
> Any idea?
>
>
> Best Regards
>