make depend
[oweals/openssl.git] / crypto / bn / bn_gf2m.c
index 527b0fa15be51ada3725d3d77704b26e8f8619ff..573156accb4231062a683587a899a3f9afe315dd 100644 (file)
@@ -94,6 +94,8 @@
 #include "cryptlib.h"
 #include "bn_lcl.h"
 
+#ifndef OPENSSL_NO_EC2M
+
 /* Maximum number of iterations before BN_GF2m_mod_solve_quad_arr should fail. */
 #define MAX_ITERATIONS 50
 
@@ -545,6 +547,7 @@ int BN_GF2m_mod_inv(BIGNUM *r, const BIGNUM *a, const BIGNUM *p, BN_CTX *ctx)
                {
                while (!BN_is_odd(u))
                        {
+                       if (BN_is_zero(u)) goto err;
                        if (!BN_rshift1(u, u)) goto err;
                        if (BN_is_odd(b))
                                {
@@ -1032,3 +1035,4 @@ int BN_GF2m_arr2poly(const int p[], BIGNUM *a)
        return 1;
        }
 
+#endif