You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@httpd.apache.org by mi...@apache.org on 2011/05/15 14:44:26 UTC

svn commit: r1103351 - /httpd/httpd/trunk/modules/session/mod_session_crypto.c

Author: minfrin
Date: Sun May 15 12:44:25 2011
New Revision: 1103351

URL: http://svn.apache.org/viewvc?rev=1103351&view=rev
Log:
Add API protection against the deprecated v1.4 apr_crypto API.

Modified:
    httpd/httpd/trunk/modules/session/mod_session_crypto.c

Modified: httpd/httpd/trunk/modules/session/mod_session_crypto.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/session/mod_session_crypto.c?rev=1103351&r1=1103350&r2=1103351&view=diff
==============================================================================
--- httpd/httpd/trunk/modules/session/mod_session_crypto.c (original)
+++ httpd/httpd/trunk/modules/session/mod_session_crypto.c Sun May 15 12:44:25 2011
@@ -116,7 +116,7 @@ static apr_status_t crypt_init(request_r
         res = apr_crypto_passphrase(driver, r->pool, *f, dconf->passphrase,
                 strlen(dconf->passphrase),
                 (unsigned char *) salt, salt ? sizeof(apr_uuid_t) : 0,
-                dconf->cipher, APR_MODE_CBC, 1, 4096, key, ivSize);
+                dconf->cipher, MODE_CBC, 1, 4096, key, ivSize);
 #else
         res = apr_crypto_passphrase(key, ivSize, dconf->passphrase,
                 strlen(dconf->passphrase),
@@ -498,7 +498,11 @@ static void *create_session_crypto_dir_c
     (session_crypto_dir_conf *) apr_pcalloc(p, sizeof(session_crypto_dir_conf));
 
     /* default cipher AES256-SHA */
+#if CRYPTO_VERSION < 200
+    new->cipher = KEY_AES_256;
+#else
     new->cipher = APR_KEY_AES_256;
+#endif
 
     return (void *) new;
 }
@@ -612,11 +616,19 @@ static const char *set_crypto_passphrase
             }
             else if (!strcasecmp(word, "cipher")) {
                 if (!strcasecmp(val, "3des192")) {
+#if CRYPTO_VERSION < 200
+                    dconf->cipher = KEY_3DES_192;
+#else
                     dconf->cipher = APR_KEY_3DES_192;
+#endif
                     dconf->cipher_set = 1;
                 }
                 else if (!strcasecmp(val, "aes256")) {
+#if CRYPTO_VERSION < 200
+                    dconf->cipher = KEY_AES_256;
+#else
                     dconf->cipher = APR_KEY_AES_256;
+#endif
                     dconf->cipher_set = 1;
                 }
                 else {