sm.c (c8d0ff33944379e6ee63fd14a81d379da605b5d7) | sm.c (dd583d9fc5bd3a3becbf409534e939dbe18a66eb) |
---|---|
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 --- 3429 unchanged lines hidden (view full) --- 3438 sm_notify_client_status_reason(sm_conn, ERROR_CODE_AUTHENTICATION_FAILURE, 0); 3439 } 3440 } 3441 sm_done_for_handle(sm_conn->sm_handle); 3442 break; 3443 } 3444 3445 if (!sm_conn->sm_connection_encrypted) break; | 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 --- 3429 unchanged lines hidden (view full) --- 3438 sm_notify_client_status_reason(sm_conn, ERROR_CODE_AUTHENTICATION_FAILURE, 0); 3439 } 3440 } 3441 sm_done_for_handle(sm_conn->sm_handle); 3442 break; 3443 } 3444 3445 if (!sm_conn->sm_connection_encrypted) break; |
3446 sm_conn->sm_connection_sc = setup->sm_use_secure_connections; | |
3447 3448 // continue pairing 3449 switch (sm_conn->sm_engine_state){ 3450 case SM_INITIATOR_PH0_W4_CONNECTION_ENCRYPTED: 3451 sm_conn->sm_engine_state = SM_INITIATOR_CONNECTED; 3452 sm_done_for_handle(sm_conn->sm_handle); 3453 break; 3454 case SM_PH2_W4_CONNECTION_ENCRYPTED: | 3446 3447 // continue pairing 3448 switch (sm_conn->sm_engine_state){ 3449 case SM_INITIATOR_PH0_W4_CONNECTION_ENCRYPTED: 3450 sm_conn->sm_engine_state = SM_INITIATOR_CONNECTED; 3451 sm_done_for_handle(sm_conn->sm_handle); 3452 break; 3453 case SM_PH2_W4_CONNECTION_ENCRYPTED: |
3454 sm_conn->sm_connection_sc = setup->sm_use_secure_connections; |
|
3455 if (IS_RESPONDER(sm_conn->sm_role)){ 3456 // slave 3457 if (setup->sm_use_secure_connections){ 3458 sm_conn->sm_engine_state = SM_PH3_DISTRIBUTE_KEYS; 3459 } else { 3460 btstack_crypto_random_generate(&sm_crypto_random_request, sm_random_data, 8, &sm_handle_random_result_ph3_random, (void *)(uintptr_t) sm_conn->sm_handle); 3461 } 3462 } else { --- 1151 unchanged lines hidden --- | 3455 if (IS_RESPONDER(sm_conn->sm_role)){ 3456 // slave 3457 if (setup->sm_use_secure_connections){ 3458 sm_conn->sm_engine_state = SM_PH3_DISTRIBUTE_KEYS; 3459 } else { 3460 btstack_crypto_random_generate(&sm_crypto_random_request, sm_random_data, 8, &sm_handle_random_result_ph3_random, (void *)(uintptr_t) sm_conn->sm_handle); 3461 } 3462 } else { --- 1151 unchanged lines hidden --- |