apr-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rj...@apache.org
Subject svn commit: r1730342 - /apr/apr-util/branches/1.5.x/crypto/apr_crypto_openssl.c
Date Sun, 14 Feb 2016 14:02:55 GMT
Author: rjung
Date: Sun Feb 14 14:02:55 2016
New Revision: 1730342

URL: http://svn.apache.org/viewvc?rev=1730342&view=rev
Log:
r1728969 introduced the use of
EVP_CIPHER_CTX_new() and EVP_CIPHER_CTX_free()
in apu crypto. These OpenSSL functions have only
been added in 0.9.8b. So for older
version copy in their simple definition based
on the older API.

Modified:
    apr/apr-util/branches/1.5.x/crypto/apr_crypto_openssl.c

Modified: apr/apr-util/branches/1.5.x/crypto/apr_crypto_openssl.c
URL: http://svn.apache.org/viewvc/apr/apr-util/branches/1.5.x/crypto/apr_crypto_openssl.c?rev=1730342&r1=1730341&r2=1730342&view=diff
==============================================================================
--- apr/apr-util/branches/1.5.x/crypto/apr_crypto_openssl.c (original)
+++ apr/apr-util/branches/1.5.x/crypto/apr_crypto_openssl.c Sun Feb 14 14:02:55 2016
@@ -128,6 +128,30 @@ static apr_status_t crypto_init(apr_pool
     return APR_SUCCESS;
 }
 
+#if OPENSSL_VERSION_NUMBER < 0x0090802fL
+
+/* Code taken from OpenSSL 0.9.8b, see
+ * https://github.com/openssl/openssl/commit/cf6bc84148cb15af09b292394aaf2b45f0d5af0d
+ */
+
+EVP_CIPHER_CTX *EVP_CIPHER_CTX_new(void)
+{
+     EVP_CIPHER_CTX *ctx = OPENSSL_malloc(sizeof *ctx);
+     if (ctx)
+         EVP_CIPHER_CTX_init(ctx);
+     return ctx;
+}
+
+void EVP_CIPHER_CTX_free(EVP_CIPHER_CTX *ctx)
+{
+    if (ctx) {
+        EVP_CIPHER_CTX_cleanup(ctx);
+        OPENSSL_free(ctx);
+    }
+}
+
+#endif
+
 /**
  * @brief Clean encryption / decryption context.
  * @note After cleanup, a context is free to be reused if necessary.



Mime
View raw message