tests: Update base64 OOM test cases to match implementation changes

Introduction of the new base64 helper function changed the backtraces
for these OOM test cases and resulted in test failures. Update the test
scripts to work with the new implementation.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
This commit is contained in:
Jouni Malinen 2017-06-15 21:17:57 +03:00 committed by Jouni Malinen
parent 0ffdc8b196
commit 5b52e1adc2
3 changed files with 12 additions and 7 deletions

View File

@ -165,7 +165,7 @@ static unsigned char * base64_gen_decode(const unsigned char *src, size_t len,
unsigned char * base64_encode(const unsigned char *src, size_t len,
size_t *out_len)
{
return base64_gen_encode(src, len, out_len, base64_table, 0);
return base64_gen_encode(src, len, out_len, base64_table, 1);
}

View File

@ -3202,7 +3202,8 @@ def test_ap_wps_upnp_subscribe(dev, apdev):
dev[1].request("WPS_CANCEL")
time.sleep(0.1)
with alloc_fail(hapd, 1, "base64_encode;upnp_wps_device_send_wlan_event"):
with alloc_fail(hapd, 1,
"base64_gen_encode;?base64_encode;upnp_wps_device_send_wlan_event"):
dev[1].dump_monitor()
dev[1].request("WPS_PIN " + apdev[0]['bssid'] + " 12345670")
dev[1].wait_event(["CTRL-EVENT-SCAN-RESULTS"], 5)
@ -3736,7 +3737,7 @@ def test_ap_wps_init_oom(dev, apdev):
params = { "ssid": ssid, "eap_server": "1", "wps_state": "1" }
hapd = hostapd.add_ap(apdev[0], params)
with alloc_fail(hapd, 1, "base64_encode;wps_build_cred"):
with alloc_fail(hapd, 1, "base64_gen_encode;?base64_encode;wps_build_cred"):
pin = dev[0].wps_read_pin()
hapd.request("WPS_PIN any " + pin)
dev[0].scan_for_bss(apdev[0]['bssid'], freq="2412")
@ -3773,7 +3774,8 @@ def _test_ap_wps_er_oom(dev, apdev):
dev[0].connect(ssid, psk="12345678", scan_freq="2412")
with alloc_fail(dev[0], 1, "base64_decode;xml_get_base64_item"):
with alloc_fail(dev[0], 1,
"base64_gen_decode;?base64_decode;xml_get_base64_item"):
dev[0].request("WPS_ER_START ifname=lo")
ev = dev[0].wait_event(["WPS-ER-AP-ADD"], timeout=3)
if ev is not None:
@ -3786,7 +3788,8 @@ def _test_ap_wps_er_oom(dev, apdev):
raise Exception("AP discovery timed out")
dev[1].scan_for_bss(apdev[0]['bssid'], freq=2412)
with alloc_fail(dev[0], 1, "base64_decode;xml_get_base64_item"):
with alloc_fail(dev[0], 1,
"base64_gen_decode;?base64_decode;xml_get_base64_item"):
dev[1].request("WPS_PBC " + apdev[0]['bssid'])
ev = dev[1].wait_event(["CTRL-EVENT-SCAN-RESULTS"], timeout=10)
if ev is None:
@ -4593,7 +4596,8 @@ RGV2aWNlIEEQSQAGADcqAAEg
if ev is None:
raise Exception("Enrollee add event not seen")
with alloc_fail(dev[0], 1, "base64_encode;wps_er_soap_hdr"):
with alloc_fail(dev[0], 1,
"base64_gen_encode;?base64_encode;wps_er_soap_hdr"):
send_wlanevent(url, uuid, data)
with alloc_fail(dev[0], 1, "wpabuf_alloc;wps_er_soap_hdr"):

View File

@ -146,7 +146,8 @@ def test_tnc_ttls_errors(dev, apdev):
(1, "os_readfile;tncc_read_config", "pap user", "auth=PAP"),
(1, "tncc_init", "pap user", "auth=PAP"),
(1, "TNC_TNCC_ReportMessageTypes", "pap user", "auth=PAP"),
(1, "base64_encode;TNC_TNCC_SendMessage", "pap user", "auth=PAP"),
(1, "base64_gen_encode;?base64_encode;TNC_TNCC_SendMessage",
"pap user", "auth=PAP"),
(1, "=TNC_TNCC_SendMessage", "pap user", "auth=PAP"),
(1, "tncc_get_base64;tncc_process_if_tnccs",
"pap user", "auth=PAP") ]