Diff between 84c1e8f49696cb7f7ed52c1e9c51cb173290e6b1 and 5f1e9e1ed515055d10d9896e0cd6a128fe4535b0

Changed Files

File Additions Deletions Status
tools/mgmt-tester.c +19 -0 modified

Full Patch

diff --git a/tools/mgmt-tester.c b/tools/mgmt-tester.c
index 4233a22..32862db 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);