Updated to hostap_2_6
[mech_eap.git] / libeap / src / crypto / sha1-internal.c
index 24bc3ff..ffcba66 100644 (file)
@@ -33,6 +33,9 @@ int sha1_vector(size_t num_elem, const u8 *addr[], const size_t *len, u8 *mac)
        SHA1_CTX ctx;
        size_t i;
 
+       if (TEST_FAIL())
+               return -1;
+
        SHA1Init(&ctx);
        for (i = 0; i < num_elem; i++)
                SHA1Update(&ctx, addr[i], len[i]);
@@ -294,7 +297,6 @@ void SHA1Final(unsigned char digest[20], SHA1_CTX* context)
                         255);
        }
        /* Wipe variables */
-       i = 0;
        os_memset(context->buffer, 0, 64);
        os_memset(context->state, 0, 20);
        os_memset(context->count, 0, 8);