More updatdes from stable branch.
authorDr. Stephen Henson <steve@openssl.org>
Sat, 13 Sep 2008 22:09:48 +0000 (22:09 +0000)
committerDr. Stephen Henson <steve@openssl.org>
Sat, 13 Sep 2008 22:09:48 +0000 (22:09 +0000)
crypto/bn/bn_gf2m.c
crypto/engine/eng_cnf.c
crypto/engine/eng_padlock.c

index 6a793857e1305f19a548674a2d69a4bb7abb3111..306f029f2789c907c6fcc949a760622f6b977aa8 100644 (file)
@@ -384,7 +384,11 @@ int BN_GF2m_mod_arr(BIGNUM *r, const BIGNUM *a, const unsigned int p[])
                if (zz == 0) break;
                d1 = BN_BITS2 - d0;
                
-               if (d0) z[dN] = (z[dN] << d1) >> d1; /* clear up the top d1 bits */
+               /* clear up the top d1 bits */
+               if (d0)
+                       z[dN] = (z[dN] << d1) >> d1;
+               else
+                       z[dN] = 0;
                z[0] ^= zz; /* reduction t^0 component */
 
                for (k = 1; p[k] != 0; k++)
index a97e01e619ff024d7e3c45a52e2b98dee195aba6..8417ddaaef8b0606dd3b0c277ee26729d92a0cdf 100644 (file)
@@ -98,6 +98,8 @@ static int int_engine_configure(char *name, char *value, const CONF *cnf)
        CONF_VALUE *ecmd;
        char *ctrlname, *ctrlvalue;
        ENGINE *e = NULL;
+        int soft = 0;
+
        name = skip_dot(name);
 #ifdef ENGINE_CONF_DEBUG
        fprintf(stderr, "Configuring engine %s\n", name);
@@ -125,6 +127,8 @@ static int int_engine_configure(char *name, char *value, const CONF *cnf)
                /* Override engine name to use */
                if (!strcmp(ctrlname, "engine_id"))
                        name = ctrlvalue;
+                else if (!strcmp(ctrlname, "soft_load"))
+                        soft = 1;
                /* Load a dynamic ENGINE */
                else if (!strcmp(ctrlname, "dynamic_path"))
                        {
@@ -147,6 +151,11 @@ static int int_engine_configure(char *name, char *value, const CONF *cnf)
                        if (!e)
                                {
                                e = ENGINE_by_id(name);
+                                if (!e && soft)
+                                        {
+                                        ERR_clear_error();
+                                        return 1;
+                                        }
                                if (!e)
                                        return 0;
                                }
index 3e4fc60c8e226643e091ebe32dfa1d03161a0a10..1ba9d85db4575095157852b0612598b4e4520c41 100644 (file)
@@ -234,8 +234,8 @@ padlock_bind_fn(ENGINE *e, const char *id)
        return 1;
 }
 
-IMPLEMENT_DYNAMIC_CHECK_FN()
-IMPLEMENT_DYNAMIC_BIND_FN(padlock_bind_fn)
+IMPLEMENT_DYNAMIC_CHECK_FN ();
+IMPLEMENT_DYNAMIC_BIND_FN (padlock_bind_fn);
 #endif /* DYNAMIC_ENGINE */
 
 /* ===== Here comes the "real" engine ===== */