You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mynewt.apache.org by GitBox <gi...@apache.org> on 2018/05/18 08:10:57 UTC
[GitHub] andrzej-kaczmarek closed pull request #100: nimble/ll: Use simply
memcpy for copying in resolv
andrzej-kaczmarek closed pull request #100: nimble/ll: Use simply memcpy for copying in resolv
URL: https://github.com/apache/mynewt-nimble/pull/100
This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:
As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):
diff --git a/nimble/controller/src/ble_ll_resolv.c b/nimble/controller/src/ble_ll_resolv.c
index 29da6f0d..85c17121 100644
--- a/nimble/controller/src/ble_ll_resolv.c
+++ b/nimble/controller/src/ble_ll_resolv.c
@@ -84,9 +84,6 @@ ble_ll_resolv_gen_priv_addr(struct ble_ll_resolv_entry *rl, int local)
{
uint8_t *irk;
uint8_t *prand;
- uint32_t *irk32;
- uint32_t *key32;
- uint32_t *pt32;
struct ble_encryption_block ecb;
uint8_t *addr;
@@ -105,18 +102,8 @@ ble_ll_resolv_gen_priv_addr(struct ble_ll_resolv_entry *rl, int local)
ble_ll_rand_prand_get(prand);
/* Calculate hash, hash = ah(local IRK, prand) */
-
- irk32 = (uint32_t *)irk;
- key32 = (uint32_t *)&ecb.key[0];
- key32[0] = irk32[0];
- key32[1] = irk32[1];
- key32[2] = irk32[2];
- key32[3] = irk32[3];
- pt32 = (uint32_t *)&ecb.plain_text[0];
- pt32[0] = 0;
- pt32[1] = 0;
- pt32[2] = 0;
- ecb.plain_text[12] = 0;
+ memcpy(ecb.key, irk, 16);
+ memset(ecb.plain_text, 0, 13);
ecb.plain_text[13] = prand[2];
ecb.plain_text[14] = prand[1];
ecb.plain_text[15] = prand[0];
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services