Uploaded image for project: 'Commons Crypto'
  1. Commons Crypto
  2. CRYPTO-138

CipherByteArrayExample fails on openssl 1.1.0g with java.lang.UnsatisfiedLinkError: EVP_CIPHER_CTX_cleanup

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 1.0.0
    • 1.1.0
    • Cipher
    • None

    Description

      running sample code from :

      https://commons.apache.org/proper/commons-crypto/xref-test/org/apache/commons/crypto/examples/CipherByteArrayExample.html

      failed with this error message:

       

      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)
          ... 10 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)
          ... 11 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)
          ... 12 more
      Caused by: java.lang.RuntimeException: java.lang.UnsatisfiedLinkError: EVP_CIPHER_CTX_cleanup
          at org.apache.commons.crypto.cipher.OpenSslCipher.<init>(OpenSslCipher.java:59)
          ... 17 more
      Caused by: java.lang.UnsatisfiedLinkError: EVP_CIPHER_CTX_cleanup
          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)
          ... 17 more

      Process finished with exit code 1

       

       

      i guess it has something to do with changes of openssl from 1.0 -> 1.1

      https://stackoverflow.com/questions/26345175/correct-way-to-free-allocate-the-context-in-the-openssl

       

       

       

       

       

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              khiemuatgooglemail kim
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: