BA / Mbed OS BaBoRo1
Embed: (wiki syntax)

« Back to documentation index

SecurityManager::EventHandler Class Reference

SecurityManager::EventHandler Class Reference

Handle events generated by ble::pal::SecurityManager. More...

#include <PalSecurityManager.h>

Inherited by GenericSecurityManager.

Public Member Functions

virtual void on_pairing_request (connection_handle_t connection, bool oob_data_flag, AuthenticationMask authentication_requirements, KeyDistribution initiator_dist, KeyDistribution responder_dist)=0
 Request pairing.
virtual void on_pairing_error (connection_handle_t connection, pairing_failure_t error)=0
 Indicate that the pairing has failed.
virtual void on_pairing_timed_out (connection_handle_t connection)=0
 Indicate that the pairing has timed out.
virtual void on_pairing_completed (connection_handle_t connection)=0
 Indicate that the pairing for the link has completed.
virtual void on_valid_mic_timeout (connection_handle_t connection)=0
 Indicate that the authentication timeout time has elapsed and we received no packets with a valid MIC in that time.
virtual void on_slave_security_request (connection_handle_t connection, AuthenticationMask authentication)=0
 Ask the stack to evaluate the security request received from the slave.
virtual void on_link_encryption_result (connection_handle_t connection, link_encryption_t result)=0
 Inform the application of the result of an encryption request.
virtual void on_link_encryption_request_timed_out (connection_handle_t connection)=0
 Indicate that the encryption request failed due to timeout.
virtual void on_passkey_display (connection_handle_t connection, passkey_num_t passkey)=0
 Inform the application that should display a passkey.
virtual void on_confirmation_request (connection_handle_t connection)=0
 Indicate that user confirmation is required to confirm matching passkeys displayed on devices.
virtual void on_passkey_request (connection_handle_t connection)=0
 Request the passkey entered during pairing.
virtual void on_keypress_notification (connection_handle_t connection, Keypress_t keypress)=0
 Indicate that a key has been pressed by the peer.
virtual void on_legacy_pairing_oob_request (connection_handle_t connection)=0
 Request OOB data from the user application.
virtual void on_oob_data_verification_request (connection_handle_t connection, const public_key_coord_t &peer_public_key_x, const public_key_coord_t &peer_public_key_y)=0
 Request OOB data to be verified against received public keys.
virtual void on_public_key_generated (const public_key_coord_t &public_key_x, const public_key_coord_t &public_key_y)=0
 Provide the local public key.
virtual void on_secure_connections_ltk_generated (connection_handle_t connection, const ltk_t &ltk)=0
 Store the results of key generation of the stage 2 of secure connections pairing.
virtual void on_keys_distributed_ltk (connection_handle_t connection, const ltk_t &ltk)=0
 Store the results of key distribution after LTK has been received.
virtual void on_keys_distributed_ediv_rand (connection_handle_t connection, const ediv_t &ediv, const rand_t &rand)=0
 Store the results of key distribution after EDIV and RAND has been received.
virtual void on_keys_distributed_local_ltk (connection_handle_t connection, const ltk_t &ltk)=0
 Store the local key, if we are slave now or in the future this will be used to encrypt.
virtual void on_keys_distributed_local_ediv_rand (connection_handle_t connection, const ediv_t &ediv, const rand_t &rand)=0
 Store the EDIV and RAND that will be used to identify the stored local LTK.
virtual void on_keys_distributed_irk (connection_handle_t connection, const irk_t &irk)=0
 Store the results of key distribution after IRK has been received.
virtual void on_keys_distributed_bdaddr (connection_handle_t connection, advertising_peer_address_type_t peer_identity_address_type, const address_t &peer_identity_address)=0
 Store the identity address of the peer after it has been distributed.
virtual void on_keys_distributed_csrk (connection_handle_t connection, const csrk_t &csrk)=0
 Store the peer's CSRK after it has been distributed.
virtual void on_ltk_request (connection_handle_t connection, const ediv_t &ediv, const rand_t &rand)=0
 Request the LTK since the peer is asking us to encrypt the link.
virtual void on_ltk_request (connection_handle_t connection)=0
 Request the LTK since the peer is asking us to encrypt the link.

Detailed Description

Handle events generated by ble::pal::SecurityManager.

Definition at line 212 of file PalSecurityManager.h.


Member Function Documentation

virtual void on_confirmation_request ( connection_handle_t  connection ) [pure virtual]

Indicate that user confirmation is required to confirm matching passkeys displayed on devices.

Parameters:
[in]connectionconnection handle
See also:
BLUETOOTH SPECIFICATION Version 5.0 | Vol 2, Part E, 7.7.42
virtual void on_keypress_notification ( connection_handle_t  connection,
Keypress_t  keypress 
) [pure virtual]

Indicate that a key has been pressed by the peer.

Parameters:
[in]connectionconnection handle
[in]keypresstype of keypress event
See also:
BLUETOOTH SPECIFICATION Version 5.0 | Vol 3, Part H, 3.5.8
virtual void on_keys_distributed_bdaddr ( connection_handle_t  connection,
advertising_peer_address_type_t  peer_identity_address_type,
const address_t peer_identity_address 
) [pure virtual]

Store the identity address of the peer after it has been distributed.

Parameters:
[in]connectionconnection handle
[in]peer_identity_address_typepublic or private address indication
[in]peer_identity_addresspeer address
virtual void on_keys_distributed_csrk ( connection_handle_t  connection,
const csrk_t &  csrk 
) [pure virtual]

Store the peer's CSRK after it has been distributed.

Parameters:
[in]connectionconnection handle
[in]csrksigning key
virtual void on_keys_distributed_ediv_rand ( connection_handle_t  connection,
const ediv_t ediv,
const rand_t &  rand 
) [pure virtual]

Store the results of key distribution after EDIV and RAND has been received.

Parameters:
[in]connectionconnection handle
[in]ltklong term key from the peer
virtual void on_keys_distributed_irk ( connection_handle_t  connection,
const irk_t irk 
) [pure virtual]

Store the results of key distribution after IRK has been received.

Parameters:
[in]connectionconnection handle
[in]irkidentity resolution key
virtual void on_keys_distributed_local_ediv_rand ( connection_handle_t  connection,
const ediv_t ediv,
const rand_t &  rand 
) [pure virtual]

Store the EDIV and RAND that will be used to identify the stored local LTK.

if we are slave that LTK will be used to encrypt, otherwise this will be stored to be used in case of role reversal.

Parameters:
[in]connectionconnection handle
[in]edividentifies LTK
[in]randidentifies LTK
virtual void on_keys_distributed_local_ltk ( connection_handle_t  connection,
const ltk_t &  ltk 
) [pure virtual]

Store the local key, if we are slave now or in the future this will be used to encrypt.

Parameters:
[in]connectionconnection handle
[in]ltkkey sent to the peer
virtual void on_keys_distributed_ltk ( connection_handle_t  connection,
const ltk_t &  ltk 
) [pure virtual]

Store the results of key distribution after LTK has been received.

Parameters:
[in]connectionconnection handle
[in]ltklong term key from the peer
virtual void on_legacy_pairing_oob_request ( connection_handle_t  connection ) [pure virtual]

Request OOB data from the user application.

Parameters:
[in]connectionconnection handle
Note:
shall be followed by: pal::SecurityManager::legacy_pairing_oob_data_request_reply or a cancellation of the procedure.
virtual void on_link_encryption_request_timed_out ( connection_handle_t  connection ) [pure virtual]

Indicate that the encryption request failed due to timeout.

Parameters:
[in]connectionconnection handle
virtual void on_link_encryption_result ( connection_handle_t  connection,
link_encryption_t  result 
) [pure virtual]

Inform the application of the result of an encryption request.

Note:
Do no call if request timed out, call on_link_encryption_request_timed_out instead.
Parameters:
[in]connectionconnection handle
[in]resultencryption state of the link
virtual void on_ltk_request ( connection_handle_t  connection ) [pure virtual]

Request the LTK since the peer is asking us to encrypt the link.

Note:
No EDIV or RAND is provided as this requests a secure connections LTK where their values are all zeroes
Parameters:
[in]connectionconnection handle
virtual void on_ltk_request ( connection_handle_t  connection,
const ediv_t ediv,
const rand_t &  rand 
) [pure virtual]

Request the LTK since the peer is asking us to encrypt the link.

We need to provide the LTK based on the EDIV and RAND provided by the other side. This is called on the slave.

Parameters:
[in]connectionconnection handle
[in]edividentifies LTK
[in]randidentifies LTK
virtual void on_oob_data_verification_request ( connection_handle_t  connection,
const public_key_coord_t peer_public_key_x,
const public_key_coord_t peer_public_key_y 
) [pure virtual]

Request OOB data to be verified against received public keys.

Parameters:
[in]public_key_xnewly generated public key (x coordinate)
[in]public_key_ynewly generated public key (y coordinate)
virtual void on_pairing_completed ( connection_handle_t  connection ) [pure virtual]

Indicate that the pairing for the link has completed.

Parameters:
[in]connectionconnection handle
virtual void on_pairing_error ( connection_handle_t  connection,
pairing_failure_t  error 
) [pure virtual]

Indicate that the pairing has failed.

Note:
Any subsequent pairing procedure shall restart from the Pairing Feature Exchange phase.
Parameters:
[in]connectionconnection handle
[in]errorreason for the failed pairing
virtual void on_pairing_request ( connection_handle_t  connection,
bool  oob_data_flag,
AuthenticationMask  authentication_requirements,
KeyDistribution  initiator_dist,
KeyDistribution  responder_dist 
) [pure virtual]

Request pairing.

This is called on the slave in response to a request from the master. Upper layer shall either send a pairing response (send_pairing_response) or cancel the pairing procedure (cancel_pairing).

Parameters:
[in]connectionconnection handle
[in]oob_data_flagis out of band data present
[in]authentication_requirementsauthentication requirements
[in]initiator_distkey distribution
[in]responder_distkey distribution
virtual void on_pairing_timed_out ( connection_handle_t  connection ) [pure virtual]

Indicate that the pairing has timed out.

Parameters:
[in]connectionconnection handle
virtual void on_passkey_display ( connection_handle_t  connection,
passkey_num_t  passkey 
) [pure virtual]

Inform the application that should display a passkey.

Parameters:
[in]connectionconnection handle
[in]passkeypasskey to be displayed
virtual void on_passkey_request ( connection_handle_t  connection ) [pure virtual]

Request the passkey entered during pairing.

Note:
shall be followed by: pal::SecurityManager::passkey_request_reply
Parameters:
[in]connectionconnection handle or a cancellation of the procedure.
virtual void on_public_key_generated ( const public_key_coord_t public_key_x,
const public_key_coord_t public_key_y 
) [pure virtual]

Provide the local public key.

Parameters:
[in]public_key_xnewly generated public key (x coordinate)
[in]public_key_ynewly generated public key (y coordinate)
virtual void on_secure_connections_ltk_generated ( connection_handle_t  connection,
const ltk_t &  ltk 
) [pure virtual]

Store the results of key generation of the stage 2 of secure connections pairing.

See also:
BLUETOOTH SPECIFICATION Version 5.0 | Vol 3, Part H - 2.3.5.6.5
Parameters:
[in]connectionconnection handle
[in]ltklong term key from the peer
virtual void on_slave_security_request ( connection_handle_t  connection,
AuthenticationMask  authentication 
) [pure virtual]

Ask the stack to evaluate the security request received from the slave.

This might result in the stack enabling encryption, or pairing/re-pairing.

Parameters:
[in]connectionconnection handle
[in]authenticationauthentication requirements from the slave
virtual void on_valid_mic_timeout ( connection_handle_t  connection ) [pure virtual]

Indicate that the authentication timeout time has elapsed and we received no packets with a valid MIC in that time.

Parameters:
[in]connectionconnection handle
See also:
BLUETOOTH SPECIFICATION Version 5.0 | Vol 6, Part B, 5.4