@@ -1840,15 +1840,19 @@ ble_sm_pair_req_rx(uint16_t conn_handle, struct os_mbuf **om,
1840
1840
if (conn -> bhc_flags & BLE_HS_CONN_F_MASTER ) {
1841
1841
res -> sm_err = BLE_SM_ERR_CMD_NOT_SUPP ;
1842
1842
res -> app_status = BLE_HS_SM_US_ERR (BLE_SM_ERR_CMD_NOT_SUPP );
1843
+ res -> enc_cb = 1 ;
1843
1844
} else if (MYNEWT_VAL (BLE_SM_LVL ) == 1 ) {
1844
1845
res -> sm_err = BLE_SM_ERR_CMD_NOT_SUPP ;
1845
1846
res -> app_status = BLE_HS_SM_US_ERR (BLE_SM_ERR_CMD_NOT_SUPP );
1847
+ res -> enc_cb = 1 ;
1846
1848
} else if (req -> max_enc_key_size < BLE_SM_PAIR_KEY_SZ_MIN ) {
1847
1849
res -> sm_err = BLE_SM_ERR_ENC_KEY_SZ ;
1848
1850
res -> app_status = BLE_HS_SM_US_ERR (BLE_SM_ERR_ENC_KEY_SZ );
1851
+ res -> enc_cb = 1 ;
1849
1852
} else if (req -> max_enc_key_size > BLE_SM_PAIR_KEY_SZ_MAX ) {
1850
1853
res -> sm_err = BLE_SM_ERR_INVAL ;
1851
1854
res -> app_status = BLE_HS_SM_US_ERR (BLE_SM_ERR_INVAL );
1855
+ res -> enc_cb = 1 ;
1852
1856
} else if (MYNEWT_VAL (BLE_SM_SC_ONLY )) {
1853
1857
/* Fail if Secure Connections Only mode is on and remote does not
1854
1858
* meet key size requirements - MITM was checked in last step.
@@ -1857,13 +1861,16 @@ ble_sm_pair_req_rx(uint16_t conn_handle, struct os_mbuf **om,
1857
1861
if (!(req -> authreq & BLE_SM_PAIR_AUTHREQ_SC )) {
1858
1862
res -> sm_err = BLE_SM_ERR_AUTHREQ ;
1859
1863
res -> app_status = BLE_HS_SM_US_ERR (BLE_SM_ERR_AUTHREQ );
1864
+ res -> enc_cb = 1 ;
1860
1865
} else if (req -> max_enc_key_size != BLE_SM_PAIR_KEY_SZ_MAX ) {
1861
1866
res -> sm_err = BLE_SM_ERR_ENC_KEY_SZ ;
1862
1867
res -> app_status = BLE_HS_SM_US_ERR (BLE_SM_ERR_ENC_KEY_SZ );
1868
+ res -> enc_cb = 1 ;
1863
1869
}
1864
1870
} else if (!ble_sm_verify_auth_requirements (req -> authreq )) {
1865
1871
res -> sm_err = BLE_SM_ERR_AUTHREQ ;
1866
1872
res -> app_status = BLE_HS_SM_US_ERR (BLE_SM_ERR_AUTHREQ );
1873
+ res -> enc_cb = 1 ;
1867
1874
} else {
1868
1875
/* The request looks good. Precalculate our pairing response and
1869
1876
* determine some properties of the imminent link. We need this
0 commit comments