Bluetooth: Use correct CONFIG option for TinyCrypt ECC define

The option is named CONFIG_TINYCRYPT_ECC_DH.

Change-Id: Ice30857d368582f5bc5d2f47e8ce6b1a89e29128
Signed-off-by: Szymon Janc <ext.szymon.janc@tieto.com>
This commit is contained in:
Szymon Janc 2016-02-10 13:57:19 +01:00 committed by Anas Nashif
commit 708126cd30

View file

@ -1057,8 +1057,7 @@ done:
bt_conn_unref(conn);
}
/* TODO check tinycrypt define when ECC is added */
#if !defined(CONFIG_TINYCRYPT_ECC)
#if !defined(CONFIG_TINYCRYPT_ECC_DH)
static void le_pkey_complete(struct net_buf *buf)
{
struct bt_hci_evt_le_p256_public_key_complete *evt = (void *)buf->data;
@ -1085,7 +1084,7 @@ static void le_dhkey_complete(struct net_buf *buf)
bt_smp_dhkey_ready(evt->dhkey);
}
#endif
#endif /* !CONFIG_TINYCRYPT_ECC_DH */
#endif /* CONFIG_BLUETOOTH_SMP */
static void hci_reset_complete(struct net_buf *buf)
@ -1486,15 +1485,14 @@ static void hci_le_meta_event(struct net_buf *buf)
case BT_HCI_EVT_LE_LTK_REQUEST:
le_ltk_request(buf);
break;
/* TODO check tinycrypt define when ECC is added */
#if !defined(CONFIG_TINYCRYPT_ECC)
#if !defined(CONFIG_TINYCRYPT_ECC_DH)
case BT_HCI_EVT_LE_P256_PUBLIC_KEY_COMPLETE:
le_pkey_complete(buf);
break;
case BT_HCI_EVT_LE_GENERATE_DHKEY_COMPLETE:
le_dhkey_complete(buf);
break;
#endif
#endif /* !CONFIG_TINYCRYPT_ECC_DH */
#endif /* CONFIG_BLUETOOTH_SMP */
case BT_HCI_EVT_LE_ADVERTISING_REPORT:
le_adv_report(buf);
@ -2081,8 +2079,7 @@ static int le_init(void)
#if defined(CONFIG_BLUETOOTH_SMP)
cp_mask->events[0] |= 0x10; /* LE Long Term Key Request Event */
/* TODO check tinycrypt define when ECC is added */
#if !defined(CONFIG_TINYCRYPT_ECC)
#if !defined(CONFIG_TINYCRYPT_ECC_DH)
/*
* If controller based ECC is to be used and
* "LE Read Local P-256 Public Key" and "LE Generate DH Key" are
@ -2093,7 +2090,7 @@ static int le_init(void)
cp_mask->events[0] |= 0x80; /* LE Read Local P-256 PKey Compl */
cp_mask->events[1] |= 0x01; /* LE Generate DHKey Compl Event */
}
#endif /* !CONFIG_TINYCRYPT_ECC */
#endif /* !CONFIG_TINYCRYPT_ECC_DH */
#endif /* CONFIG_BLUETOOTH_SMP */
err = bt_hci_cmd_send_sync(BT_HCI_OP_LE_SET_EVENT_MASK, buf, NULL);
@ -2101,8 +2098,7 @@ static int le_init(void)
return err;
}
/* TODO check tinycrypt define when ECC is added */
#if defined(CONFIG_BLUETOOTH_SMP) && !defined(CONFIG_TINYCRYPT_ECC)
#if defined(CONFIG_BLUETOOTH_SMP) && !defined(CONFIG_TINYCRYPT_ECC_DH)
/*
* We check for both "LE Read Local P-256 Public Key" and
* "LE Generate DH Key" support here since both commands are needed for
@ -2117,7 +2113,7 @@ static int le_init(void)
return err;
}
}
#endif
#endif /* CONFIG_BLUETOOTH_SMP && !CONFIG_TINYCRYPT_ECC_DH*/
#if defined(CONFIG_TINYCRYPT_SHA256_HMAC_PRNG)
err = prng_init(&prng);