From 5f1e9e1ed515055d10d9896e0cd6a128fe4535b0 Mon Sep 17 00:00:00 2001 From: Johan Hedberg Date: Fri, 18 Jan 2013 14:14:13 +0200 Subject: [PATCH] tools: Add another invalid params mgmt_load_long_term_keys test --- tools/mgmt-tester.c | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/tools/mgmt-tester.c b/tools/mgmt-tester.c index 4233a22d1..32862dbac 100644 --- a/tools/mgmt-tester.c +++ b/tools/mgmt-tester.c @@ -920,6 +920,15 @@ static const char load_link_keys_valid_param_1[] = { 0x00, 0x00, 0x00 }; static const char load_link_keys_valid_param_2[] = { 0x01, 0x00, 0x00 }; static const char load_link_keys_invalid_param_1[] = { 0x02, 0x00, 0x00 }; static const char load_link_keys_invalid_param_2[] = { 0x00, 0x01, 0x00 }; +/* Invalid bdaddr type */ +static const char load_link_keys_invalid_param_3[] = { 0x00, 0x01, 0x00, + 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, /* addr */ + 0x01, /* addr type */ + 0x00, /* key type */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* value (1/2) */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* value (2/2) */ + 0x04, /* PIN length */ +}; static const struct generic_data load_link_keys_success_test_1 = { .send_opcode = MGMT_OP_LOAD_LINK_KEYS, @@ -949,6 +958,13 @@ static const struct generic_data load_link_keys_invalid_params_test_2 = { .expect_status = MGMT_STATUS_INVALID_PARAMS, }; +static const struct generic_data load_link_keys_invalid_params_test_3 = { + .send_opcode = MGMT_OP_LOAD_LINK_KEYS, + .send_param = load_link_keys_invalid_param_3, + .send_len = sizeof(load_link_keys_invalid_param_3), + .expect_status = MGMT_STATUS_INVALID_PARAMS, +}; + static const char load_ltks_valid_param_1[] = { 0x00, 0x00 }; /* Invalid key count */ static const char load_ltks_invalid_param_1[] = { 0x01, 0x00 }; @@ -1544,6 +1560,9 @@ int main(int argc, char *argv[]) test_bredr("Load Link Keys - Invalid Parameters 2", &load_link_keys_invalid_params_test_2, NULL, test_command_generic); + test_bredr("Load Link Keys - Invalid Parameters 3", + &load_link_keys_invalid_params_test_3, NULL, + test_command_generic); test_bredr("Load Long Term Keys - Success 1", &load_ltks_success_test_1, NULL, test_command_generic); -- 2.47.3