]> git.ipfire.org Git - thirdparty/apache/httpd.git/commitdiff
Add API protection against the deprecated v1.4 apr_crypto API.
authorGraham Leggett <minfrin@apache.org>
Sun, 15 May 2011 12:44:25 +0000 (12:44 +0000)
committerGraham Leggett <minfrin@apache.org>
Sun, 15 May 2011 12:44:25 +0000 (12:44 +0000)
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1103351 13f79535-47bb-0310-9956-ffa450edef68

modules/session/mod_session_crypto.c

index d78a9480b87ad3a5cb019cb26091caa05ad67cf6..a8d086d4adb8a2e308e57d6109e418e9f49aa900 100644 (file)
@@ -116,7 +116,7 @@ static apr_status_t crypt_init(request_rec * 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_config(apr_pool_t * p, char *dummy)
     (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(cmd_parms * cmd, void *config, const ch
             }
             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 {