httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From minf...@apache.org
Subject svn commit: r645187 - /httpd/httpd/trunk/modules/session/mod_session_crypto.c
Date Sat, 05 Apr 2008 23:42:10 GMT
Author: minfrin
Date: Sat Apr  5 16:42:08 2008
New Revision: 645187

URL: http://svn.apache.org/viewvc?rev=645187&view=rev
Log:
Remove an unnecessary config structure lookup during encrypt and decrypt. [Ruediger Pluem]

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=645187&r1=645186&r2=645187&view=diff
==============================================================================
--- httpd/httpd/trunk/modules/session/mod_session_crypto.c (original)
+++ httpd/httpd/trunk/modules/session/mod_session_crypto.c Sat Apr  5 16:42:08 2008
@@ -122,7 +122,8 @@
  *
  * Returns APR_SUCCESS if successful.
  */
-static apr_status_t encrypt_string(request_rec * r, const char *in, char **out)
+static apr_status_t encrypt_string(request_rec * r, session_crypto_dir_conf *conf,
+                                   const char *in, char **out)
 {
 #if APU_MAJOR_VERSION > 1 || (APU_MAJOR_VERSION == 1 && APU_MINOR_VERSION >=
3)
     apr_status_t res;
@@ -133,9 +134,6 @@
     apr_size_t encryptlen, tlen;
     char *base64;
 
-    session_crypto_dir_conf *conf = ap_get_module_config(r->per_dir_config,
-                                                    &session_crypto_module);
-
     /* by default, return an empty string */
     *out = "";
 
@@ -199,7 +197,8 @@
  *
  * Returns APR_SUCCESS if successful.
  */
-static apr_status_t decrypt_string(request_rec * r, const char *in, char **out)
+static apr_status_t decrypt_string(request_rec * r, session_crypto_dir_conf *conf,
+                                   const char *in, char **out)
 {
 #if APU_MAJOR_VERSION > 1 || (APU_MAJOR_VERSION == 1 && APU_MINOR_VERSION >=
3)
     apr_status_t res;
@@ -211,9 +210,6 @@
     apr_size_t decodedlen;
     char *decoded;
 
-    session_crypto_dir_conf *conf = ap_get_module_config(r->per_dir_config,
-                                                    &session_crypto_module);
-
     res = crypt_init(r, &f, &key, conf);
     if (res != APR_SUCCESS) {
         return res;
@@ -279,7 +275,7 @@
                                                     &session_crypto_module);
 
     if (conf->passphrase_set || conf->certfile_set) {
-        res = encrypt_string(r, z->encoded, &encoded);
+        res = encrypt_string(r, conf, z->encoded, &encoded);
         if (res != OK) {
             ap_log_rerror(APLOG_MARK, APLOG_DEBUG, res, r, LOG_PREFIX
                           "encrypt session failed");
@@ -307,7 +303,7 @@
                                                     &session_crypto_module);
 
     if ((conf->passphrase_set || conf->certfile_set) && z->encoded) {
-        res = decrypt_string(r, z->encoded, &encoded);
+        res = decrypt_string(r, conf, z->encoded, &encoded);
         if (res != APR_SUCCESS) {
             ap_log_rerror(APLOG_MARK, APLOG_ERR, res, r, LOG_PREFIX
                           "decrypt session failed, wrong passphrase?");



Mime
View raw message