commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Bruno P. Kinoshita (JIRA)" <j...@apache.org>
Subject [jira] [Comment Edited] (CRYPTO-115) Replace fixed DLL name #define with parameter?
Date Thu, 13 Apr 2017 23:12:41 GMT

    [ https://issues.apache.org/jira/browse/CRYPTO-115?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15967657#comment-15967657
] 

Bruno P. Kinoshita edited comment on CRYPTO-115 at 4/13/17 11:12 PM:
---------------------------------------------------------------------

On my Windows system this makes two of the User Guide examples (CipherByteArrayExample.java
and RandomExample.java) fail, which is kind of discouraging :). See (\*)
For people who are stuck, you can just ignore adding the OPENSSL artefact as a factory to
the properties variable:

{code}
        //properties.setProperty(CryptoCipherFactory.CLASSES_KEY, CipherProvider.OPENSSL.getClassName());

(*) Error I get:
Exception in thread "main" java.io.IOException: java.security.GeneralSecurityException: CryptoCipher
{org.apache.commons.crypto.cipher.OpenSslCipher} is not available or transformation AES/CBC/PKCS5Padding
is not supported.
	at org.apache.commons.crypto.utils.Utils.getCipherInstance(Utils.java:130)
	at com.vito.tap.util.encryption.EncryptionToolbox.main(EncryptionToolbox.java:47)
Caused by: java.security.GeneralSecurityException: CryptoCipher {org.apache.commons.crypto.cipher.OpenSslCipher}
is not available or transformation AES/CBC/PKCS5Padding is not supported.
	at org.apache.commons.crypto.cipher.CryptoCipherFactory.getCryptoCipher(CryptoCipherFactory.java:176)
	at org.apache.commons.crypto.utils.Utils.getCipherInstance(Utils.java:128)
	... 1 more
Caused by: java.lang.RuntimeException: java.lang.reflect.InvocationTargetException
	at org.apache.commons.crypto.utils.ReflectionUtils.newInstance(ReflectionUtils.java:90)
	at org.apache.commons.crypto.cipher.CryptoCipherFactory.getCryptoCipher(CryptoCipherFactory.java:160)
	... 2 more
Caused by: java.lang.reflect.InvocationTargetException
	at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
	at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
	at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
	at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
	at org.apache.commons.crypto.utils.ReflectionUtils.newInstance(ReflectionUtils.java:88)
	... 3 more
Caused by: java.lang.RuntimeException: java.lang.UnsatisfiedLinkError: Cannot load libcrypto.dll
(126)!
	at org.apache.commons.crypto.cipher.OpenSslCipher.<init>(OpenSslCipher.java:59)
	... 8 more
Caused by: java.lang.UnsatisfiedLinkError: Cannot load libcrypto.dll (126)!
	at org.apache.commons.crypto.cipher.OpenSslNative.initIDs(Native Method)
	at org.apache.commons.crypto.cipher.OpenSsl.<clinit>(OpenSsl.java:95)
	at org.apache.commons.crypto.cipher.OpenSslCipher.<init>(OpenSslCipher.java:57)
	... 8 more
{code}


was (Author: dominique.demunck):
On my Windows system this makes two of the User Guide examples (CipherByteArrayExample.java
and RandomExample.java) fail, which is kind of discouraging :). See (*)
For people who are stuck, you can just ignore adding the OPENSSL artefact as a factory to
the properties variable:

        //properties.setProperty(CryptoCipherFactory.CLASSES_KEY, CipherProvider.OPENSSL.getClassName());

(*) Error I get:
Exception in thread "main" java.io.IOException: java.security.GeneralSecurityException: CryptoCipher
{org.apache.commons.crypto.cipher.OpenSslCipher} is not available or transformation AES/CBC/PKCS5Padding
is not supported.
	at org.apache.commons.crypto.utils.Utils.getCipherInstance(Utils.java:130)
	at com.vito.tap.util.encryption.EncryptionToolbox.main(EncryptionToolbox.java:47)
Caused by: java.security.GeneralSecurityException: CryptoCipher {org.apache.commons.crypto.cipher.OpenSslCipher}
is not available or transformation AES/CBC/PKCS5Padding is not supported.
	at org.apache.commons.crypto.cipher.CryptoCipherFactory.getCryptoCipher(CryptoCipherFactory.java:176)
	at org.apache.commons.crypto.utils.Utils.getCipherInstance(Utils.java:128)
	... 1 more
Caused by: java.lang.RuntimeException: java.lang.reflect.InvocationTargetException
	at org.apache.commons.crypto.utils.ReflectionUtils.newInstance(ReflectionUtils.java:90)
	at org.apache.commons.crypto.cipher.CryptoCipherFactory.getCryptoCipher(CryptoCipherFactory.java:160)
	... 2 more
Caused by: java.lang.reflect.InvocationTargetException
	at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
	at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
	at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
	at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
	at org.apache.commons.crypto.utils.ReflectionUtils.newInstance(ReflectionUtils.java:88)
	... 3 more
Caused by: java.lang.RuntimeException: java.lang.UnsatisfiedLinkError: Cannot load libcrypto.dll
(126)!
	at org.apache.commons.crypto.cipher.OpenSslCipher.<init>(OpenSslCipher.java:59)
	... 8 more
Caused by: java.lang.UnsatisfiedLinkError: Cannot load libcrypto.dll (126)!
	at org.apache.commons.crypto.cipher.OpenSslNative.initIDs(Native Method)
	at org.apache.commons.crypto.cipher.OpenSsl.<clinit>(OpenSsl.java:95)
	at org.apache.commons.crypto.cipher.OpenSslCipher.<init>(OpenSslCipher.java:57)
	... 8 more


> Replace fixed DLL name #define with parameter?
> ----------------------------------------------
>
>                 Key: CRYPTO-115
>                 URL: https://issues.apache.org/jira/browse/CRYPTO-115
>             Project: Commons Crypto
>          Issue Type: New Feature
>            Reporter: Sebb
>
> At present, the OpenSSL dynamic library name is provided in the config.h header file
as conditional defines.
> This is not particularly convenient as the default name for a given version of the library
may be different - for example on Windows, the DLL may be released as libeay32.dll rather
than libcrypto.dll.
> And it would be useful to be able to use different versions of the library without needing
to copy/rename files.



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)

Mime
View raw message