You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mynewt.apache.org by cc...@apache.org on 2016/06/17 04:04:08 UTC
[8/9] incubator-mynewt-core git commit: BLE Host - More SM unit tests.
http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/39dd36c8/net/nimble/host/src/test/ble_sm_test.c
----------------------------------------------------------------------
diff --git a/net/nimble/host/src/test/ble_sm_test.c b/net/nimble/host/src/test/ble_sm_test.c
index 4f732bd..d890996 100644
--- a/net/nimble/host/src/test/ble_sm_test.c
+++ b/net/nimble/host/src/test/ble_sm_test.c
@@ -385,160 +385,6 @@ TEST_CASE(ble_sm_test_case_peer_lgcy_fail_confirm)
);
}
-TEST_CASE(ble_sm_test_case_peer_lgcy_jw_good)
-{
- struct ble_sm_test_lgcy_params params;
-
- params = (struct ble_sm_test_lgcy_params) {
- .init_id_addr = {0xe1, 0xfc, 0xda, 0xf4, 0xb7, 0x6c},
- .resp_id_addr = {0x03, 0x02, 0x01, 0x50, 0x13, 0x00},
- .pair_req = (struct ble_sm_pair_cmd) {
- .io_cap = 0x04,
- .oob_data_flag = 0,
- .authreq = 0x05,
- .max_enc_key_size = 16,
- .init_key_dist = 0x07,
- .resp_key_dist = 0x07,
- },
- .pair_rsp = (struct ble_sm_pair_cmd) {
- .io_cap = 3,
- .oob_data_flag = 0,
- .authreq = 0,
- .max_enc_key_size = 16,
- .init_key_dist = 0,
- .resp_key_dist = 0,
- },
- .confirm_req = (struct ble_sm_pair_confirm) {
- .value = {
- 0x0a, 0xac, 0xa2, 0xae, 0xa6, 0x98, 0xdc, 0x6d,
- 0x65, 0x84, 0x11, 0x69, 0x47, 0x36, 0x8d, 0xa0,
- },
- },
- .confirm_rsp = (struct ble_sm_pair_confirm) {
- .value = {
- 0x45, 0xd2, 0x2c, 0x38, 0xd8, 0x91, 0x4f, 0x19,
- 0xa2, 0xd4, 0xfc, 0x7d, 0xad, 0x37, 0x79, 0xe0
- },
- },
- .random_req = (struct ble_sm_pair_random) {
- .value = {
- 0x2b, 0x3b, 0x69, 0xe4, 0xef, 0xab, 0xcc, 0x48,
- 0x78, 0x20, 0x1a, 0x54, 0x7a, 0x91, 0x5d, 0xfb,
- },
- },
- .random_rsp = (struct ble_sm_pair_random) {
- .value = {
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- },
- },
- .pair_alg = BLE_SM_PAIR_ALG_JW,
- .authenticated = 0,
- .tk = { 0 },
- .stk = {
- 0xa4, 0x8e, 0x51, 0x0d, 0x33, 0xe7, 0x8f, 0x38,
- 0x45, 0xf0, 0x67, 0xc3, 0xd4, 0x05, 0xb3, 0xe6,
- },
- .r = 0,
- .ediv = 0,
- };
- ble_sm_test_util_peer_lgcy_good(¶ms);
-}
-
-TEST_CASE(ble_sm_test_case_peer_lgcy_passkey_good)
-{
- struct ble_sm_test_lgcy_params params;
-
- params = (struct ble_sm_test_lgcy_params) {
- .init_id_addr = {0xe1, 0xfc, 0xda, 0xf4, 0xb7, 0x6c},
- .resp_id_addr = {0x0c, 0x0b, 0x0a, 0x09, 0x08, 0x07},
- .pair_req = (struct ble_sm_pair_cmd) {
- .io_cap = 0x04,
- .oob_data_flag = 0, .authreq = 0x05,
- .max_enc_key_size = 16,
- .init_key_dist = 0x07,
- .resp_key_dist = 0x07,
- },
- .pair_rsp = (struct ble_sm_pair_cmd) {
- .io_cap = 0x02,
- .oob_data_flag = 0,
- .authreq = 0x05,
- .max_enc_key_size = 16,
- .init_key_dist = 0x01,
- .resp_key_dist = 0x01,
- },
- .confirm_req = (struct ble_sm_pair_confirm) {
- .value = {
- 0x54, 0xed, 0x7c, 0x65, 0xc5, 0x3a, 0xee, 0x87,
- 0x8e, 0xf8, 0x04, 0xd8, 0x93, 0xb0, 0xfa, 0xa4,
- },
- },
- .confirm_rsp = (struct ble_sm_pair_confirm) {
- .value = {
- 0xdf, 0x96, 0x88, 0x73, 0x49, 0x24, 0x3f, 0xe8,
- 0xb0, 0xaf, 0xb3, 0xf6, 0xc8, 0xf4, 0xe2, 0x36,
- },
- },
- .random_req = (struct ble_sm_pair_random) {
- .value = {
- 0x4d, 0x2c, 0xf2, 0xb7, 0x11, 0x56, 0xbd, 0x4f,
- 0xfc, 0xde, 0xa9, 0x86, 0x4d, 0xfd, 0x77, 0x03,
- },
- },
- .random_rsp = {
- .value = {
- 0x12, 0x45, 0x65, 0x2c, 0x85, 0x56, 0x32, 0x8f,
- 0xf4, 0x7f, 0x44, 0xd0, 0x17, 0x35, 0x41, 0xed
- },
- },
- .pair_alg = BLE_SM_PAIR_ALG_PASSKEY,
- .authenticated = 1,
- .tk = {
- 0x5a, 0x7f, 0x0d, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
- },
- .stk = {
- 0x2b, 0x9c, 0x1e, 0x42, 0xa8, 0xcb, 0xab, 0xd1,
- 0x4b, 0xde, 0x50, 0x05, 0x50, 0xd9, 0x95, 0xc6
- },
- .r = 4107344270811490869,
- .ediv = 61621,
-
- .passkey_info = {
- .passkey = {
- .action = BLE_SM_IOACT_INPUT,
- .passkey = 884570,
- },
- },
-
- .enc_info_req = {
- .ltk = {
- 0x2b, 0x9c, 0x1e, 0x42, 0xa8, 0xcb, 0xab, 0xd1,
- 0x4b, 0xde, 0x50, 0x05, 0x50, 0xd9, 0x95, 0xc6
- },
- },
- .has_enc_info_req = 1,
-
- .master_id_req = {
- .ediv = 61621,
- .rand_val = 4107344270811490869,
- },
- .has_master_id_req = 1,
-
- .enc_info_rsp = {
- .ltk = { 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16 }
- },
- .has_enc_info_rsp = 1,
-
- .master_id_rsp = {
- .ediv = 61621,
- .rand_val = 4107344270811490869,
- },
- .has_master_id_rsp = 1,
- };
- ble_sm_test_util_peer_lgcy_good(¶ms);
-}
-
TEST_CASE(ble_sm_test_case_peer_bonding_bad)
{
ble_sm_test_util_peer_bonding_bad(0x5684, 32);
@@ -583,22 +429,18 @@ TEST_CASE(ble_sm_test_case_peer_sec_req_inval)
TEST_ASSERT(ble_hs_test_util_prev_tx_queue_sz() == 0);
}
-/**
- * Master: us.
- * Peer sends a security request.
- * We respond by initiating the pairing procedure.
- */
-TEST_CASE(ble_sm_test_case_peer_sec_req_pair)
+/*****************************************************************************
+ * $us *
+ *****************************************************************************/
+
+TEST_CASE(ble_sm_test_case_us_fail_inval)
{
- struct ble_sm_test_lgcy_params params;
+ struct ble_sm_test_params params;
- params = (struct ble_sm_test_lgcy_params) {
- .init_id_addr = {0x06, 0x05, 0x04, 0x03, 0x02, 0x01},
- .resp_id_addr = {0x0f, 0x0e, 0x0d, 0x0c, 0x0b, 0x0a},
- .sec_req = (struct ble_sm_sec_req) {
- .authreq = 0,
- },
- .has_sec_req = 1,
+ /* Invalid IO capabiltiies. */
+ params = (struct ble_sm_test_params) {
+ .init_id_addr = {0xe1, 0xfc, 0xda, 0xf4, 0xb7, 0x6c},
+ .resp_id_addr = {0x03, 0x02, 0x01, 0x50, 0x13, 0x00},
.pair_req = (struct ble_sm_pair_cmd) {
.io_cap = 3,
.oob_data_flag = 0,
@@ -608,6 +450,24 @@ TEST_CASE(ble_sm_test_case_peer_sec_req_pair)
.resp_key_dist = 0,
},
.pair_rsp = (struct ble_sm_pair_cmd) {
+ .io_cap = 0x14,
+ .oob_data_flag = 0,
+ .authreq = 0x05,
+ .max_enc_key_size = 16,
+ .init_key_dist = 0x07,
+ .resp_key_dist = 0x07,
+ },
+ .pair_fail = (struct ble_sm_pair_fail) {
+ .reason = BLE_SM_ERR_INVAL,
+ },
+ };
+ ble_sm_test_util_us_fail_inval(¶ms);
+
+ /* Invalid OOB flag. */
+ params = (struct ble_sm_test_params) {
+ .init_id_addr = {0xe1, 0xfc, 0xda, 0xf4, 0xb7, 0x6c},
+ .resp_id_addr = {0x03, 0x02, 0x01, 0x50, 0x13, 0x00},
+ .pair_req = (struct ble_sm_pair_cmd) {
.io_cap = 3,
.oob_data_flag = 0,
.authreq = 0,
@@ -615,1938 +475,178 @@ TEST_CASE(ble_sm_test_case_peer_sec_req_pair)
.init_key_dist = 0,
.resp_key_dist = 0,
},
- .confirm_req = (struct ble_sm_pair_confirm) {
- .value = {
- 0x04, 0x4e, 0xaf, 0xce, 0x30, 0x79, 0x2c, 0x9e,
- 0xa2, 0xeb, 0x53, 0x6a, 0xdf, 0xf7, 0x99, 0xb2,
- },
- },
- .confirm_rsp = (struct ble_sm_pair_confirm) {
- .value = {
- 0x04, 0x4e, 0xaf, 0xce, 0x30, 0x79, 0x2c, 0x9e,
- 0xa2, 0xeb, 0x53, 0x6a, 0xdf, 0xf7, 0x99, 0xb2,
- },
- },
- .random_req = (struct ble_sm_pair_random) {
- .value = {
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- },
- },
- .random_rsp = (struct ble_sm_pair_random) {
- .value = {
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- },
+ .pair_rsp = (struct ble_sm_pair_cmd) {
+ .io_cap = 0x14,
+ .oob_data_flag = 2,
+ .authreq = 0x05,
+ .max_enc_key_size = 16,
+ .init_key_dist = 0x07,
+ .resp_key_dist = 0x07,
},
- .pair_alg = BLE_SM_PAIR_ALG_JW,
- .tk = { 0 },
- .stk = {
- 0x2e, 0x2b, 0x34, 0xca, 0x59, 0xfa, 0x4c, 0x88,
- 0x3b, 0x2c, 0x8a, 0xef, 0xd4, 0x4b, 0xe9, 0x66,
+ .pair_fail = (struct ble_sm_pair_fail) {
+ .reason = BLE_SM_ERR_INVAL,
},
- .r = 0,
- .ediv = 0,
};
+ ble_sm_test_util_us_fail_inval(¶ms);
- ble_sm_test_util_us_lgcy_good(¶ms);
-}
-
-TEST_CASE(ble_sm_test_case_peer_sc_numcmp_good)
-{
- struct ble_sm_test_sc_params params;
-
- params = (struct ble_sm_test_sc_params) {
- .init_id_addr = { 0xca, 0x61, 0xa0, 0x67, 0x94, 0xe0 },
- .resp_id_addr = { 0x0c, 0x0b, 0x0a, 0x09, 0x08, 0x07 },
+ /* Invalid authreq - reserved bonding flag. */
+ params = (struct ble_sm_test_params) {
+ .init_id_addr = {0xe1, 0xfc, 0xda, 0xf4, 0xb7, 0x6c},
+ .resp_id_addr = {0x03, 0x02, 0x01, 0x50, 0x13, 0x00},
.pair_req = (struct ble_sm_pair_cmd) {
- .io_cap = 0x01,
- .oob_data_flag = 0x00,
- .authreq = 0x0d,
+ .io_cap = 3,
+ .oob_data_flag = 0,
+ .authreq = 0,
.max_enc_key_size = 16,
- .init_key_dist = 0x0d,
- .resp_key_dist = 0x0f,
+ .init_key_dist = 0,
+ .resp_key_dist = 0,
},
.pair_rsp = (struct ble_sm_pair_cmd) {
- .io_cap = 0x01,
- .oob_data_flag = 0x00,
- .authreq = 0x0d,
+ .io_cap = 0x04,
+ .oob_data_flag = 0,
+ .authreq = 0x02,
.max_enc_key_size = 16,
- .init_key_dist = 0x01,
- .resp_key_dist = 0x01,
+ .init_key_dist = 0x07,
+ .resp_key_dist = 0x07,
},
- .public_key_req = (struct ble_sm_public_key) {
- .x = {
- 0xbf, 0x85, 0xf4, 0x0b, 0xf2, 0x93, 0x05, 0x38,
- 0xfd, 0x09, 0xf3, 0x80, 0xc1, 0x9c, 0x07, 0xee,
- 0x4b, 0x48, 0x28, 0x17, 0x18, 0x03, 0xc8, 0x8f,
- 0x5d, 0xdc, 0x7e, 0xa1, 0xf5, 0x06, 0x17, 0x12,
- },
-
- .y = {
- 0xee, 0x63, 0x19, 0x9e, 0x9e, 0x66, 0xd2, 0xee,
- 0x8a, 0xf9, 0xc7, 0xf6, 0x2b, 0x56, 0xec, 0xda,
- 0x8a, 0x18, 0xdb, 0x49, 0x55, 0x8d, 0x05, 0x08,
- 0x9a, 0x9c, 0xe3, 0xf4, 0xe8, 0x31, 0x4c, 0x1d,
- },
+ .pair_fail = (struct ble_sm_pair_fail) {
+ .reason = BLE_SM_ERR_INVAL,
},
- .public_key_rsp = (struct ble_sm_public_key) {
- .x = {
- 0x15, 0x88, 0xed, 0xe4, 0xa4, 0x81, 0xa7, 0xed,
- 0x1a, 0xff, 0x69, 0x66, 0x3d, 0x4d, 0xf1, 0x27,
- 0xc2, 0xb9, 0x03, 0xaf, 0x65, 0x9e, 0x45, 0x86,
- 0x80, 0xba, 0xc8, 0x4a, 0x7d, 0xbc, 0x17, 0x6e,
- },
+ };
+ ble_sm_test_util_us_fail_inval(¶ms);
- .y = {
- 0xb3, 0x34, 0x36, 0x36, 0x77, 0x5c, 0x28, 0xaf,
- 0x73, 0x25, 0x0e, 0xff, 0x29, 0xc4, 0xe8, 0x23,
- 0xeb, 0x35, 0xa7, 0x47, 0x29, 0x6e, 0xbd, 0x29,
- 0x93, 0x26, 0x07, 0xfd, 0x9c, 0x93, 0xf3, 0xd6,
- },
+ /* Invalid authreq - reserved other flag. */
+ params = (struct ble_sm_test_params) {
+ .init_id_addr = {0xe1, 0xfc, 0xda, 0xf4, 0xb7, 0x6c},
+ .resp_id_addr = {0x03, 0x02, 0x01, 0x50, 0x13, 0x00},
+ .pair_req = (struct ble_sm_pair_cmd) {
+ .io_cap = 3,
+ .oob_data_flag = 0,
+ .authreq = 0,
+ .max_enc_key_size = 16,
+ .init_key_dist = 0,
+ .resp_key_dist = 0,
},
- .confirm_rsp[0] = (struct ble_sm_pair_confirm) {
- .value = {
- 0x7c, 0x45, 0xb0, 0x55, 0xce, 0x22, 0x61, 0x57,
- 0x68, 0x2f, 0x2d, 0x3a, 0xce, 0xf5, 0x80, 0xba,
- },
+ .pair_rsp = (struct ble_sm_pair_cmd) {
+ .io_cap = 0x04,
+ .oob_data_flag = 0,
+ .authreq = 0x20,
+ .max_enc_key_size = 16,
+ .init_key_dist = 0x07,
+ .resp_key_dist = 0x07,
},
- .random_req[0] = (struct ble_sm_pair_random) {
- .value = {
- 0x4e, 0xfb, 0x89, 0x84, 0xfd, 0xa1, 0xed, 0x65,
- 0x0e, 0x57, 0x11, 0xe6, 0x94, 0xd5, 0x18, 0x78,
- },
+ .pair_fail = (struct ble_sm_pair_fail) {
+ .reason = BLE_SM_ERR_INVAL,
},
- .random_rsp[0] = (struct ble_sm_pair_random) {
- .value = {
- 0x29, 0x06, 0xbc, 0x65, 0x1d, 0xe0, 0x95, 0xde,
- 0x79, 0xee, 0xd9, 0x41, 0x86, 0x6f, 0x35, 0x75,
- },
+ };
+ ble_sm_test_util_us_fail_inval(¶ms);
+
+ /* Invalid key size - too small. */
+ params = (struct ble_sm_test_params) {
+ .init_id_addr = {0xe1, 0xfc, 0xda, 0xf4, 0xb7, 0x6c},
+ .resp_id_addr = {0x03, 0x02, 0x01, 0x50, 0x13, 0x00},
+ .pair_req = (struct ble_sm_pair_cmd) {
+ .io_cap = 3,
+ .oob_data_flag = 0,
+ .authreq = 0,
+ .max_enc_key_size = 16,
+ .init_key_dist = 0,
+ .resp_key_dist = 0,
},
- .dhkey_check_req = (struct ble_sm_dhkey_check) {
- .value = {
- 0xbc, 0x85, 0xc2, 0x2e, 0xe5, 0x19, 0xb0, 0xdd,
- 0xf7, 0xed, 0x5d, 0xdd, 0xa7, 0xa7, 0xc0, 0x54,
- }
+ .pair_rsp = (struct ble_sm_pair_cmd) {
+ .io_cap = 0x04,
+ .oob_data_flag = 0,
+ .authreq = 0x05,
+ .max_enc_key_size = 6,
+ .init_key_dist = 0x07,
+ .resp_key_dist = 0x07,
},
- .dhkey_check_rsp = (struct ble_sm_dhkey_check) {
- .value = {
- 0x65, 0x82, 0x74, 0xd0, 0x29, 0xcb, 0xe9, 0x9a,
- 0xed, 0x9c, 0xa4, 0xbb, 0x39, 0x5c, 0xef, 0xfd,
- }
+ .pair_fail = (struct ble_sm_pair_fail) {
+ .reason = BLE_SM_ERR_INVAL,
},
- .pair_alg = BLE_SM_PAIR_ALG_NUMCMP,
- .authenticated = 1,
- .ltk = {
- 0xb0, 0x43, 0x9c, 0xed, 0x93, 0x73, 0x5c, 0xfb,
- 0x7f, 0xfd, 0xd9, 0x06, 0xad, 0xbc, 0x7c, 0xd0,
+ };
+ ble_sm_test_util_us_fail_inval(¶ms);
+
+ /* Invalid key size - too large. */
+ params = (struct ble_sm_test_params) {
+ .init_id_addr = {0xe1, 0xfc, 0xda, 0xf4, 0xb7, 0x6c},
+ .resp_id_addr = {0x03, 0x02, 0x01, 0x50, 0x13, 0x00},
+ .pair_req = (struct ble_sm_pair_cmd) {
+ .io_cap = 3,
+ .oob_data_flag = 0,
+ .authreq = 0,
+ .max_enc_key_size = 16,
+ .init_key_dist = 0,
+ .resp_key_dist = 0,
},
- .our_priv_key = {
- 0x8c, 0x7a, 0x1a, 0x8e, 0x8e, 0xfa, 0x2d, 0x2e,
- 0xa6, 0xd5, 0xa2, 0x51, 0x86, 0xe4, 0x31, 0x1c,
- 0x1e, 0xf8, 0x13, 0x33, 0x08, 0x76, 0x38, 0x6e,
- 0xa0, 0x06, 0x88, 0x6d, 0x9d, 0x96, 0x43, 0x4e,
+ .pair_rsp = (struct ble_sm_pair_cmd) {
+ .io_cap = 0x04,
+ .oob_data_flag = 0,
+ .authreq = 0x05,
+ .max_enc_key_size = 17,
+ .init_key_dist = 0x07,
+ .resp_key_dist = 0x07,
},
-
- .passkey_info = {
- .passkey = {
- .action = BLE_SM_IOACT_NUMCMP,
- .numcmp_accept = 1,
- },
-
- .exp_numcmp = 476091,
- .io_before_rx = 0,
+ .pair_fail = (struct ble_sm_pair_fail) {
+ .reason = BLE_SM_ERR_INVAL,
},
};
- ble_sm_test_util_peer_sc_good(¶ms);
-}
-
-TEST_CASE(ble_sm_test_case_peer_sc_passkey_good)
-{
- struct ble_sm_test_sc_params params;
+ ble_sm_test_util_us_fail_inval(¶ms);
- params = (struct ble_sm_test_sc_params) {
- .init_id_addr = { 0xca, 0x61, 0xa0, 0x67, 0x94, 0xe0 },
- .resp_id_addr = { 0x0c, 0x0b, 0x0a, 0x09, 0x08, 0x07 },
+ /* Invalid init key dist. */
+ params = (struct ble_sm_test_params) {
+ .init_id_addr = {0xe1, 0xfc, 0xda, 0xf4, 0xb7, 0x6c},
+ .resp_id_addr = {0x03, 0x02, 0x01, 0x50, 0x13, 0x00},
.pair_req = (struct ble_sm_pair_cmd) {
- .io_cap = 0x04,
- .oob_data_flag = 0x00,
- .authreq = 0x0d,
+ .io_cap = 3,
+ .oob_data_flag = 0,
+ .authreq = 0,
.max_enc_key_size = 16,
- .init_key_dist = 0x0d,
- .resp_key_dist = 0x0f,
+ .init_key_dist = 0,
+ .resp_key_dist = 0,
},
.pair_rsp = (struct ble_sm_pair_cmd) {
- .io_cap = 0x02,
- .oob_data_flag = 0x00,
- .authreq = 0x0d,
- .max_enc_key_size = 16,
- .init_key_dist = 0x01,
- .resp_key_dist = 0x01,
- },
- .public_key_req = (struct ble_sm_public_key) {
- .x = {
- 0x82,0xcf, 0x99, 0xe1, 0x56, 0xe5, 0xa3, 0xbc,
- 0x1d,0xd5, 0xab, 0x32, 0x90, 0x65, 0x9a, 0x6c,
- 0x15,0x34, 0xcf, 0xa3, 0xb1, 0xa3, 0x88, 0x9f,
- 0xb0,0x86, 0xc7, 0x17, 0xd4, 0x1a, 0x88, 0x8d,
- },
- .y = {
- 0x09,0xfb, 0x98, 0xd2, 0xf8, 0x94, 0x73, 0xed,
- 0x81,0x09, 0x08, 0x00, 0x3f, 0x14, 0x87, 0x6c,
- 0xc6,0x83, 0x36, 0xc1, 0x9d, 0x8e, 0x39, 0xea,
- 0x3d,0x79, 0x9d, 0x8c, 0x7f, 0xcf, 0x00, 0xbd,
- },
- },
- .public_key_rsp = (struct ble_sm_public_key) {
- .x = {
- 0x9e,0x05, 0x7b, 0x5b, 0x61, 0xf2, 0x57, 0xbe,
- 0xb7,0x73, 0x3f, 0x72, 0x03, 0xc9, 0x51, 0x44,
- 0x9e,0xe1, 0xef, 0xe8, 0x28, 0x67, 0xcc, 0xbe,
- 0x20,0x13, 0xb5, 0xcc, 0x71, 0x39, 0x85, 0xaf,
- },
- .y = {
- 0xff,0xac, 0x2c, 0x48, 0x57, 0xd9, 0x49, 0x9d,
- 0x27,0x8d, 0x99, 0x30, 0x01, 0xe3, 0x30, 0x72,
- 0xd4,0x7b, 0x5c, 0x64, 0x7e, 0x80, 0xd5, 0x09,
- 0x3a,0x70, 0x44, 0x61, 0xc9, 0x36, 0x50, 0x6b,
- },
- },
- .confirm_req[0] = {
- .value = {
- 0x2f,0xa2, 0x10, 0xff, 0xd8, 0x1c, 0x5c, 0x93,
- 0xd9,0x96, 0xf2, 0x8d, 0x7a, 0x34, 0xef, 0xbc,
- },
- },
- .confirm_rsp[0] = {
- .value = {
- 0xe7,0xd6, 0x11, 0xd9, 0xb1, 0x69, 0xe1, 0x0b,
- 0xbb,0x07, 0x63, 0x38, 0x62, 0x75, 0x5f, 0x2b,
- },
- },
- .random_req[0] = {
- .value = {
- 0xfa,0x4c, 0xa5, 0x7e, 0xfd, 0x11, 0x68, 0xeb,
- 0xf2,0x6a, 0xcd, 0x50, 0x7a, 0x92, 0x36, 0xf1,
- },
- },
- .random_rsp[0] = {
- .value = {
- 0xa5,0xec, 0xc8, 0x7f, 0xe2, 0x19, 0x05, 0x5e,
- 0x2e,0x0d, 0x12, 0x65, 0xd5, 0x11, 0x98, 0x7e,
- },
- },
- .confirm_req[1] = {
- .value = {
- 0x5b,0xff, 0xad, 0x40, 0x98, 0xb8, 0xc8, 0xd9,
- 0x1e,0xde, 0x11, 0x17, 0xcc, 0x16, 0x09, 0x08,
- },
- },
- .confirm_rsp[1] = {
- .value = {
- 0xe1,0xd7, 0xb3, 0x1b, 0x2b, 0xa8, 0x38, 0x29,
- 0xa4,0xd7, 0x62, 0x4b, 0xf2, 0x59, 0x51, 0xdc,
- },
- },
- .random_req[1] = {
- .value = {
- 0xac,0x6b, 0xc5, 0x83, 0x9f, 0x08, 0x05, 0xed,
- 0x0e,0x76, 0x14, 0xce, 0x57, 0x07, 0x6e, 0x0b,
- },
- },
- .random_rsp[1] = {
- .value = {
- 0x6d,0x7d, 0x10, 0x78, 0x76, 0x09, 0x34, 0xca,
- 0xa9,0x70, 0x5b, 0x59, 0xfb, 0xfd, 0x15, 0x17,
- },
- },
- .confirm_req[2] = {
- .value = {
- 0x5c,0xb7, 0x96, 0x9a, 0x5b, 0x8a, 0x8f, 0x00,
- 0xae,0x84, 0xa1, 0x72, 0xc8, 0x4d, 0xd0, 0x85,
- },
- },
- .confirm_rsp[2] = {
- .value = {
- 0xe7,0x0e, 0x80, 0x89, 0xf7, 0x04, 0x48, 0x02,
- 0x06,0xd3, 0xd2, 0x09, 0x88, 0x73, 0x44, 0x3c,
- },
- },
- .random_req[2] = {
- .value = {
- 0xc7,0x83, 0xec, 0x81, 0xf4, 0xe0, 0xdd, 0x41,
- 0xaf,0x28, 0x6f, 0xbe, 0xb4, 0x92, 0x30, 0xf7,
- },
- },
- .random_rsp[2] = {
- .value = {
- 0x38,0x95, 0xbb, 0x5f, 0x8a, 0x67, 0xb7, 0x8f,
- 0x95,0x2a, 0x7e, 0x3b, 0xac, 0x27, 0xf7, 0x86,
- },
- },
- .confirm_req[3] = {
- .value = {
- 0x01,0x3d, 0xee, 0x42, 0xb7, 0xfa, 0xc1, 0x82,
- 0x51,0x02, 0x42, 0x51, 0xa2, 0xbb, 0x20, 0x0e,
- },
- },
- .confirm_rsp[3] = {
- .value = {
- 0x99,0x01, 0x88, 0x1c, 0x45, 0x2c, 0xa6, 0x6f,
- 0x6b,0xca, 0x9d, 0x8d, 0x32, 0xfe, 0x2f, 0x02,
- },
- },
- .random_req[3] = {
- .value = {
- 0x5e,0x39, 0x5f, 0x91, 0x9d, 0xed, 0xf9, 0x93,
- 0xec,0xd5, 0x6b, 0x39, 0xb6, 0x77, 0x3a, 0x94,
- },
- },
- .random_rsp[3] = {
- .value = {
- 0xe1,0x06, 0x02, 0xcc, 0x80, 0x9d, 0xd1, 0x47,
- 0x42,0xa6, 0xca, 0x52, 0x6a, 0x1b, 0x9e, 0x7a,
- },
- },
- .confirm_req[4] = {
- .value = {
- 0x2e,0xcd, 0x64, 0x01, 0x39, 0x74, 0x59, 0xfc,
- 0x78,0xeb, 0x48, 0x4f, 0xa3, 0x8a, 0x6e, 0x2f,
- },
- },
- .confirm_rsp[4] = {
- .value = {
- 0x9e,0x27, 0x31, 0x14, 0x35, 0x95, 0x0a, 0x3d,
- 0x0b,0x60, 0xd9, 0x78, 0xd9, 0xfc, 0x5d, 0xc4,
- },
- },
- .random_req[4] = {
- .value = {
- 0x3f,0x35, 0xa0, 0x90, 0xbf, 0x5a, 0x16, 0xcd,
- 0x32,0x0c, 0x88, 0x3a, 0x3c, 0x28, 0x89, 0x29,
- },
- },
- .random_rsp[4] = {
- .value = {
- 0xde,0xb9, 0x95, 0x46, 0x55, 0xed, 0xaa, 0x76,
- 0xb3,0xae, 0x59, 0x92, 0xec, 0x3e, 0xe6, 0x17,
- },
- },
- .confirm_req[5] = {
- .value = {
- 0x61,0x65, 0x44, 0xa6, 0x35, 0x88, 0x34, 0x80,
- 0xeb,0xce, 0xc4, 0xc3, 0xa0, 0xf4, 0xc4, 0xdb,
- },
- },
- .confirm_rsp[5] = {
- .value = {
- 0xc5,0xdd, 0x46, 0x1c, 0x42, 0x8a, 0xe9, 0x5c,
- 0x71,0xb3, 0x55, 0x5f, 0x35, 0xdd, 0xb3, 0x79,
- },
- },
- .random_req[5] = {
- .value = {
- 0xfa,0xae, 0x45, 0x2a, 0x17, 0xff, 0xfe, 0xe1,
- 0x05,0x58, 0xa4, 0xbd, 0x40, 0x9e, 0x05, 0x0c,
- },
- },
- .random_rsp[5] = {
- .value = {
- 0x7b,0xef, 0xca, 0x4e, 0x87, 0x80, 0xef, 0xd9,
- 0x8f,0xa5, 0x61, 0x8d, 0x73, 0xb2, 0x38, 0xcd,
- },
- },
- .confirm_req[6] = {
- .value = {
- 0x38,0xfb, 0x19, 0x1e, 0xc7, 0xec, 0x11, 0xed,
- 0xaa,0xc0, 0xa5, 0xaf, 0x79, 0x8f, 0x96, 0x82,
- },
- },
- .confirm_rsp[6] = {
- .value = {
- 0x9d,0x0f, 0x44, 0x66, 0xd7, 0x05, 0x24, 0x81,
- 0xff,0x32, 0x5c, 0xda, 0x25, 0x2c, 0x92, 0xec,
- },
- },
- .random_req[6] = {
- .value = {
- 0x77,0xc3, 0x35, 0x7b, 0x78, 0xbc, 0xe4, 0xc1,
- 0x9c,0x13, 0xbd, 0xd2, 0xd2, 0xc6, 0x1e, 0x50,
- },
- },
- .random_rsp[6] = {
- .value = {
- 0x5d,0xd5, 0x12, 0x06, 0x66, 0xd1, 0x74, 0x3a,
- 0xb7,0x5e, 0x54, 0x0d, 0xa2, 0x0f, 0xa4, 0x7c,
- },
- },
- .confirm_req[7] = {
- .value = {
- 0x32,0xe8, 0xf4, 0xc9, 0xed, 0xa7, 0xd3, 0x95,
- 0x94,0x0f, 0x08, 0xfb, 0xaa, 0xce, 0x84, 0x06,
- },
- },
- .confirm_rsp[7] = {
- .value = {
- 0x5a,0x59, 0xb8, 0xbe, 0x70, 0x33, 0x99, 0xf9,
- 0x07,0xff, 0x70, 0xe2, 0x10, 0x53, 0xf6, 0xf1,
- },
- },
- .random_req[7] = {
- .value = {
- 0x2f,0x07, 0x42, 0x95, 0xb2, 0x97, 0xcf, 0xa4,
- 0xde,0x2e, 0x88, 0xa1, 0x2a, 0x3c, 0x89, 0x6e,
- },
- },
- .random_rsp[7] = {
- .value = {
- 0x23,0x21, 0x9f, 0x2f, 0xfc, 0xb1, 0x80, 0xce,
- 0x0f,0x3d, 0xe6, 0xee, 0xbe, 0xab, 0x28, 0xe2,
- },
- },
- .confirm_req[8] = {
- .value = {
- 0x20,0xc3, 0x49, 0x90, 0x13, 0xad, 0x99, 0x69,
- 0xf1,0xd3, 0x71, 0x95, 0xb0, 0x54, 0xc4, 0xce,
- },
- },
- .confirm_rsp[8] = {
- .value = {
- 0x02,0x50, 0x29, 0x57, 0xc5, 0x26, 0x1f, 0x90,
- 0x05,0x8b, 0x8c, 0x20, 0xe9, 0xf7, 0xdd, 0x03,
- },
- },
- .random_req[8] = {
- .value = {
- 0xfd,0x09, 0x39, 0xc8, 0xc6, 0x57, 0xcf, 0x09,
- 0xc7,0x89, 0xab, 0xcc, 0x05, 0xda, 0xb7, 0x05,
- },
- },
- .random_rsp[8] = {
- .value = {
- 0x0d,0xed, 0xfd, 0x38, 0x76, 0x56, 0xa0, 0xcc,
- 0xf4,0x66, 0x09, 0xcb, 0x0f, 0x8c, 0xa5, 0x6a,
- },
- },
- .confirm_req[9] = {
- .value = {
- 0xce,0x50, 0x75, 0xda, 0x6a, 0x88, 0x98, 0x00,
- 0xe5,0x4d, 0x7d, 0xcf, 0xde, 0x00, 0xc5, 0x18,
- },
- },
- .confirm_rsp[9] = {
- .value = {
- 0x0b,0xd4, 0x0c, 0xba, 0xfe, 0x9a, 0xf0, 0x31,
- 0x13,0x21, 0x70, 0x11, 0x7c, 0xde, 0x26, 0x75,
- },
- },
- .random_req[9] = {
- .value = {
- 0x24,0x85, 0x91, 0xef, 0x4b, 0x8e, 0x2b, 0x67,
- 0x39,0x93, 0x7c, 0x7e, 0x4b, 0x76, 0x10, 0x44,
- },
- },
- .random_rsp[9] = {
- .value = {
- 0x2d,0xa3, 0x52, 0xc7, 0x09, 0x0b, 0xda, 0x81,
- 0xbd,0x10, 0x30, 0x57, 0x20, 0x2c, 0x5b, 0x90,
- },
- },
- .confirm_req[10] = {
- .value = {
- 0x7a,0x3e, 0x5b, 0x55, 0x08, 0x63, 0x32, 0x65,
- 0xaa,0xf8, 0xc1, 0xd2, 0xd6, 0x01, 0x1a, 0x7e,
- },
- },
- .confirm_rsp[10] = {
- .value = {
- 0x46,0xdd, 0x55, 0x46, 0x90, 0x55, 0xc8, 0x0b,
- 0x9e,0x7b, 0x81, 0xbb, 0x71, 0x11, 0x7f, 0x58,
- },
- },
- .random_req[10] = {
- .value = {
- 0xc0,0xe0, 0xa0, 0x10, 0xfc, 0xbc, 0xd9, 0x54,
- 0x48,0xdc, 0xcf, 0x8f, 0xda, 0xe6, 0x6a, 0x5f,
- },
- },
- .random_rsp[10] = {
- .value = {
- 0x22,0x3c, 0xd5, 0x79, 0x3e, 0xb3, 0x64, 0x3c,
- 0x46,0xba, 0xbc, 0x74, 0x4a, 0xc0, 0x5c, 0x18,
- },
- },
- .confirm_req[11] = {
- .value = {
- 0x29,0x6e, 0x96, 0xb8, 0xc1, 0x74, 0x27, 0x4c,
- 0x56,0xe0, 0x3e, 0x33, 0x3a, 0xca, 0xf9, 0x68,
- },
- },
- .confirm_rsp[11] = {
- .value = {
- 0xf0,0xe5, 0x3e, 0x5b, 0x68, 0x82, 0x40, 0x53,
- 0x98,0x1b, 0x57, 0xdd, 0x4f, 0x40, 0x23, 0xa2,
- },
- },
- .random_req[11] = {
- .value = {
- 0xb8,0xd9, 0x75, 0x53, 0x65, 0x42, 0x5a, 0x0c,
- 0x82,0x74, 0x55, 0x2c, 0x40, 0x5b, 0x02, 0xed,
- },
- },
- .random_rsp[11] = {
- .value = {
- 0x3f,0x88, 0x97, 0x63, 0x72, 0xe7, 0x84, 0x29,
- 0x2d,0xcc, 0xd3, 0xc6, 0xbb, 0xa8, 0x6a, 0xb8,
- },
- },
- .confirm_req[12] = {
- .value = {
- 0x6c,0x1f, 0x97, 0xda, 0x08, 0x2c, 0x9b, 0x8b,
- 0xf2,0xb0, 0x7a, 0x3e, 0xdf, 0xbf, 0x1e, 0x70,
- },
- },
- .confirm_rsp[12] = {
- .value = {
- 0x18,0xfe, 0x73, 0x49, 0xe0, 0x7a, 0x75, 0xd3,
- 0x68,0x52, 0x2d, 0xae, 0x76, 0xf5, 0xc1, 0x4f,
- },
- },
- .random_req[12] = {
- .value = {
- 0xb3,0xf1, 0xd0, 0xa9, 0x5a, 0x69, 0xa7, 0x33,
- 0xb9,0xdd, 0x04, 0x7d, 0x19, 0xc9, 0x0e, 0xdc,
- },
- },
- .random_rsp[12] = {
- .value = {
- 0x62,0x10, 0x99, 0xae, 0xc0, 0x5c, 0x00, 0x59,
- 0xda,0x14, 0x38, 0x41, 0x8e, 0x70, 0xd9, 0x51,
- },
- },
- .confirm_req[13] = {
- .value = {
- 0x3f,0x62, 0xd8, 0x3c, 0x29, 0x25, 0xf7, 0x96,
- 0x1c,0x01, 0x4f, 0x27, 0x19, 0x89, 0x51, 0xaf,
- },
- },
- .confirm_rsp[13] = {
- .value = {
- 0x4c,0x9f, 0xff, 0xef, 0x9c, 0x04, 0x4f, 0xa7,
- 0xb9,0x8f, 0x9b, 0x4c, 0xbb, 0xaa, 0x8c, 0x44,
- },
- },
- .random_req[13] = {
- .value = {
- 0x73,0x5e, 0xef, 0x3b, 0x9b, 0x45, 0xf1, 0x31,
- 0xcd,0x0c, 0x26, 0x7c, 0xe9, 0xfc, 0x04, 0x5d,
- },
- },
- .random_rsp[13] = {
- .value = {
- 0x38,0x53, 0x68, 0xaa, 0xdf, 0x20, 0xd4, 0xef,
- 0x11,0x2b, 0xac, 0xe2, 0x7c, 0x11, 0x00, 0x10,
- },
- },
- .confirm_req[14] = {
- .value = {
- 0x13,0x1d, 0xc2, 0x1a, 0x39, 0x01, 0xbf, 0xf9,
- 0x87,0xdd, 0xb4, 0xd3, 0xe5, 0xe8, 0x8c, 0x42,
- },
- },
- .confirm_rsp[14] = {
- .value = {
- 0x34,0xc5, 0xda, 0xc1, 0x4c, 0xa8, 0x47, 0x31,
- 0x76,0x5e, 0x4f, 0xcd, 0x37, 0x77, 0x04, 0x10,
- },
- },
- .random_req[14] = {
- .value = {
- 0x59,0x02, 0xa1, 0x35, 0xd7, 0x12, 0x9a, 0x51,
- 0xf4,0xad, 0x32, 0xdf, 0x3b, 0xa4, 0x3a, 0xae,
- },
- },
- .random_rsp[14] = {
- .value = {
- 0x47,0x9e, 0x47, 0x0f, 0x53, 0xad, 0x74, 0x57,
- 0x1a,0xdc, 0x1b, 0x5f, 0xc0, 0xf0, 0x00, 0x1a,
- },
- },
- .confirm_req[15] = {
- .value = {
- 0x4c,0xa7, 0x4f, 0x64, 0xc1, 0xb7, 0xfe, 0xa9,
- 0xcb,0x94, 0x5f, 0x39, 0x9a, 0x1e, 0xbf, 0xb4,
- },
- },
- .confirm_rsp[15] = {
- .value = {
- 0xed,0x61, 0x96, 0xaa, 0xd5, 0x27, 0x23, 0x32,
- 0xc4,0x80, 0x52, 0x3c, 0x81, 0x45, 0x37, 0xc3,
- },
- },
- .random_req[15] = {
- .value = {
- 0xe4,0x2e, 0x04, 0xce, 0x7d, 0xbe, 0xb5, 0x5b,
- 0xb5,0xd5, 0xba, 0x60, 0x3f, 0x88, 0x05, 0xf1,
- },
- },
- .random_rsp[15] = {
- .value = {
- 0x64,0xa0, 0x95, 0x1f, 0x01, 0x7e, 0x00, 0x8d,
- 0x00,0x40, 0xa1, 0x2f, 0x90, 0x42, 0xcb, 0x15,
- },
- },
- .confirm_req[16] = {
- .value = {
- 0xce,0x32, 0x34, 0x33, 0x44, 0xbc, 0xb2, 0x8e,
- 0x64,0xfd, 0x8a, 0xeb, 0x41, 0xf9, 0x4d, 0xd7,
- },
- },
- .confirm_rsp[16] = {
- .value = {
- 0xb4,0x69, 0x44, 0xa5, 0x0a, 0x88, 0xfe, 0x39,
- 0x0c,0x7f, 0xc9, 0x8b, 0x7f, 0x7e, 0x6e, 0x45,
- },
- },
- .random_req[16] = {
- .value = {
- 0xff,0x56, 0x8f, 0x97, 0x85, 0x6e, 0xac, 0xd1,
- 0x00,0x0e, 0x8d, 0x2f, 0xf1, 0x68, 0xf9, 0xf2,
- },
- },
- .random_rsp[16] = {
- .value = {
- 0xc0,0x84, 0x5c, 0x92, 0x0d, 0x71, 0xdd, 0x88,
- 0xab,0x13, 0xa4, 0xf4, 0x06, 0x54, 0x4f, 0x1b,
- },
- },
- .confirm_req[17] = {
- .value = {
- 0x59,0xe5, 0x79, 0xdd, 0x1d, 0xd3, 0xa5, 0xf8,
- 0xba,0x7f, 0xf6, 0xc9, 0xaf, 0xca, 0xe8, 0xbc,
- },
- },
- .confirm_rsp[17] = {
- .value = {
- 0x39,0xd4, 0xc3, 0x39, 0xd9, 0x0b, 0x07, 0xe1,
- 0x6c,0x68, 0x6b, 0xef, 0xc8, 0x87, 0x93, 0x4f,
- },
- },
- .random_req[17] = {
- .value = {
- 0xaa,0xf9, 0xa4, 0xc9, 0xe0, 0x6f, 0xfc, 0x7b,
- 0x22,0x5a, 0xb6, 0x3d, 0x50, 0x3e, 0xd1, 0x02,
- },
- },
- .random_rsp[17] = {
- .value = {
- 0x22,0x90, 0x0e, 0xd4, 0x92, 0xb7, 0xa9, 0x16,
- 0x39,0x2a, 0x1c, 0xd2, 0x8b, 0xbf, 0xf7, 0x43,
- },
- },
- .confirm_req[18] = {
- .value = {
- 0x69,0xb9, 0x75, 0x4b, 0x80, 0xe8, 0x93, 0xbb,
- 0x57,0xe8, 0x37, 0x3c, 0x69, 0x47, 0x40, 0xb7,
- },
- },
- .confirm_rsp[18] = {
- .value = {
- 0xd8,0x69, 0x55, 0xf4, 0x84, 0x54, 0x95, 0x98,
- 0xdf,0x13, 0x69, 0x62, 0xbc, 0xea, 0x46, 0x16,
- },
- },
- .random_req[18] = {
- .value = {
- 0xf6,0x26, 0xc3, 0xec, 0xdc, 0xc8, 0x85, 0x78,
- 0xd4,0xe4, 0x0e, 0x1b, 0x05, 0x6d, 0x33, 0x20,
- },
- },
- .random_rsp[18] = {
- .value = {
- 0xf7,0xb6, 0x8a, 0xdc, 0xd5, 0xdd, 0x0f, 0x2f,
- 0x6a,0xab, 0x94, 0xcd, 0x68, 0xf4, 0x2d, 0xda,
- },
- },
- .confirm_req[19] = {
- .value = {
- 0x07,0xea, 0xe0, 0x61, 0x90, 0x23, 0x52, 0xd8,
- 0x90,0x50, 0xe1, 0x7c, 0x10, 0x1e, 0x41, 0xf0,
- },
- },
- .confirm_rsp[19] = {
- .value = {
- 0xed,0xd9, 0x02, 0xb7, 0x03, 0xd9, 0xe8, 0x87,
- 0x4a,0x48, 0x43, 0x96, 0xa0, 0x59, 0xb1, 0xa8,
- },
- },
- .random_req[19] = {
- .value = {
- 0x88,0x00, 0xe6, 0xfc, 0x1f, 0x6f, 0x92, 0x0e,
- 0x33,0xeb, 0x18, 0xc3, 0x5d, 0x7e, 0x37, 0x0e,
- },
- },
- .random_rsp[19] = {
- .value = {
- 0xfb,0xcf, 0x24, 0x02, 0x4a, 0xe4, 0x92, 0x47,
- 0xa9,0x67, 0x43, 0x33, 0x22, 0x95, 0x0a, 0xd3,
- },
- },
- .dhkey_check_req = (struct ble_sm_dhkey_check) {
- .value = {
- 0xcb, 0xb5, 0x5f, 0x62, 0xde, 0x14, 0xc7, 0x30,
- 0xaa, 0x58, 0x23, 0x3c, 0xdb, 0x39, 0xc1, 0xb9,
- }
- },
- .dhkey_check_rsp = (struct ble_sm_dhkey_check) {
- .value = {
- 0x52, 0x00, 0xeb, 0xe5, 0xd7, 0xa6, 0x5c, 0xc4,
- 0xf6, 0x6d, 0xa5, 0x7c, 0xff, 0xa8, 0x7c, 0x3f,
- }
- },
- .pair_alg = BLE_SM_PAIR_ALG_PASSKEY,
- .authenticated = 1,
- .ltk = {
- 0x45, 0x8a, 0x1b, 0x92, 0x1c, 0x2b, 0xdf, 0x3e,
- 0xda, 0xf9, 0x5c, 0xdf, 0x96, 0x59, 0xb7, 0x13,
- },
- .our_priv_key = {
- 0x20, 0x62, 0xba, 0x77, 0xfe, 0xdd, 0x34, 0xf7,
- 0x30, 0xcc, 0x35, 0x3f, 0xa3, 0x35, 0x02, 0x95,
- 0x2d, 0x03, 0x78, 0x4e, 0xe8, 0x80, 0xaa, 0x4d,
- 0x8c, 0xec, 0x93, 0x02, 0x28, 0x55, 0x2f, 0xf8,
- },
-
- .passkey_info = {
- .passkey = {
- .action = BLE_SM_IOACT_INPUT,
- .passkey = 873559,
- },
-
- .io_before_rx = 0,
- },
- };
- ble_sm_test_util_peer_sc_good(¶ms);
-}
-
-/*****************************************************************************
- * $us *
- *****************************************************************************/
-
-TEST_CASE(ble_sm_test_case_us_fail_inval)
-{
- struct ble_sm_test_lgcy_params params;
-
- /* Invalid IO capabiltiies. */
- params = (struct ble_sm_test_lgcy_params) {
- .init_id_addr = {0xe1, 0xfc, 0xda, 0xf4, 0xb7, 0x6c},
- .resp_id_addr = {0x03, 0x02, 0x01, 0x50, 0x13, 0x00},
- .pair_req = (struct ble_sm_pair_cmd) {
- .io_cap = 3,
- .oob_data_flag = 0,
- .authreq = 0,
- .max_enc_key_size = 16,
- .init_key_dist = 0,
- .resp_key_dist = 0,
- },
- .pair_rsp = (struct ble_sm_pair_cmd) {
- .io_cap = 0x14,
- .oob_data_flag = 0,
- .authreq = 0x05,
- .max_enc_key_size = 16,
- .init_key_dist = 0x07,
- .resp_key_dist = 0x07,
- },
- .pair_fail = (struct ble_sm_pair_fail) {
- .reason = BLE_SM_ERR_INVAL,
- },
- };
- ble_sm_test_util_us_fail_inval(¶ms);
-
- /* Invalid OOB flag. */
- params = (struct ble_sm_test_lgcy_params) {
- .init_id_addr = {0xe1, 0xfc, 0xda, 0xf4, 0xb7, 0x6c},
- .resp_id_addr = {0x03, 0x02, 0x01, 0x50, 0x13, 0x00},
- .pair_req = (struct ble_sm_pair_cmd) {
- .io_cap = 3,
- .oob_data_flag = 0,
- .authreq = 0,
- .max_enc_key_size = 16,
- .init_key_dist = 0,
- .resp_key_dist = 0,
- },
- .pair_rsp = (struct ble_sm_pair_cmd) {
- .io_cap = 0x14,
- .oob_data_flag = 2,
- .authreq = 0x05,
- .max_enc_key_size = 16,
- .init_key_dist = 0x07,
- .resp_key_dist = 0x07,
- },
- .pair_fail = (struct ble_sm_pair_fail) {
- .reason = BLE_SM_ERR_INVAL,
- },
- };
- ble_sm_test_util_us_fail_inval(¶ms);
-
- /* Invalid authreq - reserved bonding flag. */
- params = (struct ble_sm_test_lgcy_params) {
- .init_id_addr = {0xe1, 0xfc, 0xda, 0xf4, 0xb7, 0x6c},
- .resp_id_addr = {0x03, 0x02, 0x01, 0x50, 0x13, 0x00},
- .pair_req = (struct ble_sm_pair_cmd) {
- .io_cap = 3,
- .oob_data_flag = 0,
- .authreq = 0,
- .max_enc_key_size = 16,
- .init_key_dist = 0,
- .resp_key_dist = 0,
- },
- .pair_rsp = (struct ble_sm_pair_cmd) {
- .io_cap = 0x04,
- .oob_data_flag = 0,
- .authreq = 0x02,
- .max_enc_key_size = 16,
- .init_key_dist = 0x07,
- .resp_key_dist = 0x07,
- },
- .pair_fail = (struct ble_sm_pair_fail) {
- .reason = BLE_SM_ERR_INVAL,
- },
- };
- ble_sm_test_util_us_fail_inval(¶ms);
-
- /* Invalid authreq - reserved other flag. */
- params = (struct ble_sm_test_lgcy_params) {
- .init_id_addr = {0xe1, 0xfc, 0xda, 0xf4, 0xb7, 0x6c},
- .resp_id_addr = {0x03, 0x02, 0x01, 0x50, 0x13, 0x00},
- .pair_req = (struct ble_sm_pair_cmd) {
- .io_cap = 3,
- .oob_data_flag = 0,
- .authreq = 0,
- .max_enc_key_size = 16,
- .init_key_dist = 0,
- .resp_key_dist = 0,
- },
- .pair_rsp = (struct ble_sm_pair_cmd) {
- .io_cap = 0x04,
- .oob_data_flag = 0,
- .authreq = 0x20,
- .max_enc_key_size = 16,
- .init_key_dist = 0x07,
- .resp_key_dist = 0x07,
- },
- .pair_fail = (struct ble_sm_pair_fail) {
- .reason = BLE_SM_ERR_INVAL,
- },
- };
- ble_sm_test_util_us_fail_inval(¶ms);
-
- /* Invalid key size - too small. */
- params = (struct ble_sm_test_lgcy_params) {
- .init_id_addr = {0xe1, 0xfc, 0xda, 0xf4, 0xb7, 0x6c},
- .resp_id_addr = {0x03, 0x02, 0x01, 0x50, 0x13, 0x00},
- .pair_req = (struct ble_sm_pair_cmd) {
- .io_cap = 3,
- .oob_data_flag = 0,
- .authreq = 0,
- .max_enc_key_size = 16,
- .init_key_dist = 0,
- .resp_key_dist = 0,
- },
- .pair_rsp = (struct ble_sm_pair_cmd) {
- .io_cap = 0x04,
- .oob_data_flag = 0,
- .authreq = 0x05,
- .max_enc_key_size = 6,
- .init_key_dist = 0x07,
- .resp_key_dist = 0x07,
- },
- .pair_fail = (struct ble_sm_pair_fail) {
- .reason = BLE_SM_ERR_INVAL,
- },
- };
- ble_sm_test_util_us_fail_inval(¶ms);
-
- /* Invalid key size - too large. */
- params = (struct ble_sm_test_lgcy_params) {
- .init_id_addr = {0xe1, 0xfc, 0xda, 0xf4, 0xb7, 0x6c},
- .resp_id_addr = {0x03, 0x02, 0x01, 0x50, 0x13, 0x00},
- .pair_req = (struct ble_sm_pair_cmd) {
- .io_cap = 3,
- .oob_data_flag = 0,
- .authreq = 0,
- .max_enc_key_size = 16,
- .init_key_dist = 0,
- .resp_key_dist = 0,
- },
- .pair_rsp = (struct ble_sm_pair_cmd) {
- .io_cap = 0x04,
- .oob_data_flag = 0,
- .authreq = 0x05,
- .max_enc_key_size = 17,
- .init_key_dist = 0x07,
- .resp_key_dist = 0x07,
- },
- .pair_fail = (struct ble_sm_pair_fail) {
- .reason = BLE_SM_ERR_INVAL,
- },
- };
- ble_sm_test_util_us_fail_inval(¶ms);
-
- /* Invalid init key dist. */
- params = (struct ble_sm_test_lgcy_params) {
- .init_id_addr = {0xe1, 0xfc, 0xda, 0xf4, 0xb7, 0x6c},
- .resp_id_addr = {0x03, 0x02, 0x01, 0x50, 0x13, 0x00},
- .pair_req = (struct ble_sm_pair_cmd) {
- .io_cap = 3,
- .oob_data_flag = 0,
- .authreq = 0,
- .max_enc_key_size = 16,
- .init_key_dist = 0,
- .resp_key_dist = 0,
- },
- .pair_rsp = (struct ble_sm_pair_cmd) {
- .io_cap = 0x04,
- .oob_data_flag = 0,
- .authreq = 0x05,
- .max_enc_key_size = 17,
- .init_key_dist = 0x10,
- .resp_key_dist = 0x07,
- },
- .pair_fail = (struct ble_sm_pair_fail) {
- .reason = BLE_SM_ERR_INVAL,
- },
- };
- ble_sm_test_util_us_fail_inval(¶ms);
-
- /* Invalid resp key dist. */
- params = (struct ble_sm_test_lgcy_params) {
- .init_id_addr = {0xe1, 0xfc, 0xda, 0xf4, 0xb7, 0x6c},
- .resp_id_addr = {0x03, 0x02, 0x01, 0x50, 0x13, 0x00},
- .pair_req = (struct ble_sm_pair_cmd) {
- .io_cap = 3,
- .oob_data_flag = 0,
- .authreq = 0,
- .max_enc_key_size = 16,
- .init_key_dist = 0,
- .resp_key_dist = 0,
- },
- .pair_rsp = (struct ble_sm_pair_cmd) {
- .io_cap = 0x04,
- .oob_data_flag = 0,
- .authreq = 0x05,
- .max_enc_key_size = 17,
- .init_key_dist = 0x07,
- .resp_key_dist = 0x10,
- },
- .pair_fail = (struct ble_sm_pair_fail) {
- .reason = BLE_SM_ERR_INVAL,
- },
- };
- ble_sm_test_util_us_fail_inval(¶ms);
-}
-
-TEST_CASE(ble_sm_test_case_us_lgcy_jw_good)
-{
- struct ble_sm_test_lgcy_params params;
-
- params = (struct ble_sm_test_lgcy_params) {
- .init_id_addr = {0x06, 0x05, 0x04, 0x03, 0x02, 0x01},
- .resp_id_addr = {0x0f, 0x0e, 0x0d, 0x0c, 0x0b, 0x0a},
- .pair_req = (struct ble_sm_pair_cmd) {
- .io_cap = 3,
- .oob_data_flag = 0,
- .authreq = 0,
- .max_enc_key_size = 16,
- .init_key_dist = 0,
- .resp_key_dist = 0,
- },
- .pair_rsp = (struct ble_sm_pair_cmd) {
- .io_cap = 3,
- .oob_data_flag = 0,
- .authreq = 0,
- .max_enc_key_size = 16,
- .init_key_dist = 0,
- .resp_key_dist = 0,
- },
- .confirm_req = (struct ble_sm_pair_confirm) {
- .value = {
- 0x04, 0x4e, 0xaf, 0xce, 0x30, 0x79, 0x2c, 0x9e,
- 0xa2, 0xeb, 0x53, 0x6a, 0xdf, 0xf7, 0x99, 0xb2,
- },
- },
- .confirm_rsp = (struct ble_sm_pair_confirm) {
- .value = {
- 0x04, 0x4e, 0xaf, 0xce, 0x30, 0x79, 0x2c, 0x9e,
- 0xa2, 0xeb, 0x53, 0x6a, 0xdf, 0xf7, 0x99, 0xb2,
- },
- },
- .random_req = (struct ble_sm_pair_random) {
- .value = {
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- },
- },
- .random_rsp = (struct ble_sm_pair_random) {
- .value = {
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- },
- },
- .pair_alg = BLE_SM_PAIR_ALG_JW,
- .tk = { 0 },
- .stk = {
- 0x2e, 0x2b, 0x34, 0xca, 0x59, 0xfa, 0x4c, 0x88,
- 0x3b, 0x2c, 0x8a, 0xef, 0xd4, 0x4b, 0xe9, 0x66,
- },
- .r = 0,
- .ediv = 0,
- };
-
- ble_sm_test_util_us_lgcy_good(¶ms);
-}
-
-/**
- * Master: peer.
- * We send a security request.
- * We accept pairing request sent in response.
- */
-TEST_CASE(ble_sm_test_case_us_sec_req_pair)
-{
- struct ble_sm_test_lgcy_params params;
-
- params = (struct ble_sm_test_lgcy_params) {
- .init_id_addr = {0xe1, 0xfc, 0xda, 0xf4, 0xb7, 0x6c},
- .resp_id_addr = {0x0c, 0x0b, 0x0a, 0x09, 0x08, 0x07},
- .sec_req = (struct ble_sm_sec_req) {
- .authreq = 0x05,
- },
- .has_sec_req = 1,
- .pair_req = (struct ble_sm_pair_cmd) {
- .io_cap = 0x04,
- .oob_data_flag = 0,
- .authreq = 0x05,
- .max_enc_key_size = 16,
- .init_key_dist = 0x07,
- .resp_key_dist = 0x07,
- },
- .pair_rsp = (struct ble_sm_pair_cmd) {
- .io_cap = 0x02,
- .oob_data_flag = 0,
- .authreq = 0x05,
- .max_enc_key_size = 16,
- .init_key_dist = 0x01,
- .resp_key_dist = 0x01,
- },
- .confirm_req = (struct ble_sm_pair_confirm) {
- .value = {
- 0x54, 0xed, 0x7c, 0x65, 0xc5, 0x3a, 0xee, 0x87,
- 0x8e, 0xf8, 0x04, 0xd8, 0x93, 0xb0, 0xfa, 0xa4,
- },
- },
- .confirm_rsp = (struct ble_sm_pair_confirm) {
- .value = {
- 0xdf, 0x96, 0x88, 0x73, 0x49, 0x24, 0x3f, 0xe8,
- 0xb0, 0xaf, 0xb3, 0xf6, 0xc8, 0xf4, 0xe2, 0x36,
- },
- },
- .random_req = (struct ble_sm_pair_random) {
- .value = {
- 0x4d, 0x2c, 0xf2, 0xb7, 0x11, 0x56, 0xbd, 0x4f,
- 0xfc, 0xde, 0xa9, 0x86, 0x4d, 0xfd, 0x77, 0x03,
- },
- },
- .random_rsp = {
- .value = {
- 0x12, 0x45, 0x65, 0x2c, 0x85, 0x56, 0x32, 0x8f,
- 0xf4, 0x7f, 0x44, 0xd0, 0x17, 0x35, 0x41, 0xed
- },
- },
- .pair_alg = BLE_SM_PAIR_ALG_PASSKEY,
- .authenticated = 1,
- .tk = {
- 0x5a, 0x7f, 0x0d, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
- },
- .stk = {
- 0x2b, 0x9c, 0x1e, 0x42, 0xa8, 0xcb, 0xab, 0xd1,
- 0x4b, 0xde, 0x50, 0x05, 0x50, 0xd9, 0x95, 0xc6
- },
- .r = 4107344270811490869,
- .ediv = 61621,
-
- .passkey_info = {
- .passkey = {
- .action = BLE_SM_IOACT_INPUT,
- .passkey = 884570,
- },
- .io_before_rx = 1,
- },
-
- .enc_info_req = {
- .ltk = {
- 0x2b, 0x9c, 0x1e, 0x42, 0xa8, 0xcb, 0xab, 0xd1,
- 0x4b, 0xde, 0x50, 0x05, 0x50, 0xd9, 0x95, 0xc6
- },
- },
- .has_enc_info_req = 1,
-
- .master_id_req = {
- .ediv = 61621,
- .rand_val = 4107344270811490869,
- },
- .has_master_id_req = 1,
-
- .enc_info_rsp = {
- .ltk = { 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16 }
- },
- .has_enc_info_rsp = 1,
-
- .master_id_rsp = {
- .ediv = 61621,
- .rand_val = 4107344270811490869,
- },
- .has_master_id_rsp = 1,
- };
-
- ble_sm_test_util_peer_lgcy_good(¶ms);
-}
-
-/**
- * Master: peer
- * Secure connections
- * Pair algorithm: just works
- */
-TEST_CASE(ble_sm_test_case_us_sc_jw_good)
-{
- struct ble_sm_test_sc_params params;
-
- params = (struct ble_sm_test_sc_params) {
- .init_id_addr = {
- 0xd9, 0x38, 0x0c, 0x57, 0x0b, 0x00,
- },
- .resp_id_addr = {
- 0x01, 0x01, 0x01, 0x07, 0x08, 0x01,
- },
- .pair_req = {
- .io_cap = 0x03,
- .oob_data_flag = 0x00,
- .authreq = 0x08,
- .max_enc_key_size = 0x10,
- .init_key_dist = 0x00,
- .resp_key_dist = 0x00,
- },
- .pair_rsp = {
- .io_cap = 0x03,
- .oob_data_flag = 0x00,
- .authreq = 0x09,
- .max_enc_key_size = 0x10,
- .init_key_dist = 0x00,
- .resp_key_dist = 0x00,
- },
- .our_priv_key = {
- 0xad, 0xa6, 0xe6, 0x21, 0xca, 0x43, 0x4b, 0x56,
- 0xfd, 0xf7, 0x87, 0xe9, 0x2d, 0x0b, 0x04, 0x37,
- 0xf9, 0xb4, 0x34, 0xc9, 0x10, 0x54, 0xa1, 0xbd,
- 0xe7, 0x9f, 0x74, 0x76, 0xd0, 0x28, 0x59, 0x2e,
- },
- .public_key_req = {
- .x = {
- 0xce, 0x69, 0xfe, 0xff, 0xde, 0x17, 0x7d, 0x2a,
- 0xfb, 0x0b, 0x66, 0xec, 0x4a, 0xf3, 0xef, 0x62,
- 0x64, 0xb9, 0xbe, 0x3c, 0x03, 0x8d, 0xa3, 0xff,
- 0x27, 0xd1, 0xc0, 0x6e, 0xa3, 0x58, 0x4f, 0x4f,
- },
- .y = {
- 0x94, 0xa0, 0x8a, 0xa4, 0xc6, 0xf2, 0xd5, 0x28,
- 0xd3, 0x83, 0xb0, 0x1b, 0x4d, 0xc4, 0x31, 0x48,
- 0x87, 0x03, 0x05, 0x24, 0xdb, 0x62, 0x64, 0x98,
- 0xf2, 0xb5, 0xd6, 0x48, 0x9f, 0x58, 0x20, 0xd2,
- },
- },
- .public_key_rsp = {
- .x = {
- 0xb8, 0x74, 0x84, 0x87, 0x6c, 0xbb, 0x17, 0x94,
- 0x84, 0x4f, 0x55, 0xbf, 0x12, 0x68, 0x19, 0xb5,
- 0x0e, 0x7d, 0x6a, 0x80, 0xd9, 0x0a, 0x3f, 0x49,
- 0xbb, 0xe9, 0x76, 0x54, 0x81, 0xf7, 0x11, 0x8b,
- },
- .y = {
- 0x25, 0x51, 0x05, 0x3c, 0xa0, 0x3b, 0xab, 0xaa,
- 0xee, 0x51, 0x99, 0xc1, 0x48, 0xe9, 0x4b, 0xfd,
- 0xc3, 0xf7, 0x45, 0xd0, 0xfd, 0xd1, 0xab, 0x9f,
- 0x75, 0x2e, 0x3e, 0x7f, 0xd9, 0x2d, 0x30, 0xda,
- },
- },
- .confirm_rsp[0] = {
- .value = {
- 0xd6, 0x8c, 0x6e, 0x03, 0x9d, 0x29, 0xdc, 0xb1,
- 0xa5, 0x16, 0x4c, 0xf3, 0x6f, 0x32, 0xd3, 0x6c,
- },
- },
- .random_req[0] = {
- .value = {
- 0x15, 0x63, 0xb7, 0xf3, 0xda, 0xd4, 0xec, 0xe3,
- 0xd7, 0x28, 0xb4, 0xf0, 0xf5, 0xac, 0xfb, 0x9a,
- },
- },
- .random_rsp[0] = {
- .value = {
- 0x83, 0xa9, 0x2a, 0xa7, 0xfb, 0xcc, 0xcd, 0x3a,
- 0xaa, 0xd2, 0x08, 0xd8, 0x23, 0x21, 0xc8, 0x03,
- },
- },
- .dhkey_check_req = {
- .value = {
- 0x16, 0xd7, 0x43, 0x3e, 0xfd, 0x89, 0x36, 0x7d,
- 0x18, 0xad, 0x4d, 0xda, 0xa5, 0x48, 0x90, 0xdd,
- },
- },
- .dhkey_check_rsp = {
- .value = {
- 0xbe, 0xa9, 0x51, 0x38, 0x56, 0x82, 0x24, 0x42,
- 0xca, 0x3f, 0x66, 0xf4, 0xb8, 0x4e, 0xdb, 0x0e,
- },
- },
- .ltk = {
- 0xf3, 0x18, 0x03, 0x68, 0x79, 0x56, 0x75, 0x43,
- 0xcf, 0xaa, 0x80, 0x2d, 0xbc, 0x3a, 0x6b, 0x64,
- },
- .pair_alg = BLE_SM_PAIR_ALG_JW,
- .authenticated = 0,
- .passkey_info = {
- .passkey = {
- .action = BLE_SM_IOACT_NONE,
- },
- },
- };
- ble_sm_test_util_peer_sc_good(¶ms);
-}
-
-/**
- * Master: us
- * Secure connections
- * Pair algorithm: numeric comparison
- */
-TEST_CASE(ble_sm_test_case_us_sc_numcmp_good)
-{
- struct ble_sm_test_sc_params params;
-
- params = (struct ble_sm_test_sc_params) {
- .init_id_addr = { 0x06, 0x05, 0x04, 0x03, 0x02, 0x01 },
- .resp_id_addr = { 0x0c, 0x0b, 0x0a, 0x09, 0x08, 0x07 },
- .pair_req = (struct ble_sm_pair_cmd) {
- .io_cap = 0x01,
- .oob_data_flag = 0x00,
- .authreq = 0x0d,
- .max_enc_key_size = 16,
- .init_key_dist = 0x01,
- .resp_key_dist = 0x01,
- },
- .pair_rsp = (struct ble_sm_pair_cmd) {
- .io_cap = 0x01,
- .oob_data_flag = 0x00,
- .authreq = 0x0d,
- .max_enc_key_size = 16,
- .init_key_dist = 0x01,
- .resp_key_dist = 0x01,
- },
- .public_key_req = (struct ble_sm_public_key) {
- .x = {
- 0xb5, 0x48, 0x49, 0x35, 0xe6, 0xc4, 0x91, 0x6c,
- 0x65, 0x39, 0xd3, 0x51, 0x1d, 0x8c, 0xc5, 0x62,
- 0x87, 0xc9, 0x1b, 0x06, 0x96, 0x78, 0x4a, 0xaa,
- 0x18, 0x70, 0x85, 0x99, 0xfc, 0x01, 0xf4, 0xba
- },
- .y= {
- 0xe0, 0x9f, 0x1b, 0x49, 0x31, 0x43, 0xf8, 0xae,
- 0xff, 0xd1, 0x8f, 0x19, 0xc0, 0x1a, 0x44, 0x8f,
- 0x0c, 0xc6, 0xc4, 0x7f, 0x2e, 0xf0, 0xb4, 0x31,
- 0x1b, 0x75, 0xa9, 0x0a, 0xa1, 0x28, 0xb1, 0xbc
- },
- },
- .public_key_rsp = (struct ble_sm_public_key) {
- .x = {
- 0x04, 0xf7, 0x4b, 0x20, 0x94, 0x55, 0xd4, 0x95,
- 0xff, 0x04, 0x71, 0xa9, 0xe6, 0x36, 0x09, 0x9a,
- 0xd8, 0x55, 0xb3, 0x56, 0xcc, 0x59, 0x1d, 0xab,
- 0x7d, 0x0a, 0x21, 0x95, 0xc4, 0xdb, 0x8a, 0x8a
- },
- .y = {
- 0x08, 0xc9, 0xe7, 0x6b, 0x50, 0x3d, 0x25, 0x44,
- 0x32, 0xce, 0xa6, 0x07, 0xfc, 0x76, 0x78, 0xb7,
- 0xa4, 0x8a, 0xdc, 0xf8, 0x9c, 0x85, 0x61, 0x7f,
- 0x7f, 0x4f, 0x9e, 0xcd, 0xe3, 0xac, 0x78, 0x65
- },
-
- },
- .confirm_rsp[0] = {
- .value = {
- 0x36, 0xb4, 0x46, 0x1f, 0xc0, 0x6f, 0xd3, 0x5b,
- 0x18, 0x81, 0xbd, 0xe7, 0x05, 0xa2, 0x72, 0x75
- },
- },
- .random_req[0] = {
- .value = {
- 0x1e, 0xc6, 0x28, 0xd7, 0x7e, 0xb7, 0x4c, 0xe7,
- 0xbc, 0xac, 0x50, 0x67, 0xd1, 0x1c, 0xd9, 0xd8
- },
- },
- .random_rsp[0] = {
- .value = {
- 0x6b, 0x06, 0x4c, 0xdc, 0x02, 0x05, 0xcd, 0x34,
- 0xde, 0x0b, 0x4d, 0x37, 0x7f, 0x2c, 0x26, 0xef
- },
- },
- .dhkey_check_req = (struct ble_sm_dhkey_check) {
- .value = {
- 0xd5, 0x2d, 0x3e, 0x0b, 0x63, 0x4d, 0xea, 0xe8,
- 0x77, 0x10, 0x9c, 0x9a, 0xc5, 0x61, 0x89, 0x24
- }
- },
- .dhkey_check_rsp = (struct ble_sm_dhkey_check) {
- .value = {
- 0x2d, 0x1f, 0x24, 0x2e, 0x80, 0x0e, 0xc3, 0x74,
- 0xe3, 0x3f, 0xdb, 0xb6, 0x3e, 0x3d, 0x24, 0x08
- }
- },
- .pair_alg = BLE_SM_PAIR_ALG_NUMCMP,
- .authenticated = 1,
- .ltk = {
- 0x38, 0xfd, 0x2a, 0x71, 0xfd, 0xd0, 0x03, 0xc0,
- 0x2e, 0xb0, 0xa3, 0xc3, 0x01, 0xf7, 0x4e, 0x41
- },
- .our_priv_key = {
- 0x90, 0x79, 0x54, 0xed, 0xed, 0x5f, 0x0c, 0x86,
- 0x98, 0x41, 0x6d, 0xec, 0xde, 0xd0, 0x4b, 0x5a,
- 0x52, 0xca, 0x04, 0x04, 0x76, 0x73, 0x0f, 0x79,
- 0xd0, 0xf8, 0xff, 0x33, 0xd2, 0x36, 0x77, 0x1e
- },
-
- .passkey_info = {
- .passkey = {
- .action = BLE_SM_IOACT_NUMCMP,
- .numcmp_accept = 1,
- },
-
- .exp_numcmp = 9737,
- .io_before_rx = 0,
- },
- };
- ble_sm_test_util_us_sc_good(¶ms);
-}
-
-/**
- * Master: us
- * Secure connections
- * Pair algorithm: passkey entry
- */
-TEST_CASE(ble_sm_test_case_us_sc_passkey_good)
-{
- struct ble_sm_test_sc_params params;
-
- params = (struct ble_sm_test_sc_params) {
- .init_id_addr = {
- 0x01, 0x01, 0x01, 0x07, 0x08, 0x01,
- },
- .resp_id_addr = {
- 0x5d, 0xab, 0xaa, 0x67, 0x11, 0x00,
- },
- .pair_req = {
- .io_cap = 0x00,
- .oob_data_flag = 0x00,
- .authreq = 0x0d,
- .max_enc_key_size = 0x10,
- .init_key_dist = 0x07,
- .resp_key_dist = 0x07,
- },
- .pair_rsp = {
- .io_cap = 0x02,
- .oob_data_flag = 0x00,
- .authreq = 0x0d,
- .max_enc_key_size = 0x10,
- .init_key_dist = 0x06,
- .resp_key_dist = 0x06,
- },
- .our_priv_key = {
- 0xa2, 0x9d, 0x42, 0x60, 0xb0, 0xe2, 0x7c, 0x32,
- 0xfc, 0x7f, 0xc3, 0x42, 0xa2, 0x67, 0xfd, 0x39,
- 0x67, 0xb5, 0x8e, 0x37, 0xde, 0x6e, 0xd7, 0xda,
- 0x04, 0xed, 0x22, 0xf1, 0x5d, 0xa1, 0xd4, 0x1c,
- },
- .public_key_req = {
- .x = {
- 0xd2, 0x95, 0x3e, 0x65, 0x4f, 0x62, 0xea, 0x87,
- 0x4c, 0x5c, 0xef, 0xcc, 0x5e, 0x6d, 0xb6, 0xc4,
- 0x30, 0xd9, 0x09, 0x25, 0xca, 0xba, 0xd1, 0x61,
- 0x5b, 0x9c, 0x8a, 0xe3, 0x29, 0xcd, 0xf4, 0x46,
- },
- .y = {
- 0x40, 0xda, 0x39, 0xec, 0xd0, 0xd9, 0x13, 0x2f,
- 0x22, 0xc9, 0xc4, 0x6e, 0x67, 0x58, 0xb0, 0xde,
- 0xb3, 0x24, 0xfd, 0x9a, 0x13, 0x32, 0x38, 0x83,
- 0x71, 0x80, 0x20, 0xc3, 0x69, 0xbf, 0x18, 0x2c,
- },
- },
- .public_key_rsp = {
- .x = {
- 0xb9, 0x1d, 0xc1, 0xe5, 0x64, 0x0c, 0xcb, 0xdb,
- 0xc8, 0xbd, 0x00, 0x60, 0xca, 0x08, 0x80, 0x20,
- 0xb6, 0x22, 0x04, 0xb8, 0xd6, 0x33, 0x80, 0x8a,
- 0xda, 0x9a, 0x65, 0x98, 0x27, 0x59, 0x48, 0x56,
- },
- .y = {
- 0x24, 0xfc, 0x92, 0x11, 0x14, 0xee, 0x44, 0x2a,
- 0x91, 0x11, 0x18, 0x13, 0xed, 0xf2, 0x83, 0xd0,
- 0x81, 0x1a, 0xaa, 0x23, 0x0c, 0x12, 0x80, 0x96,
- 0xb6, 0x32, 0x1a, 0x56, 0xd5, 0x86, 0x8e, 0x20,
- },
- },
- .confirm_req[0] = {
- .value = {
- 0xf8, 0xd7, 0x8b, 0xd1, 0xc3, 0x8e, 0xda, 0xb1,
- 0xbd, 0x0a, 0xa8, 0x2f, 0xa5, 0x0e, 0x31, 0x1e,
- },
- },
- .confirm_rsp[0] = {
- .value = {
- 0x62, 0x90, 0x2e, 0x53, 0x50, 0x49, 0xdc, 0x15,
- 0x23, 0x32, 0x94, 0xaa, 0x1d, 0x47, 0x92, 0x1b,
- },
- },
- .random_req[0] = {
- .value = {
- 0xa9, 0x17, 0xb6, 0x2c, 0xa9, 0x60, 0x57, 0x95,
- 0x00, 0x9d, 0x91, 0x60, 0xb3, 0x3d, 0x66, 0x8a,
- },
- },
- .random_rsp[0] = {
- .value = {
- 0x29, 0xf4, 0x38, 0xc7, 0x15, 0xf1, 0x2c, 0x93,
- 0x3b, 0x62, 0x1a, 0xd3, 0x02, 0xdc, 0xa0, 0x16,
- },
- },
- .confirm_req[1] = {
- .value = {
- 0xda, 0xd4, 0xe3, 0xd6, 0x05, 0x04, 0xce, 0x13,
- 0xec, 0x45, 0xc5, 0x07, 0x76, 0xaf, 0x99, 0x6a,
- },
- },
- .confirm_rsp[1] = {
- .value = {
- 0xb8, 0x30, 0x8f, 0x9b, 0xda, 0xb0, 0x83, 0x0e,
- 0x9d, 0x51, 0xd0, 0xd2, 0x01, 0xf8, 0xca, 0xee,
- },
- },
- .random_req[1] = {
- .value = {
- 0xf9, 0x53, 0xa9, 0xa8, 0xf5, 0x3c, 0x82, 0x4d,
- 0x20, 0x0f, 0x4a, 0xa9, 0x93, 0xcf, 0xeb, 0x53,
- },
- },
- .random_rsp[1] = {
- .value = {
- 0xa3, 0xe1, 0x17, 0x79, 0x15, 0x46, 0x76, 0x2d,
- 0x08, 0xf5, 0x87, 0x23, 0x01, 0xe8, 0x17, 0xf7,
- },
- },
- .confirm_req[2] = {
- .value = {
- 0xf0, 0x60, 0x26, 0x3c, 0x9f, 0x1a, 0x47, 0xa8,
- 0xf5, 0xbd, 0x6d, 0xae, 0x82, 0xa4, 0x69, 0xe5,
- },
- },
- .confirm_rsp[2] = {
- .value = {
- 0x53, 0xda, 0xca, 0xcd, 0x4d, 0x4d, 0x79, 0x23,
- 0x3d, 0xa5, 0xcb, 0x22, 0x92, 0x91, 0xe4, 0x71,
- },
- },
- .random_req[2] = {
- .value = {
- 0xfd, 0xc6, 0x66, 0x9d, 0x46, 0x0d, 0xa8, 0x6c,
- 0x0a, 0xe8, 0x0b, 0xf7, 0x43, 0x22, 0x8e, 0x0d,
- },
- },
- .random_rsp[2] = {
- .value = {
- 0x1a, 0xcf, 0x1e, 0x2c, 0x2b, 0x5e, 0xc4, 0x70,
- 0x93, 0xde, 0x49, 0x2b, 0x0b, 0x9c, 0x59, 0x6f,
- },
- },
- .confirm_req[3] = {
- .value = {
- 0x28, 0x07, 0x48, 0x38, 0xc5, 0x10, 0x04, 0x07,
- 0x29, 0xad, 0x46, 0x9a, 0xd0, 0x40, 0xff, 0xa3,
- },
- },
- .confirm_rsp[3] = {
- .value = {
- 0xc3, 0x05, 0x43, 0xa6, 0x1e, 0xf7, 0xec, 0x2b,
- 0xa3, 0x78, 0x28, 0x7f, 0x00, 0x8b, 0x0e, 0x93,
- },
- },
- .random_req[3] = {
- .value = {
- 0xd3, 0x47, 0x73, 0xb0, 0x3b, 0x14, 0x5d, 0x02,
- 0x8e, 0xa2, 0xdd, 0x73, 0x9c, 0x61, 0xde, 0x39,
- },
- },
- .random_rsp[3] = {
- .value = {
- 0x38, 0x73, 0x05, 0x1b, 0x88, 0xf0, 0x08, 0x43,
- 0xac, 0x11, 0x00, 0x93, 0x40, 0x44, 0xa1, 0xa5,
- },
- },
- .confirm_req[4] = {
- .value = {
- 0x5c, 0x8b, 0x2d, 0x5d, 0xb3, 0x09, 0xd9, 0x70,
- 0x2f, 0x30, 0x89, 0x7a, 0xfd, 0xe9, 0x25, 0x41,
- },
- },
- .confirm_rsp[4] = {
- .value = {
- 0xf2, 0x3d, 0x0d, 0x14, 0x8f, 0x0a, 0xed, 0x83,
- 0x87, 0xcf, 0x1b, 0xda, 0x57, 0x91, 0x45, 0xb0,
- },
- },
- .random_req[4] = {
- .value = {
- 0xae, 0xc4, 0x19, 0x5e, 0xd3, 0xae, 0x04, 0x4a,
- 0xf1, 0xdd, 0x6b, 0x93, 0xa3, 0x30, 0x39, 0x15,
- },
- },
- .random_rsp[4] = {
- .value = {
- 0x2a, 0xa8, 0xa7, 0x97, 0x07, 0x24, 0x31, 0x11,
- 0x06, 0x2a, 0x06, 0xba, 0x08, 0x5d, 0x79, 0x1c,
- },
- },
- .confirm_req[5] = {
- .value = {
- 0xee, 0xe5, 0x6e, 0x53, 0xd9, 0x2d, 0x08, 0x16,
- 0x71, 0x1f, 0xfd, 0xd6, 0x06, 0x81, 0x28, 0x44,
- },
- },
- .confirm_rsp[5] = {
- .value = {
- 0x7f, 0xe3, 0x43, 0x09, 0x51, 0x03, 0x9e, 0xe2,
- 0x6a, 0x6c, 0x98, 0xed, 0x0b, 0x87, 0x60, 0x0f,
- },
- },
- .random_req[5] = {
- .value = {
- 0x65, 0x31, 0xca, 0xfa, 0xb4, 0xa5, 0x7e, 0xac,
- 0xb2, 0xb0, 0xe5, 0x18, 0xab, 0x4d, 0xfa, 0x6f,
- },
- },
- .random_rsp[5] = {
- .value = {
- 0xa1, 0x20, 0x17, 0x37, 0x14, 0x41, 0x73, 0x60,
- 0x1e, 0x95, 0x0f, 0x59, 0xca, 0x13, 0x01, 0x70,
- },
- },
- .confirm_req[6] = {
- .value = {
- 0xdc, 0x24, 0x50, 0x40, 0x24, 0x59, 0x92, 0xa5,
- 0x48, 0x1a, 0x51, 0x28, 0x10, 0xf8, 0x03, 0x6f,
- },
- },
- .confirm_rsp[6] = {
- .value = {
- 0xf1, 0xc4, 0x5e, 0x43, 0xfc, 0x50, 0xe7, 0x7b,
- 0x54, 0x84, 0xb5, 0xb1, 0xd6, 0x6c, 0x8e, 0xab,
- },
- },
- .random_req[6] = {
- .value = {
- 0xff, 0xa6, 0x57, 0x88, 0x15, 0xb6, 0xf3, 0x2f,
- 0x44, 0x8b, 0x1b, 0xf5, 0x82, 0xf7, 0x8f, 0x8b,
- },
- },
- .random_rsp[6] = {
- .value = {
- 0x11, 0x53, 0x47, 0xdc, 0x8a, 0xc8, 0x85, 0xe8,
- 0x13, 0x35, 0xc9, 0x23, 0x04, 0x68, 0x57, 0x77,
- },
- },
- .confirm_req[7] = {
- .value = {
- 0xab, 0x1e, 0x35, 0xf5, 0xe2, 0x05, 0xba, 0xab,
- 0x66, 0x05, 0x71, 0x3b, 0x6d, 0x89, 0x96, 0x6f,
- },
- },
- .confirm_rsp[7] = {
- .value = {
- 0xa5, 0xf5, 0xe9, 0xf2, 0x56, 0xdd, 0xd4, 0x9c,
- 0x21, 0x71, 0x6c, 0xd0, 0x9d, 0x74, 0x9d, 0x1f,
- },
- },
- .random_req[7] = {
- .value = {
- 0x7f, 0xc6, 0x91, 0x00, 0xac, 0x8c, 0x0b, 0x56,
- 0x32, 0xd0, 0x96, 0xdd, 0xa6, 0x6a, 0xc7, 0xcd,
- },
- },
- .random_rsp[7] = {
- .value = {
- 0x38, 0x73, 0x05, 0x1b, 0x88, 0xf0, 0x08, 0x43,
- 0xac, 0x11, 0x00, 0x93, 0x40, 0x44, 0xa1, 0xa5,
- },
- },
- .confirm_req[8] = {
- .value = {
- 0x48, 0x9b, 0xbe, 0xc5, 0x33, 0xec, 0xe4, 0x53,
- 0xad, 0x78, 0x2f, 0x5f, 0x5a, 0xd0, 0x1d, 0x23,
- },
- },
- .confirm_rsp[8] = {
- .value = {
- 0x5a, 0x3c, 0x74, 0x5c, 0xa0, 0xbe, 0xe2, 0x55,
- 0x15, 0x1c, 0x36, 0x5c, 0xdc, 0x73, 0x15, 0x8f,
- },
- },
- .random_req[8] = {
- .value = {
- 0xfb, 0xed, 0xa1, 0x86, 0xc9, 0x9b, 0xa1, 0x78,
- 0xdc, 0x4a, 0x2e, 0x7b, 0x3d, 0x13, 0xff, 0xe2,
- },
- },
- .random_rsp[8] = {
- .value = {
- 0x0c, 0xf2, 0x3e, 0x12, 0xe7, 0x14, 0x05, 0x37,
- 0x00, 0x6c, 0x2d, 0x12, 0x86, 0xc0, 0x44, 0xae,
- },
- },
- .confirm_req[9] = {
- .value = {
- 0xd2, 0xfa, 0x02, 0x65, 0xde, 0xce, 0x27, 0x0f,
- 0xc9, 0x6e, 0x67, 0xba, 0x0a, 0x6e, 0x5a, 0x46,
- },
- },
- .confirm_rsp[9] = {
- .value = {
- 0xca, 0x65, 0x4d, 0xb8, 0x03, 0x29, 0x81, 0xe7,
- 0x2c, 0x53, 0x54, 0x44, 0xee, 0xe7, 0x63, 0xc3,
- },
- },
- .random_req[9] = {
- .value = {
- 0xa8, 0x82, 0xe0, 0xba, 0xe9, 0x10, 0xd5, 0x18,
- 0x59, 0xb0, 0xea, 0xf9, 0xcb, 0x8b, 0x1f, 0x92,
- },
- },
- .random_rsp[9] = {
- .value = {
- 0x05, 0xe8, 0xd7, 0x54, 0x08, 0x3c, 0x2c, 0x61,
- 0x1e, 0x2d, 0x0f, 0x58, 0xc9, 0x18, 0x01, 0x6f,
- },
- },
- .confirm_req[10] = {
- .value = {
- 0xc7, 0xf9, 0xbc, 0x6c, 0xb8, 0x65, 0x58, 0xdd,
- 0xf7, 0x41, 0xbe, 0x82, 0x9f, 0xf3, 0x5f, 0x7c,
- },
- },
- .confirm_rsp[10] = {
- .value = {
- 0x8d, 0xcb, 0x7a, 0x4b, 0x16, 0x36, 0x3f, 0x27,
- 0xd2, 0xf0, 0x47, 0xad, 0x06, 0x3c, 0xd5, 0x2d,
- },
- },
- .random_req[10] = {
- .value = {
- 0x14, 0x76, 0x2a, 0xd4, 0xa3, 0xf3, 0xe7, 0x17,
- 0x29, 0x1c, 0x4f, 0x95, 0x53, 0xa2, 0xd4, 0xc8,
- },
- },
- .random_rsp[10] = {
- .value = {
- 0xc7, 0x18, 0x04, 0xcf, 0x64, 0xab, 0x0e, 0x9b,
- 0x49, 0x74, 0x4f, 0x07, 0x02, 0x13, 0x4f, 0x0b,
- },
- },
- .confirm_req[11] = {
- .value = {
- 0x48, 0xa7, 0x32, 0xe3, 0xa4, 0x90, 0xc1, 0x5e,
- 0x36, 0x44, 0x3e, 0x21, 0xdd, 0x3e, 0x1b, 0x85,
- },
- },
- .confirm_rsp[11] = {
- .value = {
- 0xd7, 0x2f, 0x35, 0xa2, 0x2e, 0xc7, 0x68, 0xa1,
- 0xc4, 0x81, 0xeb, 0xb6, 0xbc, 0x4c, 0xcb, 0xc1,
- },
- },
- .random_req[11] = {
- .value = {
- 0xee, 0x15, 0xfe, 0x73, 0x1e, 0xa2, 0xe1, 0x0b,
- 0x19, 0xe1, 0x39, 0x32, 0xb1, 0xc6, 0x82, 0x21,
- },
- },
- .random_rsp[11] = {
- .value = {
- 0x15, 0x3f, 0x6c, 0xc6, 0x06, 0x28, 0x04, 0x47,
- 0x3c, 0xdc, 0x0d, 0x5a, 0x01, 0x9f, 0x6f, 0xe6,
- },
- },
- .confirm_req[12] = {
- .value = {
- 0x5a, 0x8f, 0xd9, 0xb9, 0xc8, 0x8c, 0x2f, 0xf9,
- 0x55, 0xa2, 0x2f, 0xf5, 0xca, 0x67, 0xe9, 0x36,
- },
- },
- .confirm_rsp[12] = {
- .value = {
- 0xa2, 0x71, 0xae, 0xf7, 0xec, 0xf4, 0x91, 0x5d,
- 0x5f, 0x50, 0xf6, 0x85, 0xab, 0x64, 0x84, 0x7d,
- },
- },
- .random_req[12] = {
- .value = {
- 0x2d, 0x52, 0x5c, 0x7c, 0x6b, 0xfb, 0x01, 0x9d,
- 0x1e, 0x8e, 0xbe, 0x14, 0xe6, 0x42, 0xc8, 0x7a,
- },
- },
- .random_rsp[12] = {
- .value = {
- 0x0c, 0xdc, 0x3d, 0xbb, 0xe6, 0x25, 0x05, 0x33,
- 0x0d, 0x42, 0x01, 0x40, 0x5f, 0x8b, 0xcc, 0x7b,
- },
- },
- .confirm_req[13] = {
- .value = {
- 0x3e, 0x56, 0xa1, 0x59, 0x3d, 0x68, 0x57, 0x12,
- 0xf2, 0xe1, 0x56, 0x31, 0xd7, 0x1e, 0xaa, 0x94,
- },
- },
- .confirm_rsp[13] = {
- .value = {
- 0xcb, 0x6f, 0x5b, 0x5a, 0x5e, 0xae, 0x6e, 0x20,
- 0x4f, 0xe8, 0xb0, 0xbb, 0xfb, 0xcd, 0xed, 0x7c,
- },
- },
- .random_req[13] = {
- .value = {
- 0xff, 0x99, 0x8e, 0xe5, 0x47, 0xaf, 0xcf, 0xb0,
- 0x0e, 0x36, 0x29, 0x8a, 0x1c, 0x5f, 0x84, 0xf2,
- },
- },
- .random_rsp[13] = {
- .value = {
- 0x4a, 0x13, 0x08, 0xd3, 0x54, 0xe1, 0x04, 0xe8,
- 0x22, 0x13, 0x2b, 0x53, 0xc2, 0xe1, 0x04, 0xe8,
- },
- },
- .confirm_req[14] = {
- .value = {
- 0xee, 0xa3, 0xd0, 0x41, 0xa1, 0x22, 0x70, 0x09,
- 0xef, 0xd7, 0x53, 0xa2, 0x50, 0xba, 0x0d, 0xda,
- },
- },
- .confirm_rsp[14] = {
- .value = {
- 0xbb, 0x54, 0x96, 0xba, 0x65, 0x0d, 0xef, 0xf4,
- 0x07, 0xf1, 0x8c, 0x2e, 0x96, 0x68, 0xf6, 0x2a,
- },
- },
- .random_req[14] = {
- .value = {
- 0x2d, 0x90, 0xf1, 0xc0, 0x3f, 0xdc, 0xf5, 0x04,
- 0x9b, 0x44, 0x47, 0xca, 0x79, 0x30, 0xce, 0xf1,
- },
- },
- .random_rsp[14] = {
- .value = {
- 0x3e, 0x62, 0x1d, 0xd3, 0x05, 0xdc, 0x9e, 0x34,
- 0x69, 0xbc, 0x68, 0x8f, 0x02, 0x83, 0x09, 0xc6,
- },
- },
- .confirm_req[15] = {
- .value = {
- 0x7a, 0x04, 0x8d, 0x33, 0x17, 0xf3, 0xd3, 0x4b,
- 0xbb, 0xee, 0x9f, 0xd4, 0xf7, 0x57, 0xd0, 0xbf,
- },
- },
- .confirm_rsp[15] = {
- .value = {
- 0x5c, 0xd8, 0x9c, 0x76, 0xb1, 0x15, 0x86, 0x5a,
- 0x97, 0xec, 0x4f, 0xee, 0x05, 0xa9, 0x6e, 0x70,
- },
- },
- .random_req[15] = {
- .value = {
- 0xb5, 0x3f, 0xf9, 0x77, 0x4b, 0x1a, 0x48, 0x1b,
- 0xdc, 0x5a, 0x77, 0x33, 0x9f, 0x8a, 0x5e, 0x90,
- },
- },
- .random_rsp[15] = {
- .value = {
- 0x15, 0x3f, 0x6c, 0xc6, 0x06, 0x28, 0x04, 0x47,
- 0x3c, 0xdd, 0x0e, 0x48, 0x01, 0xa0, 0x70, 0x9b,
- },
- },
- .confirm_req[16] = {
- .value = {
- 0x3b, 0xc6, 0x0a, 0xd5, 0x5a, 0xb1, 0x61, 0xaf,
- 0x5b, 0x8b, 0x58, 0x3b, 0x23, 0xea, 0xed, 0x81,
- },
- },
- .confirm_rsp[16] = {
- .value = {
- 0x54, 0xaf, 0xe2, 0x69, 0xaa, 0xaf, 0x5d, 0xd6,
- 0x21, 0x75, 0x09, 0x13, 0x0a, 0x41, 0x7a, 0x10,
- },
- },
- .random_req[16] = {
- .value = {
- 0xff, 0x0f, 0x22, 0x7f, 0x03, 0xd4, 0x80, 0x85,
- 0xd8, 0x0a, 0x66, 0xb2, 0x8d, 0x6a, 0x65, 0x00,
- },
- },
- .random_rsp[16] = {
- .value = {
- 0x0c, 0xdc, 0x3d, 0xbb, 0xe6, 0x25, 0x05, 0x33,
- 0x0d, 0x42, 0x01, 0x40, 0x5f, 0x8b, 0xcc, 0x7b,
- },
- },
- .confirm_req[17] = {
- .value = {
- 0x2d, 0xc8, 0x19, 0x6a, 0xfe, 0x40, 0x57, 0x4f,
- 0xa8, 0xbe, 0x58, 0xd9, 0x8e, 0x32, 0x96, 0xe2,
- },
- },
- .confirm_rsp[17] = {
- .value = {
- 0x94, 0xff, 0x0b, 0x01, 0x11, 0xe3, 0x97, 0xdb,
- 0xba, 0x0f, 0x75, 0x25, 0x39, 0xe6, 0xa2, 0x49,
- },
- },
- .random_req[17] = {
- .value = {
- 0xe2, 0x7f, 0x62, 0xfe, 0x5f, 0xe8, 0x80, 0x78,
- 0x16, 0x7d, 0x9d, 0x70, 0x7c, 0x5c, 0x74, 0xe7,
- },
- },
- .random_rsp[17] = {
- .value = {
- 0xd0, 0x41, 0x09, 0x80, 0x1a, 0xe1, 0x8e, 0xca,
- 0x58, 0x50, 0x34, 0x7f, 0x3d, 0x1f, 0x23, 0xc9,
- },
- },
- .confirm_req[18] = {
- .value = {
- 0x84, 0xcf, 0xe3, 0x8e, 0xfe, 0x08, 0xca, 0x37,
- 0x22, 0x51, 0x33, 0xdc, 0x8c, 0xc6, 0x1c, 0x42,
- },
- },
- .confirm_rsp[18] = {
- .value = {
- 0xf0, 0xbf, 0xff, 0xfe, 0x8c, 0xf3, 0x86, 0x08,
- 0x33, 0x78, 0x04, 0x2d, 0x10, 0x4f, 0xb7, 0x0a,
- },
- },
- .random_req[18] = {
- .value = {
- 0xaa, 0x15, 0x3c, 0xa2, 0x00, 0x85, 0x2b, 0x22,
- 0x55, 0x3a, 0xc3, 0x57, 0x1c, 0x8f, 0x12, 0xc4,
- },
- },
- .random_rsp[18] = {
- .value = {
- 0x0b, 0xc0, 0x19, 0x92, 0x8a, 0x88, 0x05, 0xe7,
- 0x36, 0xbf, 0x3b, 0xd0, 0x1f, 0x87, 0x05, 0xe4,
- },
- },
- .confirm_req[19] = {
- .value = {
- 0xcc, 0x43, 0xbe, 0x75, 0x4d, 0x37, 0x49, 0x17,
- 0x6e, 0x19, 0x19, 0xf5, 0xbc, 0xcb, 0xf7, 0xdf,
- },
- },
- .confirm_rsp[19] = {
- .value = {
- 0x40, 0x69, 0x4e, 0x28, 0xfd, 0x0e, 0xc9, 0x89,
- 0x1d, 0x68, 0x40, 0xfd, 0xdc, 0x5c, 0xed, 0x1e,
- },
- },
- .random_req[19] = {
- .value = {
- 0xa4, 0xc6, 0x1f, 0xa7, 0x88, 0xd4, 0x5e, 0x0b,
- 0xe1, 0x43, 0xd4, 0x83, 0x52, 0xbd, 0xd4, 0x47,
- },
- },
- .random_rsp[19] = {
- .value = {
- 0x15, 0x3f, 0x6c, 0xc6, 0x06, 0x28, 0x04, 0x47,
- 0x3c, 0xdd, 0x0e, 0x48, 0x01, 0xa0, 0x70, 0x9b,
- },
- },
- .dhkey_check_req = {
- .value = {
- 0x7f, 0x11, 0x0f, 0x4a, 0xc8, 0xfc, 0x50, 0x3c,
- 0xd6, 0x4d, 0xa6, 0x8e, 0xc3, 0x05, 0x38, 0x68,
- },
- },
- .dhkey_check_rsp = {
- .value = {
- 0x01, 0x82, 0xdb, 0xcf, 0x45, 0x4f, 0xd9, 0xa9,
- 0x84, 0x0a, 0xbb, 0xba, 0x10, 0xd5, 0xa2, 0x8d,
- },
- },
- .id_info_req = {
- .irk = {
- 0xe6, 0x76, 0xc3, 0x82, 0x96, 0xea, 0xbc, 0x0f,
- 0x26, 0xcc, 0xdc, 0xf8, 0x03, 0xae, 0x2e, 0xca,
- },
- },
- .id_addr_info_req = {
- .addr_type = 0,
- .bd_addr = {
- 0x5d, 0xab, 0xaa, 0x67, 0x11, 0x00,
- },
- },
- .sign_info_req = {
- .sig_key = {
- 0xec, 0xa4, 0xbf, 0x6c, 0x58, 0xa3, 0xa7, 0x5c,
- 0x5b, 0xfa, 0x55, 0x41, 0xf0, 0xa0, 0x55, 0xba,
- },
- },
- .id_info_rsp = {
- .irk = {
- 0xef, 0x8d, 0xe2, 0x16, 0x4f, 0xec, 0x43, 0x0d,
- 0xbf, 0x5b, 0xdd, 0x34, 0xc0, 0x53, 0x1e, 0xb8,
- },
+ .io_cap = 0x04,
+ .oob_data_flag = 0,
+ .authreq = 0x05,
+ .max_enc_key_size = 17,
+ .init_key_dist = 0x10,
+ .resp_key_dist = 0x07,
},
- .id_addr_info_rsp = {
- .addr_type = 0,
- .bd_addr = {
- 0x01, 0x01, 0x01, 0x07, 0x08, 0x01,
- },
+ .pair_fail = (struct ble_sm_pair_fail) {
+ .reason = BLE_SM_ERR_INVAL,
},
- .sign_info_rsp = {
- .sig_key = {
- 0x6c, 0xaa, 0x89, 0xe1, 0xbc, 0x98, 0x0d, 0x5f,
- 0x0d, 0x07, 0x5f, 0x81, 0x69, 0xdb, 0x75, 0x72,
- },
+ };
+ ble_sm_test_util_us_fail_inval(¶ms);
+
+ /* Invalid resp key dist. */
+ params = (struct ble_sm_test_params) {
+ .init_id_addr = {0xe1, 0xfc, 0xda, 0xf4, 0xb7, 0x6c},
+ .resp_id_addr = {0x03, 0x02, 0x01, 0x50, 0x13, 0x00},
+ .pair_req = (struct ble_sm_pair_cmd) {
+ .io_cap = 3,
+ .oob_data_flag = 0,
+ .authreq = 0,
+ .max_enc_key_size = 16,
+ .init_key_dist = 0,
+ .resp_key_dist = 0,
},
- .ltk = {
- 0x0a, 0xad, 0xb7, 0x13, 0x4d, 0x9a, 0xed, 0xa9,
- 0x12, 0xbd, 0xde, 0xa0, 0x51, 0x9e, 0x67, 0x26,
+ .pair_rsp = (struct ble_sm_pair_cmd) {
+ .io_cap = 0x04,
+ .oob_data_flag = 0,
+ .authreq = 0x05,
+ .max_enc_key_size = 17,
+ .init_key_dist = 0x07,
+ .resp_key_dist = 0x10,
},
- .pair_alg = BLE_SM_PAIR_ALG_PASSKEY,
- .authenticated = 1,
- .passkey_info = {
- .passkey = {
- .action = BLE_SM_IOACT_DISP,
- .passkey = 946612,
- },
+ .pair_fail = (struct ble_sm_pair_fail) {
+ .reason = BLE_SM_ERR_INVAL,
},
};
- ble_sm_test_util_us_sc_good(¶ms);
+ ble_sm_test_util_us_fail_inval(¶ms);
}
-TEST_SUITE(ble_sm_test_suite)
+TEST_SUITE(ble_sm_gen_test_suite)
{
ble_sm_test_case_f4();
ble_sm_test_case_f5();
@@ -2555,15 +655,10 @@ TEST_SUITE(ble_sm_test_suite)
ble_sm_test_case_peer_fail_inval();
ble_sm_test_case_peer_lgcy_fail_confirm();
- ble_sm_test_case_peer_lgcy_jw_good();
- ble_sm_test_case_peer_lgcy_passkey_good();
ble_sm_test_case_us_fail_inval();
- ble_sm_test_case_us_lgcy_jw_good();
ble_sm_test_case_peer_bonding_bad();
ble_sm_test_case_conn_broken();
ble_sm_test_case_peer_sec_req_inval();
- ble_sm_test_case_peer_sec_req_pair();
- ble_sm_test_case_us_sec_req_pair();
}
#endif
@@ -2573,7 +668,9 @@ ble_sm_test_all(void)
#if !NIMBLE_OPT(SM)
return 0;
#else
- ble_sm_test_suite();
+ ble_sm_gen_test_suite();
+ ble_sm_lgcy_test_suite();
+ ble_sm_sc_test_suite();
return tu_any_failed;
#endif