File tree Expand file tree Collapse file tree 2 files changed +8
-10
lines changed
tests/bluetooth/tester/src Expand file tree Collapse file tree 2 files changed +8
-10
lines changed Original file line number Diff line number Diff line change @@ -767,6 +767,11 @@ struct l2cap_send_data_cmd {
767767#define L2CAP_TRANSPORT_BREDR 0x00
768768#define L2CAP_TRANSPORT_LE 0x01
769769
770+ #define L2CAP_CONNECTION_RESPONSE_SUCCESS 0x00
771+ #define L2CAP_CONNECTION_RESPONSE_INSUFF_AUTHEN 0x01
772+ #define L2CAP_CONNECTION_RESPONSE_INSUFF_AUTHOR 0x02
773+ #define L2CAP_CONNECTION_RESPONSE_INSUFF_ENC_KEY 0x03
774+
770775#define L2CAP_LISTEN 0x05
771776struct l2cap_listen_cmd {
772777 uint16_t psm ;
Original file line number Diff line number Diff line change @@ -313,14 +313,9 @@ static int accept(struct bt_conn *conn, struct bt_l2cap_chan **l2cap_chan)
313313 }
314314
315315 if (bt_conn_enc_key_size (conn ) < req_keysize ) {
316- /* TSPX_psm_encryption_key_size_required */
317316 req_keysize = 0 ;
318317 return - EPERM ;
319318 } else if (authorize_flag ) {
320- /* TSPX_psm_authorization_required
321- * we never authorize this connection, so return error
322- * everytime this psm is used
323- */
324319 authorize_flag = false;
325320 return - EACCES ;
326321 }
@@ -352,14 +347,12 @@ static void listen(uint8_t *data, uint16_t len)
352347 server -> accept = accept ;
353348 server -> psm = cmd -> psm ;
354349
355- if (server -> psm == 0x00F4 ) {
350+ if (cmd -> response == L2CAP_CONNECTION_RESPONSE_INSUFF_ENC_KEY ) {
356351 /* TSPX_psm_encryption_key_size_required */
357352 req_keysize = 16 ;
358- } else if (server -> psm == 0x00F3 ) {
359- /* TSPX_psm_authentication_required */
353+ } else if (cmd -> response == L2CAP_CONNECTION_RESPONSE_INSUFF_AUTHOR ) {
360354 authorize_flag = true;
361- } else if (server -> psm == 0x00F2 ) {
362- /* TSPX_psm_authentication_required */
355+ } else if (cmd -> response == L2CAP_CONNECTION_RESPONSE_INSUFF_AUTHEN ) {
363356 server -> sec_level = BT_SECURITY_L3 ;
364357 }
365358
You can’t perform that action at this time.
0 commit comments