Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit d97d6ab7 authored by Jakub Pawlowski's avatar Jakub Pawlowski Committed by android-build-merger
Browse files

Fix SMP_Encrypt for data shorter than 16 bytes

am: 808397cb

Change-Id: I75db1b7271a843578d4be45646769878665af45d
parents 94de6c3e 808397cb
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -115,6 +115,7 @@ void smp_encrypt_data(BT_OCTET16 key, uint8_t* message, uint8_t length,
  if (length > SMP_ENCRYT_DATA_SIZE) length = SMP_ENCRYT_DATA_SIZE;

  uint8_t p_start[SMP_ENCRYT_DATA_SIZE * 4];
  memset(p_start, 0, SMP_ENCRYT_DATA_SIZE * 4);
  p = p_start;
  ARRAY_TO_STREAM(p, message, length);             /* byte 0 to byte 15 */
  p_rev_data = p = p_start + SMP_ENCRYT_DATA_SIZE; /* start at byte 16 */