Merged the hostap_2.6 updates, and the Leap of Faith work, from the hostap_update...
[mech_eap.git] / libeap / src / crypto / aes-cbc.c
index bd74769..0835f2c 100644 (file)
@@ -3,14 +3,8 @@
  *
  * Copyright (c) 2003-2007, Jouni Malinen <j@w1.fi>
  *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 as
- * published by the Free Software Foundation.
- *
- * Alternatively, this software may be distributed under the terms of BSD
- * license.
- *
- * See README and COPYING for more details.
+ * This software may be distributed under the terms of the BSD license.
+ * See README for more details.
  */
 
 #include "includes.h"
@@ -34,6 +28,9 @@ int aes_128_cbc_encrypt(const u8 *key, const u8 *iv, u8 *data, size_t data_len)
        u8 *pos = data;
        int i, j, blocks;
 
+       if (TEST_FAIL())
+               return -1;
+
        ctx = aes_encrypt_init(key, 16);
        if (ctx == NULL)
                return -1;
@@ -67,6 +64,9 @@ int aes_128_cbc_decrypt(const u8 *key, const u8 *iv, u8 *data, size_t data_len)
        u8 *pos = data;
        int i, j, blocks;
 
+       if (TEST_FAIL())
+               return -1;
+
        ctx = aes_decrypt_init(key, 16);
        if (ctx == NULL)
                return -1;