*
******************************************************************************/
+#include <log/log.h>
#include <string.h>
#include "device/include/interop.h"
#include "include/bt_target.h"
#include "stack/btm/btm_int.h"
#include "stack/include/l2c_api.h"
+#include "stack/smp/p_256_ecc_pp.h"
#include "stack/smp/smp_int.h"
#include "utils/include/bt_utils.h"
STREAM_TO_ARRAY(p_cb->peer_publ_key.x, p, BT_OCTET32_LEN);
STREAM_TO_ARRAY(p_cb->peer_publ_key.y, p, BT_OCTET32_LEN);
+
+ Point pt;
+ memcpy(pt.x, p_cb->peer_publ_key.x, BT_OCTET32_LEN);
+ memcpy(pt.y, p_cb->peer_publ_key.y, BT_OCTET32_LEN);
+
+ if (!ECC_ValidatePoint(&pt)) {
+ android_errorWriteLog(0x534e4554, "72377774");
+ smp_sm_event(p_cb, SMP_AUTH_CMPL_EVT, &reason);
+ return;
+ }
+
p_cb->flags |= SMP_PAIR_FLAG_HAVE_PEER_PUBL_KEY;
smp_wait_for_both_public_keys(p_cb, NULL);
UINT8 reason = SMP_INVALID_PARAMETERS;
SMP_TRACE_DEBUG("%s", __func__);
- p_cb->status = *(UINT8 *)p_data;
if (smp_command_has_invalid_parameters(p_cb))
{
+ if (p_cb->rcvd_cmd_len < 2) { // 1 (opcode) + 1 (Notif Type) bytes
+ android_errorWriteLog(0x534e4554, "111936834");
+ }
smp_sm_event(p_cb, SMP_AUTH_CMPL_EVT, &reason);
return;
}
+ p_cb->status = *(UINT8 *)p_data;
+
if (p != NULL)
{
STREAM_TO_UINT8(p_cb->peer_keypress_notification, p);
{
if (p_cb->total_tx_unacked == 0)
{
- /* update connection parameter to remote preferred */
- L2CA_EnableUpdateBleConnParams(p_cb->pairing_bda, TRUE);
/* process the pairing complete */
smp_proc_pairing_cmpl(p_cb);
}
*******************************************************************************/
void smp_fast_conn_param(tSMP_CB *p_cb, tSMP_INT_DATA *p_data)
{
- /* disable connection parameter update */
- L2CA_EnableUpdateBleConnParams(p_cb->pairing_bda, FALSE);
+ /* Disable L2CAP connection parameter updates while bonding since
+ some peripherals are not able to revert to fast connection parameters
+ during the start of service discovery. Connection paramter updates
+ get enabled again once service discovery completes. */
+ L2CA_EnableUpdateBleConnParams(p_cb->pairing_bda, false);
}
/*******************************************************************************