Kenji Arai / TYBLE16_mbedlized_os5_several_examples_1st

Dependencies:   nRF51_Vdd TextLCD BME280

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers GenericSecurityManager.h Source File

GenericSecurityManager.h

00001 /* mbed Microcontroller Library
00002  * Copyright (c) 2018 ARM Limited
00003  *
00004  * Licensed under the Apache License, Version 2.0 (the "License");
00005  * you may not use this file except in compliance with the License.
00006  * You may obtain a copy of the License at
00007  *
00008  *     http://www.apache.org/licenses/LICENSE-2.0
00009  *
00010  * Unless required by applicable law or agreed to in writing, software
00011  * distributed under the License is distributed on an "AS IS" BASIS,
00012  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
00013  * See the License for the specific language governing permissions and
00014  * limitations under the License.
00015  */
00016 
00017 #ifndef _GENERIC_SECURITY_MANAGER_H_
00018 #define _GENERIC_SECURITY_MANAGER_H_
00019 
00020 #include "ble/pal/GapTypes.h"
00021 #include "ble/BLETypes.h"
00022 #include "ble/generic/SecurityDb.h"
00023 #include "platform/Callback.h"
00024 #include "ble/pal/ConnectionEventMonitor.h"
00025 #include "ble/pal/SigningEventMonitor.h"
00026 #include "ble/generic/GenericGap.h"
00027 #include "ble/pal/PalSecurityManager.h"
00028 #include "ble/ArrayView.h "
00029 
00030 namespace ble {
00031 namespace generic {
00032 
00033 typedef SecurityManager::SecurityIOCapabilities_t SecurityIOCapabilities_t;
00034 
00035 class GenericSecurityManager : public SecurityManager,
00036                                public pal::SecurityManager::EventHandler,
00037                                public pal::ConnectionEventMonitor::EventHandler,
00038                                public pal::SigningEventMonitor::EventHandler {
00039 public:
00040 
00041     /* implements SecurityManager */
00042 
00043     ////////////////////////////////////////////////////////////////////////////
00044     // SM lifecycle management
00045     //
00046 
00047     virtual ble_error_t init(
00048         bool bondable = true,
00049         bool mitm = true,
00050         SecurityIOCapabilities_t iocaps = IO_CAPS_NONE,
00051         const Passkey_t passkey = NULL,
00052         bool signing = true,
00053         const char* db_path = NULL
00054     );
00055 
00056     virtual ble_error_t setDatabaseFilepath(const char *db_path = NULL);
00057 
00058     virtual ble_error_t reset();
00059 
00060     virtual ble_error_t preserveBondingStateOnReset(
00061         bool enabled
00062     );
00063 
00064     ////////////////////////////////////////////////////////////////////////////
00065     // List management
00066     //
00067 
00068     virtual ble_error_t purgeAllBondingState();
00069 
00070     virtual ble_error_t generateWhitelistFromBondTable(
00071         Gap::Whitelist_t *whitelist
00072     ) const;
00073 
00074     ////////////////////////////////////////////////////////////////////////////
00075     // Pairing
00076     //
00077 
00078     virtual ble_error_t requestPairing(
00079         connection_handle_t connection
00080     );
00081 
00082     virtual ble_error_t acceptPairingRequest(
00083         connection_handle_t connection
00084     );
00085 
00086     virtual ble_error_t cancelPairingRequest(
00087         connection_handle_t connection
00088     );
00089 
00090     virtual ble_error_t setPairingRequestAuthorisation(
00091         bool required = true
00092     );
00093 
00094     ////////////////////////////////////////////////////////////////////////////
00095     // Feature support
00096     //
00097 
00098     virtual ble_error_t allowLegacyPairing(
00099         bool allow = true
00100     );
00101 
00102     virtual ble_error_t getSecureConnectionsSupport(
00103         bool *enabled
00104     );
00105 
00106     ////////////////////////////////////////////////////////////////////////////
00107     // Security settings
00108     //
00109 
00110     virtual ble_error_t setIoCapability(
00111         SecurityIOCapabilities_t iocaps
00112     );
00113 
00114     virtual ble_error_t setDisplayPasskey(
00115         const Passkey_t passkey
00116     );
00117 
00118     virtual ble_error_t setAuthenticationTimeout(
00119         connection_handle_t connection,
00120         uint32_t timeout_in_ms
00121     );
00122 
00123     virtual ble_error_t getAuthenticationTimeout(
00124         connection_handle_t connection,
00125         uint32_t *timeout_in_ms
00126     );
00127 
00128     virtual ble_error_t setLinkSecurity(
00129         connection_handle_t connection,
00130         SecurityMode_t securityMode
00131     );
00132 
00133     virtual ble_error_t setKeypressNotification(
00134         bool enabled = true
00135     );
00136 
00137     virtual ble_error_t enableSigning(
00138         connection_handle_t connection,
00139         bool enabled = true
00140     );
00141 
00142     virtual ble_error_t setHintFutureRoleReversal(
00143         bool enable = true
00144     );
00145 
00146     ////////////////////////////////////////////////////////////////////////////
00147     // Encryption
00148     //
00149 
00150     virtual ble_error_t getLinkEncryption(
00151         connection_handle_t connection,
00152         link_encryption_t *encryption
00153     );
00154 
00155     virtual ble_error_t setLinkEncryption(
00156         connection_handle_t connection,
00157         link_encryption_t encryption
00158     );
00159 
00160     virtual ble_error_t getEncryptionKeySize(
00161         connection_handle_t connection,
00162         uint8_t *size
00163     );
00164 
00165     virtual ble_error_t setEncryptionKeyRequirements(
00166         uint8_t minimumByteSize,
00167         uint8_t maximumByteSize
00168     );
00169 
00170     ////////////////////////////////////////////////////////////////////////////
00171     // Privacy
00172     //
00173 
00174     virtual ble_error_t setPrivateAddressTimeout(
00175         uint16_t timeout_in_seconds
00176     );
00177 
00178     ////////////////////////////////////////////////////////////////////////////
00179     // Keys
00180     //
00181 
00182     virtual ble_error_t getSigningKey(
00183         connection_handle_t connection,
00184         bool authenticated
00185     );
00186 
00187     ////////////////////////////////////////////////////////////////////////////
00188     // Authentication
00189     //
00190 
00191     virtual ble_error_t requestAuthentication(
00192         connection_handle_t connection
00193     );
00194 
00195     ////////////////////////////////////////////////////////////////////////////
00196     // MITM
00197     //
00198 
00199     virtual ble_error_t generateOOB(
00200         const address_t *address
00201     );
00202 
00203     virtual ble_error_t setOOBDataUsage(
00204         connection_handle_t connection,
00205         bool useOOB,
00206         bool OOBProvidesMITM = true
00207     );
00208 
00209     virtual ble_error_t confirmationEntered(
00210         connection_handle_t connection,
00211         bool confirmation
00212     );
00213 
00214     virtual ble_error_t passkeyEntered(
00215         connection_handle_t connection,
00216         Passkey_t passkey
00217     );
00218 
00219     virtual ble_error_t sendKeypressNotification(
00220         connection_handle_t connection,
00221         Keypress_t keypress
00222     );
00223 
00224     virtual ble_error_t legacyPairingOobReceived(
00225         const address_t *address,
00226         const oob_tk_t *tk
00227     );
00228 
00229     virtual ble_error_t oobReceived(
00230         const address_t *address,
00231         const oob_lesc_value_t *random,
00232         const oob_confirm_t *confirm
00233     );
00234 
00235     /* ends implements SecurityManager */
00236 
00237 public:
00238     GenericSecurityManager(
00239         pal::SecurityManager &palImpl,
00240         pal::ConnectionEventMonitor &connMonitorImpl,
00241         pal::SigningEventMonitor &signingMonitorImpl
00242     ) : _pal(palImpl),
00243         _connection_monitor(connMonitorImpl),
00244         _signing_monitor(signingMonitorImpl),
00245         _db(NULL),
00246         _default_authentication(0),
00247         _default_key_distribution(pal::KeyDistribution::KEY_DISTRIBUTION_ALL),
00248         _pairing_authorisation_required(false),
00249         _legacy_pairing_allowed(true),
00250         _master_sends_keys(false) {
00251         _pal.set_event_handler(this);
00252 
00253         /* We create a fake value for oob to allow creation of the next oob which needs
00254          * the last process to finish first before restarting (this is to simplify checking).
00255          * This fake value will not be used as the oob address is currently invalid */
00256         _oob_local_random[0] = 1;
00257     }
00258 
00259     ~GenericSecurityManager() {
00260         delete _db;
00261     }
00262 
00263     ////////////////////////////////////////////////////////////////////////////
00264     // Helper functions
00265     //
00266 
00267 private:
00268 
00269     /**
00270      * Initialise the database, if database already exists it will close it and open the new one.
00271      *
00272      * @param db_path path to file to store secure db
00273      * @return BLE_ERROR_NONE or appropriate error code indicating the failure reason.
00274      */
00275     ble_error_t init_database(const char *db_path = NULL);
00276 
00277     /**
00278      * Generate identity list based on the database of IRK and apply it to the resolving list.
00279      *
00280      * @return BLE_ERROR_NONE or appropriate error code indicating the failure reason.
00281      */
00282     ble_error_t init_resolving_list();
00283 
00284     /**
00285      * Generate the CSRK if needed.
00286      *
00287      * @return BLE_ERROR_NONE or appropriate error code indicating the failure reason.
00288      */
00289     ble_error_t init_signing();
00290 
00291     /**
00292      * Fills the buffer with the specified number of bytes of random data
00293      * produced by the link controller
00294      *
00295      * @param[out] buffer buffer to be filled with random data
00296      * @param[in] size number of bytes to fill with random data
00297      * @return BLE_ERROR_NONE or appropriate error code indicating the failure reason.
00298      */
00299     ble_error_t get_random_data(
00300         uint8_t *buffer,
00301         size_t size
00302     );
00303 
00304     /**
00305      * Send slave security request based on current link settings.
00306      *
00307      * @param[in] connectionHandle Handle to identify the connection.
00308      * @return BLE_ERROR_NONE or appropriate error code indicating the failure reason.
00309      */
00310     ble_error_t slave_security_request(
00311         connection_handle_t connection
00312     );
00313 
00314     /**
00315      * Enable encryption on the link, depending on whether device is master or slave.
00316      *
00317      * @param[in] connectionHandle Handle to identify the connection.
00318      * @return BLE_ERROR_NONE or appropriate error code indicating the failure reason.
00319      */
00320     ble_error_t enable_encryption(
00321         connection_handle_t connection
00322     );
00323 
00324     /**
00325      * Returns the requested LTK to the PAL. Called by the security db.
00326      *
00327      * @param[in] entry security entry returned by the database.
00328      * @param[in] entryKeys security entry containing keys.
00329      */
00330     void enable_encryption_cb(
00331         SecurityDb::entry_handle_t entry,
00332         const SecurityEntryKeys_t* entryKeys
00333     );
00334 
00335     /**
00336      * Returns the requested LTK to the PAL. Called by the security db.
00337      *
00338      * @param[in] entry security entry returned by the database.
00339      * @param[in] entryKeys security entry containing keys.
00340      */
00341     void set_ltk_cb(
00342         SecurityDb::entry_handle_t entry,
00343         const SecurityEntryKeys_t* entryKeys
00344     );
00345 
00346     /**
00347      * Returns the CSRK for the connection. Called by the security db.
00348      *
00349      * @param[in] connectionHandle Handle to identify the connection.
00350      * @param[in] signing connection signature resolving key and counter.
00351      */
00352     void return_csrk_cb(
00353         SecurityDb::entry_handle_t connection,
00354         const SecurityEntrySigning_t *signing
00355     );
00356 
00357     /**
00358      * Set the peer CSRK for the connection. Called by the security db.
00359      *
00360      * @param[in] connectionHandle Handle to identify the connection.
00361      * @param[in] signing connection signature resolving key and counter.
00362      */
00363     void set_peer_csrk_cb(
00364         SecurityDb::entry_handle_t connection,
00365         const SecurityEntrySigning_t *signing
00366     );
00367 
00368     /**
00369      * Updates the entry for the connection with OOB data presence.
00370      *
00371      * @param[in] connectionHandle Handle to identify the connection.
00372      */
00373     void update_oob_presence(
00374         connection_handle_t connection
00375     );
00376 
00377     /**
00378      * Set the MITM protection setting on the database entry
00379      *
00380      * @param[in] connectionHandle Handle to identify the connection.
00381      * @param[in] enable if true set the MITM protection to on.
00382      */
00383     virtual void set_mitm_performed(
00384         connection_handle_t connection,
00385         bool enable = true
00386     );
00387 
00388     /**
00389      * Inform the Security manager of a new connection. This will create
00390      * or retrieve an existing security manager entry for the connected device.
00391      * Called by GAP.
00392      *
00393      * @param[in] connectionHandle Handle to identify the connection.
00394      * @param[in] is_master True if device is the master.
00395      * @param[in] peer_address_type type of address.
00396      * @param[in] peer_address Address of the connected device.
00397      * @return BLE_ERROR_NONE or appropriate error code indicating the failure reason.
00398      */
00399     virtual void on_connected(
00400         connection_handle_t connection,
00401         Gap::Role_t role,
00402         peer_address_type_t peer_address_type,
00403         const BLEProtocol::AddressBytes_t peer_address,
00404         BLEProtocol::AddressType_t local_address_type,
00405         const BLEProtocol::AddressBytes_t local_address,
00406         const Gap::ConnectionParams_t *connection_params
00407     );
00408 
00409     /**
00410      * Inform the security manager that a device has been disconnected and its
00411      * entry can be put in NVM storage. Called by GAP.
00412      *
00413      * @param[in] connectionHandle Handle to identify the connection.
00414      * @return BLE_ERROR_NONE or appropriate error code indicating the failure reason.
00415      */
00416     virtual void on_disconnected(
00417         connection_handle_t connection,
00418         Gap::DisconnectionReason_t reason
00419     );
00420 
00421     /**
00422      * Callback invoked by the secure DB when an identity entry has been
00423      * retrieved.
00424      * @param entry Handle of the entry.
00425      * @param identity The identity associated with the entry; may be NULL.
00426      */
00427     void on_security_entry_retrieved(
00428         SecurityDb::entry_handle_t entry,
00429         const SecurityEntryIdentity_t* identity
00430     );
00431 
00432     /**
00433      * Callback invoked by the secure DB when the identity list has been
00434      * retrieved.
00435      *
00436      * @param identity View to the array passed to the secure DB. It contains
00437      * identity entries retrieved.
00438      *
00439      * @param count Number of identities entries retrieved.
00440      */
00441     void on_identity_list_retrieved(
00442         ble::ArrayView<SecurityEntryIdentity_t>& identity_list,
00443         size_t count
00444     );
00445 
00446 private:
00447     struct ControlBlock_t {
00448         ControlBlock_t();
00449 
00450         pal::KeyDistribution get_initiator_key_distribution() {
00451             return pal::KeyDistribution(initiator_key_distribution);
00452         };
00453         pal::KeyDistribution get_responder_key_distribution() {
00454             return pal::KeyDistribution(responder_key_distribution);
00455         };
00456         void set_initiator_key_distribution(pal::KeyDistribution mask) {
00457             initiator_key_distribution = mask.value();
00458         };
00459         void set_responder_key_distribution(pal::KeyDistribution mask) {
00460             responder_key_distribution = mask.value();
00461         };
00462 
00463         connection_handle_t connection;
00464         SecurityDb::entry_handle_t db_entry;
00465 
00466         address_t local_address; /**< address used for connection, possibly different from identity */
00467 
00468     private:
00469         uint8_t initiator_key_distribution:4;
00470         uint8_t responder_key_distribution:4;
00471     public:
00472         uint8_t connected:1;
00473         uint8_t authenticated:1; /**< have we turned encryption on during this connection */
00474         uint8_t is_master:1;
00475 
00476         uint8_t encryption_requested:1;
00477         uint8_t encryption_failed:1;
00478         uint8_t encrypted:1;
00479         uint8_t signing_requested:1;
00480         uint8_t signing_override_default:1;
00481 
00482         uint8_t mitm_requested:1;
00483         uint8_t mitm_performed:1; /**< keys exchange will have MITM protection */
00484 
00485         uint8_t attempt_oob:1;
00486         uint8_t oob_mitm_protection:1;
00487         uint8_t oob_present:1;
00488         uint8_t legacy_pairing_oob_request_pending:1;
00489 
00490         uint8_t csrk_failures:2;
00491     };
00492 
00493     pal::SecurityManager &_pal;
00494     pal::ConnectionEventMonitor &_connection_monitor;
00495     pal::SigningEventMonitor &_signing_monitor;
00496 
00497     SecurityDb *_db;
00498 
00499     /* OOB data */
00500     address_t _oob_local_address;
00501     address_t _oob_peer_address;
00502     oob_lesc_value_t _oob_peer_random;
00503     oob_confirm_t _oob_peer_confirm;
00504     oob_lesc_value_t _oob_local_random;
00505     address_t _oob_temporary_key_creator_address; /**< device which generated and sent the TK */
00506     oob_tk_t _oob_temporary_key; /**< used for legacy pairing */
00507 
00508     pal::AuthenticationMask _default_authentication;
00509     pal::KeyDistribution _default_key_distribution;
00510 
00511     bool _pairing_authorisation_required;
00512     bool _legacy_pairing_allowed;
00513     bool _master_sends_keys;
00514 
00515     static const size_t MAX_CONTROL_BLOCKS = 5;
00516     ControlBlock_t _control_blocks[MAX_CONTROL_BLOCKS];
00517 
00518     /* implements ble::pal::SecurityManager::EventHandler */
00519 public:
00520     ////////////////////////////////////////////////////////////////////////////
00521     // Pairing
00522     //
00523 
00524     /** @copydoc ble::pal::SecurityManager::on_pairing_request
00525      */
00526     virtual void on_pairing_request(
00527         connection_handle_t connection,
00528         bool use_oob,
00529         pal::AuthenticationMask authentication,
00530         pal::KeyDistribution initiator_dist,
00531         pal::KeyDistribution responder_dist
00532     );
00533 
00534     /** @copydoc ble::pal::SecurityManager::on_pairing_error
00535      */
00536     virtual void on_pairing_error(
00537         connection_handle_t connection,
00538         pairing_failure_t error
00539     );
00540 
00541     /** @copydoc ble::pal::SecurityManager::on_pairing_timed_out
00542      */
00543     virtual void on_pairing_timed_out(
00544         connection_handle_t connection
00545     );
00546 
00547     /** @copydoc ble::pal::SecurityManager::on_pairing_completed
00548      */
00549     virtual void on_pairing_completed(
00550         connection_handle_t connection
00551     );
00552 
00553     ////////////////////////////////////////////////////////////////////////////
00554     // Security
00555     //
00556 
00557     /** @copydoc ble::pal::SecurityManager::on_valid_mic_timeout
00558      */
00559     virtual void on_valid_mic_timeout(
00560         connection_handle_t connection
00561     );
00562 
00563     /** @copydoc ble::pal::SecurityManager::on_signed_write_received
00564      */
00565     virtual void on_signed_write_received(
00566         connection_handle_t connection,
00567         uint32_t sign_coutner
00568     );
00569 
00570     /** @copydoc ble::pal::SecurityManager::on_signed_write_verification_failure
00571      */
00572     virtual void on_signed_write_verification_failure(
00573         connection_handle_t connection
00574     );
00575 
00576     /** @copydoc ble::pal::SecurityManager::on_signed_write
00577      */
00578     virtual void on_signed_write();
00579 
00580     /** @copydoc ble::pal::SecurityManager::on_slave_security_request
00581      */
00582     virtual void on_slave_security_request(
00583         connection_handle_t connection,
00584         pal::AuthenticationMask authentication
00585     );
00586 
00587     ////////////////////////////////////////////////////////////////////////////
00588     // Encryption
00589     //
00590 
00591     /** @copydoc ble::pal::SecurityManager::on_link_encryption_result
00592      */
00593     virtual void on_link_encryption_result(
00594         connection_handle_t connection,
00595         link_encryption_t result
00596     );
00597 
00598     /** @copydoc ble::pal::SecurityManager::on_link_encryption_request_timed_out
00599      */
00600     virtual void on_link_encryption_request_timed_out(
00601         connection_handle_t connection
00602     );
00603 
00604     ////////////////////////////////////////////////////////////////////////////
00605     // MITM
00606     //
00607 
00608     /** @copydoc ble::pal::SecurityManager::on_passkey_display
00609      */
00610     virtual void on_passkey_display(
00611         connection_handle_t connection,
00612         passkey_num_t passkey
00613     );
00614 
00615     /** @copydoc ble::pal::SecurityManager::on_keypress_notification
00616      */
00617     virtual void on_keypress_notification(
00618         connection_handle_t connection,
00619         SecurityManager::Keypress_t keypress
00620     );
00621 
00622     /** @copydoc ble::pal::SecurityManager::on_passkey_request
00623      */
00624     virtual void on_passkey_request(
00625         connection_handle_t connection
00626     );
00627 
00628     /** @copydoc ble::pal::SecurityManager::on_confirmation_request
00629      */
00630     virtual void on_confirmation_request(
00631         connection_handle_t connection
00632     );
00633 
00634     /** @copydoc ble::pal::SecurityManager::on_secure_connections_oob_request
00635      */
00636     virtual void on_secure_connections_oob_request(
00637         connection_handle_t connection
00638     );
00639 
00640     /** @copydoc ble::pal::SecurityManager::on_legacy_pairing_oob_request
00641      */
00642     virtual void on_legacy_pairing_oob_request(
00643         connection_handle_t connection
00644     );
00645 
00646     /** @copydoc ble::pal::SecurityManager::on_secure_connections_oob_generated
00647      */
00648     virtual void on_secure_connections_oob_generated(
00649         const oob_lesc_value_t &random,
00650         const oob_confirm_t &confirm
00651     );
00652 
00653     ////////////////////////////////////////////////////////////////////////////
00654     // Keys
00655     //
00656 
00657     /** @copydoc ble::pal::SecurityManager::on_secure_connections_ltk_generated
00658      */
00659     virtual void on_secure_connections_ltk_generated(
00660         connection_handle_t connection,
00661         const ltk_t &ltk
00662     );
00663 
00664     /** @copydoc ble::pal::SecurityManager::on_keys_distributed_ltk
00665      */
00666     virtual void on_keys_distributed_ltk(
00667         connection_handle_t connection,
00668         const ltk_t &ltk
00669     );
00670 
00671     /** @copydoc ble::pal::SecurityManager::on_keys_distributed_ediv_rand
00672      */
00673     virtual void on_keys_distributed_ediv_rand(
00674         connection_handle_t connection,
00675         const ediv_t &ediv,
00676         const rand_t &rand
00677     );
00678 
00679     /** @copydoc ble::pal::SecurityManager::on_keys_distributed_local_ltk
00680      */
00681     virtual void on_keys_distributed_local_ltk(
00682         connection_handle_t connection,
00683         const ltk_t &ltk
00684     );
00685 
00686     /** @copydoc ble::pal::SecurityManager::on_keys_distributed_local_ediv_rand
00687      */
00688     virtual void on_keys_distributed_local_ediv_rand(
00689         connection_handle_t connection,
00690         const ediv_t &ediv,
00691         const rand_t &rand
00692     );
00693 
00694     /** @copydoc ble::pal::SecurityManager::on_keys_distributed_irk
00695      */
00696     virtual void on_keys_distributed_irk(
00697         connection_handle_t connection,
00698         const irk_t &irk
00699     );
00700 
00701     /** @copydoc ble::pal::SecurityManager::on_keys_distributed_bdaddr
00702      */
00703     virtual void on_keys_distributed_bdaddr(
00704         connection_handle_t connection,
00705         pal::advertising_peer_address_type_t peer_address_type,
00706         const address_t &peer_identity_address
00707     );
00708 
00709     /** @copydoc ble::pal::SecurityManager::on_keys_distributed_csrk
00710      */
00711     virtual void on_keys_distributed_csrk(
00712         connection_handle_t connection,
00713         const csrk_t &csrk
00714     );
00715 
00716     /** @copydoc ble::pal::SecurityManager::on_ltk_requeston_ltk_request
00717      */
00718     virtual void on_ltk_request(
00719         connection_handle_t connection,
00720         const ediv_t &ediv,
00721         const rand_t &rand
00722     );
00723 
00724     /** @copydoc ble::pal::SecurityManager::on_ltk_requeston_ltk_request
00725      */
00726     virtual void on_ltk_request(
00727         connection_handle_t connection
00728     );
00729 
00730     /* end implements ble::pal::SecurityManager::EventHandler */
00731 
00732     /* list management */
00733 
00734     ControlBlock_t* acquire_control_block(connection_handle_t connection);
00735 
00736     ControlBlock_t* get_control_block(connection_handle_t connection);
00737 
00738     ControlBlock_t* get_control_block(const address_t &peer_address);
00739 
00740     ControlBlock_t* get_control_block(SecurityDb::entry_handle_t db_entry);
00741 
00742     void release_control_block(ControlBlock_t* entry);
00743 };
00744 
00745 
00746 } /* namespace generic */
00747 } /* namespace ble */
00748 
00749 
00750 #endif /*_GENERIC_SECURITY_MANAGER_H_*/