aboutsummaryrefslogtreecommitdiffstats
path: root/tests/test-aes.c
diff options
context:
space:
mode:
authorJouni Malinen <j@w1.fi>2009-12-05 20:32:45 (GMT)
committerJouni Malinen <j@w1.fi>2009-12-05 20:32:45 (GMT)
commit1767f7c11742769254067130058fb2a56be68147 (patch)
tree09fb05bb33df555af02d7f85183a68d0861c8590 /tests/test-aes.c
parent36ee258db7ce8f02cd30187988941cc3f7587899 (diff)
downloadhostap-1767f7c11742769254067130058fb2a56be68147.zip
hostap-1767f7c11742769254067130058fb2a56be68147.tar.gz
hostap-1767f7c11742769254067130058fb2a56be68147.tar.bz2
Resolve compiler warnings in the test programs
Diffstat (limited to 'tests/test-aes.c')
-rw-r--r--tests/test-aes.c17
1 files changed, 9 insertions, 8 deletions
diff --git a/tests/test-aes.c b/tests/test-aes.c
index 8c0b152..f596a1e 100644
--- a/tests/test-aes.c
+++ b/tests/test-aes.c
@@ -148,14 +148,14 @@ static int test_cbc(void)
break;
}
memcpy(buf, tv->plain, tv->len);
- aes_128_cbc_encrypt(tv->key, tv->iv, buf, tv->len);
- if (memcmp(buf, tv->cipher, tv->len) != 0) {
+ if (aes_128_cbc_encrypt(tv->key, tv->iv, buf, tv->len) ||
+ memcmp(buf, tv->cipher, tv->len) != 0) {
printf("AES-CBC encrypt %d failed\n", i);
ret++;
}
memcpy(buf, tv->cipher, tv->len);
- aes_128_cbc_decrypt(tv->key, tv->iv, buf, tv->len);
- if (memcmp(buf, tv->plain, tv->len) != 0) {
+ if (aes_128_cbc_decrypt(tv->key, tv->iv, buf, tv->len) ||
+ memcmp(buf, tv->plain, tv->len) != 0) {
printf("AES-CBC decrypt %d failed\n", i);
ret++;
}
@@ -272,8 +272,8 @@ int main(int argc, char *argv[])
for (i = 0; i < sizeof(test_vectors) / sizeof(test_vectors[0]); i++) {
tv = &test_vectors[i];
- omac1_aes_128(tv->k, tv->msg, tv->msg_len, result);
- if (memcmp(result, tv->tag, 16) != 0) {
+ if (omac1_aes_128(tv->k, tv->msg, tv->msg_len, result) ||
+ memcmp(result, tv->tag, 16) != 0) {
printf("OMAC1-AES-128 test vector %d failed\n", i);
ret++;
}
@@ -287,8 +287,9 @@ int main(int argc, char *argv[])
addr[1] = tv->msg + 1;
len[1] = tv->msg_len - 1;
- omac1_aes_128_vector(tv->k, 2, addr, len, result);
- if (memcmp(result, tv->tag, 16) != 0) {
+ if (omac1_aes_128_vector(tv->k, 2, addr, len,
+ result) ||
+ memcmp(result, tv->tag, 16) != 0) {
printf("OMAC1-AES-128(vector) test vector %d "
"failed\n", i);
ret++;