sm.c (55c62cf557faf593aa4b49df1a18bd7527739f3c) sm.c (55160b1c55a02046ff8051db6cd2e30b3d7958a5)
1/*
2 * Copyright (C) 2014 BlueKitchen GmbH
3 *
4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions
6 * are met:
7 *
8 * 1. Redistributions of source code must retain the above copyright

--- 1521 unchanged lines hidden (view full) ---

1530 (void)memcpy(setup->sm_t, hash, 16);
1531 sm_conn->sm_engine_state = SM_SC_W2_CALCULATE_H6_BR_EDR_LINK_KEY;
1532 break;
1533 case SM_SC_W4_CALCULATE_H6_BR_EDR_LINK_KEY:
1534 reverse_128(hash, setup->sm_t);
1535 link_key_type = sm_conn->sm_connection_authenticated ?
1536 AUTHENTICATED_COMBINATION_KEY_GENERATED_FROM_P256 : UNAUTHENTICATED_COMBINATION_KEY_GENERATED_FROM_P256;
1537 log_info("Derived classic link key from LE using h6, type %u", (int) link_key_type);
1/*
2 * Copyright (C) 2014 BlueKitchen GmbH
3 *
4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions
6 * are met:
7 *
8 * 1. Redistributions of source code must retain the above copyright

--- 1521 unchanged lines hidden (view full) ---

1530 (void)memcpy(setup->sm_t, hash, 16);
1531 sm_conn->sm_engine_state = SM_SC_W2_CALCULATE_H6_BR_EDR_LINK_KEY;
1532 break;
1533 case SM_SC_W4_CALCULATE_H6_BR_EDR_LINK_KEY:
1534 reverse_128(hash, setup->sm_t);
1535 link_key_type = sm_conn->sm_connection_authenticated ?
1536 AUTHENTICATED_COMBINATION_KEY_GENERATED_FROM_P256 : UNAUTHENTICATED_COMBINATION_KEY_GENERATED_FROM_P256;
1537 log_info("Derived classic link key from LE using h6, type %u", (int) link_key_type);
1538 if (IS_RESPONDER(sm_conn->sm_role)){
1539 gap_store_link_key_for_bd_addr(setup->sm_m_address, setup->sm_t, link_key_type);
1540 } else {
1541 gap_store_link_key_for_bd_addr(setup->sm_s_address, setup->sm_t, link_key_type);
1542 }
1538 gap_store_link_key_for_bd_addr(setup->sm_peer_address, setup->sm_t, link_key_type);
1543#endif
1544 if (IS_RESPONDER(sm_conn->sm_role)){
1545 sm_conn->sm_engine_state = SM_RESPONDER_IDLE;
1546 } else {
1547 sm_conn->sm_engine_state = SM_INITIATOR_CONNECTED;
1548 }
1549 sm_notify_client_status_reason(sm_conn, ERROR_CODE_SUCCESS, 0);
1550 sm_done_for_handle(sm_conn->sm_handle);

--- 2978 unchanged lines hidden ---
1539#endif
1540 if (IS_RESPONDER(sm_conn->sm_role)){
1541 sm_conn->sm_engine_state = SM_RESPONDER_IDLE;
1542 } else {
1543 sm_conn->sm_engine_state = SM_INITIATOR_CONNECTED;
1544 }
1545 sm_notify_client_status_reason(sm_conn, ERROR_CODE_SUCCESS, 0);
1546 sm_done_for_handle(sm_conn->sm_handle);

--- 2978 unchanged lines hidden ---