@@ -1426,32 +1426,6 @@ class GattCharacteristic {
1426
1426
}
1427
1427
1428
1428
public:
1429
- /* *
1430
- * Set up the minimum security (mode and level) requirements for access to
1431
- * the characteristic's value attribute.
1432
- *
1433
- * @param[in] securityMode Can be one of encryption or signing, with or
1434
- * without protection for man in the middle attacks (MITM).
1435
- *
1436
- * @deprecated Fine grained security check has been added to with mbed OS
1437
- * 5.9. It is possible to set independently security requirements for read,
1438
- * write and update operations. In the meantime SecurityManager::SecurityMode_t
1439
- * is not used anymore to represent security requirements as it maps
1440
- * incorrectly the Bluetooth standard.
1441
- */
1442
- MBED_DEPRECATED_SINCE (
1443
- " mbed-os-5.9" ,
1444
- " Use setWriteSecurityRequirements, setReadSecurityRequirements and "
1445
- " setUpdateSecurityRequirements"
1446
- )
1447
- void requireSecurity(SecurityManager::SecurityMode_t securityMode)
1448
- {
1449
- SecurityRequirement_t sec_requirements = SecurityModeToAttSecurity (securityMode);
1450
-
1451
- _valueAttribute.setReadSecurityRequirement (sec_requirements);
1452
- _valueAttribute.setWriteSecurityRequirement (sec_requirements);
1453
- _update_security = sec_requirements.value ();
1454
- }
1455
1429
1456
1430
/* *
1457
1431
* Set all security requirements of the characteristic.
@@ -1729,62 +1703,6 @@ class GattCharacteristic {
1729
1703
return _properties;
1730
1704
}
1731
1705
1732
- /* *
1733
- * Get the characteristic's required security.
1734
- *
1735
- * @return The characteristic's required security.
1736
- *
1737
- * @deprecated Fine grained security check has been added to with mbed OS
1738
- * 5.9. It is possible to set independently security requirements for read,
1739
- * write and update operations. In the meantime SecurityManager::SecurityMode_t
1740
- * is not used anymore to represent security requirements as it maps
1741
- * incorrectly the Bluetooth standard.
1742
- */
1743
- MBED_DEPRECATED_SINCE (
1744
- " mbed-os-5.9" ,
1745
- " Use getWriteSecurityRequirements, getReadSecurityRequirements and "
1746
- " getUpdateSecurityRequirements"
1747
- )
1748
- SecurityManager::SecurityMode_t getRequiredSecurity() const
1749
- {
1750
- SecurityRequirement_t max_sec = std::max (
1751
- std::max (
1752
- getReadSecurityRequirement (),
1753
- getWriteSecurityRequirement ()
1754
- ),
1755
- getUpdateSecurityRequirement ()
1756
- );
1757
-
1758
- bool needs_signing =
1759
- _properties & BLE_GATT_CHAR_PROPERTIES_AUTHENTICATED_SIGNED_WRITES;
1760
-
1761
- switch (max_sec.value ()) {
1762
- case SecurityRequirement_t::NONE:
1763
- MBED_ASSERT (needs_signing == false );
1764
- return SecurityManager::SECURITY_MODE_ENCRYPTION_OPEN_LINK;
1765
- #if BLE_FEATURE_SECURITY
1766
- case SecurityRequirement_t::UNAUTHENTICATED:
1767
- return (needs_signing) ?
1768
- SecurityManager::SECURITY_MODE_SIGNED_NO_MITM :
1769
- SecurityManager::SECURITY_MODE_ENCRYPTION_NO_MITM;
1770
-
1771
- case SecurityRequirement_t::AUTHENTICATED:
1772
- return (needs_signing) ?
1773
- SecurityManager::SECURITY_MODE_SIGNED_WITH_MITM :
1774
- SecurityManager::SECURITY_MODE_ENCRYPTION_WITH_MITM;
1775
- #if BLE_FEATURE_SECURE_CONNECTIONS
1776
- case SecurityRequirement_t::SC_AUTHENTICATED:
1777
- MBED_ASSERT (needs_signing == false );
1778
- // fallback to encryption with MITM
1779
- return SecurityManager::SECURITY_MODE_ENCRYPTION_WITH_MITM;
1780
- #endif // BLE_FEATURE_SECURE_CONNECTIONS
1781
- #endif // BLE_FEATURE_SECURITY
1782
- default :
1783
- MBED_ASSERT (false );
1784
- return SecurityManager::SECURITY_MODE_NO_ACCESS;
1785
- }
1786
- }
1787
-
1788
1706
/* *
1789
1707
* Get the total number of descriptors within this characteristic.
1790
1708
*
@@ -1840,42 +1758,6 @@ class GattCharacteristic {
1840
1758
1841
1759
private:
1842
1760
1843
- /* *
1844
- * Loosely convert a SecurityManager::SecurityMode_t into a
1845
- * SecurityRequirement_t.
1846
- *
1847
- * @param[in] mode The security mode to convert
1848
- *
1849
- * @return The security requirement equivalent to the security mode in input.
1850
- */
1851
- SecurityRequirement_t SecurityModeToAttSecurity (
1852
- SecurityManager::SecurityMode_t mode
1853
- ) {
1854
- switch (mode) {
1855
- case SecurityManager::SECURITY_MODE_ENCRYPTION_OPEN_LINK:
1856
- case SecurityManager::SECURITY_MODE_NO_ACCESS:
1857
- // assuming access is managed by property and orthogonal to
1858
- // security mode ...
1859
- return SecurityRequirement_t::NONE;
1860
- #if BLE_FEATURE_SECURITY
1861
- case SecurityManager::SECURITY_MODE_ENCRYPTION_NO_MITM:
1862
- #if BLE_FEATURE_SIGNING
1863
- case SecurityManager::SECURITY_MODE_SIGNED_NO_MITM:
1864
- #endif
1865
- return SecurityRequirement_t::UNAUTHENTICATED;
1866
-
1867
- case SecurityManager::SECURITY_MODE_ENCRYPTION_WITH_MITM:
1868
- #if BLE_FEATURE_SIGNING
1869
- case SecurityManager::SECURITY_MODE_SIGNED_WITH_MITM:
1870
- #endif
1871
- return SecurityRequirement_t::AUTHENTICATED;
1872
- #endif // BLE_FEATURE_SECURITY
1873
- default :
1874
- // should not happens; makes the compiler happy.
1875
- return SecurityRequirement_t::NONE;
1876
- }
1877
- }
1878
-
1879
1761
/* *
1880
1762
* Attribute that contains the actual value of this characteristic.
1881
1763
*/
0 commit comments