tests: crypto_hash_finish() failure in eap_pwd_kdf()
Signed-off-by: Jouni Malinen <j@w1.fi>
This commit is contained in:
parent
e8d8f4b680
commit
52b1cb5d73
6 changed files with 27 additions and 11 deletions
|
@ -310,6 +310,9 @@ int crypto_hash_finish(struct crypto_hash *ctx, u8 *mac, size_t *len)
|
||||||
|
|
||||||
os_free(ctx);
|
os_free(ctx);
|
||||||
|
|
||||||
|
if (TEST_FAIL())
|
||||||
|
return -1;
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -278,6 +278,9 @@ int crypto_hash_finish(struct crypto_hash *ctx, u8 *mac, size_t *len)
|
||||||
|
|
||||||
os_free(ctx);
|
os_free(ctx);
|
||||||
|
|
||||||
|
if (TEST_FAIL())
|
||||||
|
return -1;
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -386,6 +386,9 @@ int crypto_hash_finish(struct crypto_hash *ctx, u8 *mac, size_t *len)
|
||||||
}
|
}
|
||||||
|
|
||||||
crypto_hash_deinit(ctx);
|
crypto_hash_deinit(ctx);
|
||||||
|
|
||||||
|
if (TEST_FAIL())
|
||||||
|
return -1;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1054,6 +1054,9 @@ int crypto_hash_finish(struct crypto_hash *ctx, u8 *mac, size_t *len)
|
||||||
HMAC_CTX_free(ctx->ctx);
|
HMAC_CTX_free(ctx->ctx);
|
||||||
bin_clear_free(ctx, sizeof(*ctx));
|
bin_clear_free(ctx, sizeof(*ctx));
|
||||||
|
|
||||||
|
if (TEST_FAIL())
|
||||||
|
return -1;
|
||||||
|
|
||||||
if (res == 1) {
|
if (res == 1) {
|
||||||
*len = mdlen;
|
*len = mdlen;
|
||||||
return 0;
|
return 0;
|
||||||
|
|
|
@ -953,6 +953,8 @@ int crypto_hash_finish(struct crypto_hash *ctx, u8 *mac, size_t *len)
|
||||||
ret = 0;
|
ret = 0;
|
||||||
done:
|
done:
|
||||||
bin_clear_free(ctx, sizeof(*ctx));
|
bin_clear_free(ctx, sizeof(*ctx));
|
||||||
|
if (TEST_FAIL())
|
||||||
|
return -1;
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -6783,17 +6783,19 @@ def test_eap_proto_pwd_errors(dev, apdev):
|
||||||
dev[0].request("REMOVE_NETWORK all")
|
dev[0].request("REMOVE_NETWORK all")
|
||||||
dev[0].wait_disconnected()
|
dev[0].wait_disconnected()
|
||||||
|
|
||||||
with fail_test(dev[0], 1,
|
funcs = ["hash_nt_password_hash;eap_pwd_perform_commit_exchange",
|
||||||
"hash_nt_password_hash;eap_pwd_perform_commit_exchange"):
|
"crypto_hash_finish;eap_pwd_kdf"]
|
||||||
dev[0].connect("eap-test", key_mgmt="WPA-EAP", scan_freq="2412",
|
for func in funcs:
|
||||||
eap="PWD", identity="pwd-hash",
|
with fail_test(dev[0], 1, func):
|
||||||
password_hex="hash:e3718ece8ab74792cbbfffd316d2d19a",
|
dev[0].connect("eap-test", key_mgmt="WPA-EAP", scan_freq="2412",
|
||||||
wait_connect=False)
|
eap="PWD", identity="pwd-hash",
|
||||||
ev = dev[0].wait_event(["CTRL-EVENT-EAP-FAILURE"], timeout=10)
|
password_hex="hash:e3718ece8ab74792cbbfffd316d2d19a",
|
||||||
if ev is None:
|
wait_connect=False)
|
||||||
raise Exception("No EAP-Failure reported")
|
ev = dev[0].wait_event(["CTRL-EVENT-EAP-FAILURE"], timeout=10)
|
||||||
dev[0].request("REMOVE_NETWORK all")
|
if ev is None:
|
||||||
dev[0].wait_disconnected()
|
raise Exception("No EAP-Failure reported")
|
||||||
|
dev[0].request("REMOVE_NETWORK all")
|
||||||
|
dev[0].wait_disconnected()
|
||||||
|
|
||||||
params = {"ssid": "eap-test2", "wpa": "2", "wpa_key_mgmt": "WPA-EAP",
|
params = {"ssid": "eap-test2", "wpa": "2", "wpa_key_mgmt": "WPA-EAP",
|
||||||
"rsn_pairwise": "CCMP", "ieee8021x": "1",
|
"rsn_pairwise": "CCMP", "ieee8021x": "1",
|
||||||
|
|
Loading…
Reference in a new issue