Hi Gustavo,
On Tue, Jul 24, 2012 at 06:29:44PM -0300, Gustavo Padovan wrote:
quoted
+
+ hexdump(keybuf, HCI_AMP_LINK_KEY_SIZE);
Is these hex prints worthwhile? Seems kind expensive, right?
Yes, I will remove this print.
quoted
+ result = hmac_sha256(keybuf, HCI_AMP_LINK_KEY_SIZE, "gamp", 4,
+ gamp_key);
+ hexdump(gamp_key, HCI_AMP_LINK_KEY_SIZE);
+
+ if (result)
+ goto done;
+
+ if (conn->key_type == 3) {
+ BT_DBG("gamp_key");
+ hexdump(gamp_key, HCI_AMP_LINK_KEY_SIZE);
+ memcpy(data, gamp_key, HCI_AMP_LINK_KEY_SIZE);
+ goto done;
+ }
+
+ result = hmac_sha256(gamp_key, HCI_AMP_LINK_KEY_SIZE, "802b", 4,
+ b802_key);
Can't you pass data directly here, instead of b802_key? This could avoid an
extra memcpy.
Yes, will do this way.
Best regards
Andrei Emeltchenko