You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@apr.apache.org by mi...@apache.org on 2009/01/03 18:30:08 UTC

svn commit: r731033 - in /apr/apr-util/trunk: CHANGES crypto/apr_crypto.c crypto/apr_crypto_nss.c crypto/apr_crypto_openssl.c include/private/apr_crypto_internal.h

Author: minfrin
Date: Sat Jan  3 09:30:06 2009
New Revision: 731033

URL: http://svn.apache.org/viewvc?rev=731033&view=rev
Log:
Make sure that the underlying result code during driver initialisation
is exposed to the caller.

Modified:
    apr/apr-util/trunk/CHANGES
    apr/apr-util/trunk/crypto/apr_crypto.c
    apr/apr-util/trunk/crypto/apr_crypto_nss.c
    apr/apr-util/trunk/crypto/apr_crypto_openssl.c
    apr/apr-util/trunk/include/private/apr_crypto_internal.h

Modified: apr/apr-util/trunk/CHANGES
URL: http://svn.apache.org/viewvc/apr/apr-util/trunk/CHANGES?rev=731033&r1=731032&r2=731033&view=diff
==============================================================================
--- apr/apr-util/trunk/CHANGES [utf-8] (original)
+++ apr/apr-util/trunk/CHANGES [utf-8] Sat Jan  3 09:30:06 2009
@@ -1,6 +1,9 @@
                                                      -*- coding: utf-8 -*-
 Changes with APR-util 1.4.0
 
+  *) Make sure that the underlying result code during driver initialisation
+     is exposed to the caller. [Graham Leggett]
+
   *) Provide a mechanism to provide the recommended crypto driver to
      calling application. [Graham Leggett]
 

Modified: apr/apr-util/trunk/crypto/apr_crypto.c
URL: http://svn.apache.org/viewvc/apr/apr-util/trunk/crypto/apr_crypto.c?rev=731033&r1=731032&r2=731033&view=diff
==============================================================================
--- apr/apr-util/trunk/crypto/apr_crypto.c (original)
+++ apr/apr-util/trunk/crypto/apr_crypto.c Sat Jan  3 09:30:06 2009
@@ -111,6 +111,7 @@
     apr_dso_handle_sym_t symbol;
 #endif
     apr_status_t rv;
+    int rc = 0;
 
 #if APU_DSO_BUILD
     rv = apu_dso_mutex_lock();
@@ -151,7 +152,7 @@
     }
     *driver = symbol;
     if ((*driver)->init) {
-        (*driver)->init(pool, params);
+        rv = (*driver)->init(pool, params, &rc);
     }
     name = apr_pstrdup(pool, name);
     apr_hash_set(drivers, name, APR_HASH_KEY_STRING, *driver);
@@ -165,6 +166,7 @@
             apr_dso_error(dso, buffer, ERROR_SIZE - 1);
             err->msg = buffer;
             err->reason = modname;
+            err->rc = rc;
             *result = err;
         }
     }

Modified: apr/apr-util/trunk/crypto/apr_crypto_nss.c
URL: http://svn.apache.org/viewvc/apr/apr-util/trunk/crypto/apr_crypto_nss.c?rev=731033&r1=731032&r2=731033&view=diff
==============================================================================
--- apr/apr-util/trunk/crypto/apr_crypto_nss.c (original)
+++ apr/apr-util/trunk/crypto/apr_crypto_nss.c Sat Jan  3 09:30:06 2009
@@ -78,7 +78,7 @@
 /**
  * Initialise the crypto library and perform one time initialisation.
  */
-static apr_status_t crypto_init(apr_pool_t *pool, const apr_array_header_t *params)
+static apr_status_t crypto_init(apr_pool_t *pool, const apr_array_header_t *params, int *rc)
 {
     SECStatus s;
     const char *dir = NULL;
@@ -127,6 +127,9 @@
         s = NSS_NoDB_Init(NULL);
     }
     if (s != SECSuccess) {
+        if (rc) {
+            *rc = PR_GetError();
+        }
         return APR_ECRYPT;
     }
 
@@ -386,7 +389,7 @@
 
     key->ivSize = PK11_GetIVLength(key->cipherMech);
     if (ivSize) {
-    *ivSize = key->ivSize;
+        *ivSize = key->ivSize;
     }
 
     return rv;

Modified: apr/apr-util/trunk/crypto/apr_crypto_openssl.c
URL: http://svn.apache.org/viewvc/apr/apr-util/trunk/crypto/apr_crypto_openssl.c?rev=731033&r1=731032&r2=731033&view=diff
==============================================================================
--- apr/apr-util/trunk/crypto/apr_crypto_openssl.c (original)
+++ apr/apr-util/trunk/crypto/apr_crypto_openssl.c Sat Jan  3 09:30:06 2009
@@ -77,7 +77,7 @@
  * Initialise the crypto library and perform one time initialisation.
  */
 static apr_status_t crypto_init(apr_pool_t *pool,
-        const apr_array_header_t *params) {
+        const apr_array_header_t *params, int *rc) {
     CRYPTO_malloc_init();
     ERR_load_crypto_strings();
     /* SSL_load_error_strings(); */

Modified: apr/apr-util/trunk/include/private/apr_crypto_internal.h
URL: http://svn.apache.org/viewvc/apr/apr-util/trunk/include/private/apr_crypto_internal.h?rev=731033&r1=731032&r2=731033&view=diff
==============================================================================
--- apr/apr-util/trunk/include/private/apr_crypto_internal.h (original)
+++ apr/apr-util/trunk/include/private/apr_crypto_internal.h Sat Jan  3 09:30:06 2009
@@ -38,7 +38,7 @@
      * @param pool The pool to register the cleanup in.
      * @param params An array of optional init parameters.
      */
-    apr_status_t (*init)(apr_pool_t *pool, const apr_array_header_t *params);
+    apr_status_t (*init)(apr_pool_t *pool, const apr_array_header_t *params, int *rc);
 
     /**
      * @brief Create a context for supporting encryption. Keys, certificates,