make update
[oweals/openssl.git] / crypto / engine / hw_ncipher.c
index 408db08b9849a28c94578f4759dc68ab1db8cc9c..39cf7f56dc836f22613d52fe21ed3408463be690 100644 (file)
@@ -417,7 +417,6 @@ static int bind_helper(ENGINE *e)
                        !ENGINE_set_DH(e, &hwcrhk_dh) ||
 #endif
                        !ENGINE_set_RAND(e, &hwcrhk_rand) ||
-                       !ENGINE_set_BN_mod_exp(e, hwcrhk_mod_exp) ||
                        !ENGINE_set_destroy_function(e, hwcrhk_destroy) ||
                        !ENGINE_set_init_function(e, hwcrhk_init) ||
                        !ENGINE_set_finish_function(e, hwcrhk_finish) ||
@@ -454,9 +453,7 @@ static int bind_helper(ENGINE *e)
        return 1;
        }
 
-/* As this is only ever called once, there's no need for locking
- * (indeed - the lock will already be held by our caller!!!) */
-ENGINE *ENGINE_ncipher(void)
+static ENGINE *engine_ncipher(void)
        {
        ENGINE *ret = ENGINE_new();
        if(!ret)
@@ -469,6 +466,16 @@ ENGINE *ENGINE_ncipher(void)
        return ret;
        }
 
+void ENGINE_load_chil(void)
+       {
+       /* Copied from eng_[openssl|dyn].c */
+       ENGINE *toadd = engine_ncipher();
+       if(!toadd) return;
+       ENGINE_add(toadd);
+       ENGINE_free(toadd);
+       ERR_clear_error();
+       }
+
 /* This is a process-global DSO handle used for loading and unloading
  * the HWCryptoHook library. NB: This is only set (or unset) during an
  * init() or finish() call (reference counts permitting) and they're
@@ -1197,8 +1204,8 @@ static int hwcrhk_mutex_init(HWCryptoHook_Mutex* mt,
        {
        mt->lockid = CRYPTO_get_new_dynlockid();
        if (mt->lockid == 0)
-               return -1;
-       return 0;
+               return 1; /* failure */
+       return 0; /* success */
        }
 
 static int hwcrhk_mutex_lock(HWCryptoHook_Mutex *mt)