Refs #1616. Added address parameter to FlashCryptoDecryptDataHook(). Needed to properly exclude a memory region in the firmware encryption add-on module.

git-svn-id: https://svn.code.sf.net/p/openblt/code/trunk@1006 5dc33758-31d5-4daf-9ae8-b24bf3d40d73
This commit is contained in:
Frank Voorburg 2022-12-14 12:11:02 +00:00
parent 256e9e74e9
commit 656912cc94
23 changed files with 138 additions and 69 deletions

View File

@ -108,7 +108,8 @@ typedef struct
* Hook functions
****************************************************************************************/
#if (BOOT_FLASH_CRYPTO_HOOKS_ENABLE > 0)
extern blt_bool FlashCryptoDecryptDataHook(blt_int8u * data, blt_int32u size);
extern blt_bool FlashCryptoDecryptDataHook(blt_addr address, blt_int8u * data,
blt_int32u size);
#endif
@ -377,7 +378,8 @@ blt_bool FlashWriteChecksum(void)
/* perform decryption of the bootblock, before calculating the checksum and writing it
* to flash memory.
*/
if (FlashCryptoDecryptDataHook(bootBlockInfo.data, FLASH_WRITE_BLOCK_SIZE) == BLT_FALSE)
if (FlashCryptoDecryptDataHook(bootBlockInfo.base_addr, bootBlockInfo.data,
FLASH_WRITE_BLOCK_SIZE) == BLT_FALSE)
{
result = BLT_FALSE;
}
@ -722,7 +724,8 @@ static blt_bool FlashWriteBlock(tFlashBlockInfo *block)
#endif
{
/* perform decryption of the program data before writing it to flash memory. */
if (FlashCryptoDecryptDataHook(block->data, FLASH_WRITE_BLOCK_SIZE) == BLT_FALSE)
if (FlashCryptoDecryptDataHook(block->base_addr, block->data,
FLASH_WRITE_BLOCK_SIZE) == BLT_FALSE)
{
result = BLT_FALSE;
}

View File

@ -102,7 +102,8 @@ typedef struct
* Hook functions
****************************************************************************************/
#if (BOOT_FLASH_CRYPTO_HOOKS_ENABLE > 0)
extern blt_bool FlashCryptoDecryptDataHook(blt_int8u * data, blt_int32u size);
extern blt_bool FlashCryptoDecryptDataHook(blt_addr address, blt_int8u * data,
blt_int32u size);
#endif
@ -371,7 +372,8 @@ blt_bool FlashWriteChecksum(void)
/* perform decryption of the bootblock, before calculating the checksum and writing it
* to flash memory.
*/
if (FlashCryptoDecryptDataHook(bootBlockInfo.data, FLASH_WRITE_BLOCK_SIZE) == BLT_FALSE)
if (FlashCryptoDecryptDataHook(bootBlockInfo.base_addr, bootBlockInfo.data,
FLASH_WRITE_BLOCK_SIZE) == BLT_FALSE)
{
return BLT_FALSE;
}
@ -652,7 +654,8 @@ static blt_bool FlashWriteBlock(tFlashBlockInfo *block)
#endif
{
/* perform decryption of the program data before writing it to flash memory. */
if (FlashCryptoDecryptDataHook(block->data, FLASH_WRITE_BLOCK_SIZE) == BLT_FALSE)
if (FlashCryptoDecryptDataHook(block->base_addr, block->data,
FLASH_WRITE_BLOCK_SIZE) == BLT_FALSE)
{
return BLT_FALSE;
}

View File

@ -103,7 +103,8 @@ typedef struct
* Hook functions
****************************************************************************************/
#if (BOOT_FLASH_CRYPTO_HOOKS_ENABLE > 0)
extern blt_bool FlashCryptoDecryptDataHook(blt_int8u * data, blt_int32u size);
extern blt_bool FlashCryptoDecryptDataHook(blt_addr address, blt_int8u * data,
blt_int32u size);
#endif
@ -396,7 +397,8 @@ blt_bool FlashWriteChecksum(void)
/* perform decryption of the bootblock, before calculating the checksum and writing it
* to flash memory.
*/
if (FlashCryptoDecryptDataHook(bootBlockInfo.data, FLASH_WRITE_BLOCK_SIZE) == BLT_FALSE)
if (FlashCryptoDecryptDataHook(bootBlockInfo.base_addr, bootBlockInfo.data,
FLASH_WRITE_BLOCK_SIZE) == BLT_FALSE)
{
result = BLT_FALSE;
}
@ -732,7 +734,8 @@ static blt_bool FlashWriteBlock(tFlashBlockInfo *block)
#endif
{
/* perform decryption of the program data before writing it to flash memory. */
if (FlashCryptoDecryptDataHook(block->data, FLASH_WRITE_BLOCK_SIZE) == BLT_FALSE)
if (FlashCryptoDecryptDataHook(block->base_addr, block->data,
FLASH_WRITE_BLOCK_SIZE) == BLT_FALSE)
{
result = BLT_FALSE;
}

View File

@ -108,7 +108,8 @@ typedef struct
* Hook functions
****************************************************************************************/
#if (BOOT_FLASH_CRYPTO_HOOKS_ENABLE > 0)
extern blt_bool FlashCryptoDecryptDataHook(blt_int8u * data, blt_int32u size);
extern blt_bool FlashCryptoDecryptDataHook(blt_addr address, blt_int8u * data,
blt_int32u size);
#endif
@ -426,7 +427,8 @@ blt_bool FlashWriteChecksum(void)
/* perform decryption of the bootblock, before calculating the checksum and writing it
* to flash memory.
*/
if (FlashCryptoDecryptDataHook(bootBlockInfo.data, FLASH_WRITE_BLOCK_SIZE) == BLT_FALSE)
if (FlashCryptoDecryptDataHook(bootBlockInfo.base_addr, bootBlockInfo.data,
FLASH_WRITE_BLOCK_SIZE) == BLT_FALSE)
{
return BLT_FALSE;
}
@ -708,7 +710,8 @@ static blt_bool FlashWriteBlock(tFlashBlockInfo *block)
#endif
{
/* perform decryption of the program data before writing it to flash memory. */
if (FlashCryptoDecryptDataHook(block->data, FLASH_WRITE_BLOCK_SIZE) == BLT_FALSE)
if (FlashCryptoDecryptDataHook(block->base_addr, block->data,
FLASH_WRITE_BLOCK_SIZE) == BLT_FALSE)
{
return BLT_FALSE;
}

View File

@ -113,7 +113,8 @@ typedef struct
* Hook functions
****************************************************************************************/
#if (BOOT_FLASH_CRYPTO_HOOKS_ENABLE > 0)
extern blt_bool FlashCryptoDecryptDataHook(blt_int8u * data, blt_int32u size);
extern blt_bool FlashCryptoDecryptDataHook(blt_addr address, blt_int8u * data,
blt_int32u size);
#endif
@ -401,7 +402,8 @@ blt_bool FlashWriteChecksum(void)
/* perform decryption of the bootblock, before calculating the checksum and writing it
* to flash memory.
*/
if (FlashCryptoDecryptDataHook(bootBlockInfo.data, FLASH_WRITE_BLOCK_SIZE) == BLT_FALSE)
if (FlashCryptoDecryptDataHook(bootBlockInfo.base_addr, bootBlockInfo.data,
FLASH_WRITE_BLOCK_SIZE) == BLT_FALSE)
{
return BLT_FALSE;
}
@ -676,7 +678,8 @@ static blt_bool FlashWriteBlock(tFlashBlockInfo *block)
#endif
{
/* perform decryption of the program data before writing it to flash memory. */
if (FlashCryptoDecryptDataHook(block->data, FLASH_WRITE_BLOCK_SIZE) == BLT_FALSE)
if (FlashCryptoDecryptDataHook(block->base_addr, block->data,
FLASH_WRITE_BLOCK_SIZE) == BLT_FALSE)
{
return BLT_FALSE;
}

View File

@ -99,7 +99,8 @@ typedef struct
* Hook functions
****************************************************************************************/
#if (BOOT_FLASH_CRYPTO_HOOKS_ENABLE > 0)
extern blt_bool FlashCryptoDecryptDataHook(blt_int8u * data, blt_int32u size);
extern blt_bool FlashCryptoDecryptDataHook(blt_addr address, blt_int8u * data,
blt_int32u size);
#endif
@ -397,7 +398,8 @@ blt_bool FlashWriteChecksum(void)
/* perform decryption of the bootblock, before calculating the checksum and writing it
* to flash memory.
*/
if (FlashCryptoDecryptDataHook(bootBlockInfo.data, FLASH_WRITE_BLOCK_SIZE) == BLT_FALSE)
if (FlashCryptoDecryptDataHook(bootBlockInfo.base_addr, bootBlockInfo.data,
FLASH_WRITE_BLOCK_SIZE) == BLT_FALSE)
{
result = BLT_FALSE;
}
@ -739,7 +741,8 @@ static blt_bool FlashWriteBlock(tFlashBlockInfo *block)
#endif
{
/* perform decryption of the program data before writing it to flash memory. */
if (FlashCryptoDecryptDataHook(block->data, FLASH_WRITE_BLOCK_SIZE) == BLT_FALSE)
if (FlashCryptoDecryptDataHook(block->base_addr, block->data,
FLASH_WRITE_BLOCK_SIZE) == BLT_FALSE)
{
result = BLT_FALSE;
}

View File

@ -100,7 +100,8 @@ typedef struct
* Hook functions
****************************************************************************************/
#if (BOOT_FLASH_CRYPTO_HOOKS_ENABLE > 0)
extern blt_bool FlashCryptoDecryptDataHook(blt_int8u * data, blt_int32u size);
extern blt_bool FlashCryptoDecryptDataHook(blt_addr address, blt_int8u * data,
blt_int32u size);
#endif
@ -373,7 +374,8 @@ blt_bool FlashWriteChecksum(void)
/* perform decryption of the bootblock, before calculating the checksum and writing it
* to flash memory.
*/
if (FlashCryptoDecryptDataHook(bootBlockInfo.data, FLASH_WRITE_BLOCK_SIZE) == BLT_FALSE)
if (FlashCryptoDecryptDataHook(bootBlockInfo.base_addr, bootBlockInfo.data,
FLASH_WRITE_BLOCK_SIZE) == BLT_FALSE)
{
return BLT_FALSE;
}
@ -656,7 +658,8 @@ static blt_bool FlashWriteBlock(tFlashBlockInfo *block)
#endif
{
/* perform decryption of the program data before writing it to flash memory. */
if (FlashCryptoDecryptDataHook(block->data, FLASH_WRITE_BLOCK_SIZE) == BLT_FALSE)
if (FlashCryptoDecryptDataHook(block->base_addr, block->data,
FLASH_WRITE_BLOCK_SIZE) == BLT_FALSE)
{
return BLT_FALSE;
}

View File

@ -104,7 +104,8 @@ typedef struct
* Hook functions
****************************************************************************************/
#if (BOOT_FLASH_CRYPTO_HOOKS_ENABLE > 0)
extern blt_bool FlashCryptoDecryptDataHook(blt_int8u * data, blt_int32u size);
extern blt_bool FlashCryptoDecryptDataHook(blt_addr address, blt_int8u * data,
blt_int32u size);
#endif
@ -374,7 +375,8 @@ blt_bool FlashWriteChecksum(void)
/* perform decryption of the bootblock, before calculating the checksum and writing it
* to flash memory.
*/
if (FlashCryptoDecryptDataHook(bootBlockInfo.data, FLASH_WRITE_BLOCK_SIZE) == BLT_FALSE)
if (FlashCryptoDecryptDataHook(bootBlockInfo.base_addr, bootBlockInfo.data,
FLASH_WRITE_BLOCK_SIZE) == BLT_FALSE)
{
return BLT_FALSE;
}
@ -655,7 +657,8 @@ static blt_bool FlashWriteBlock(tFlashBlockInfo *block)
#endif
{
/* perform decryption of the program data before writing it to flash memory. */
if (FlashCryptoDecryptDataHook(block->data, FLASH_WRITE_BLOCK_SIZE) == BLT_FALSE)
if (FlashCryptoDecryptDataHook(block->base_addr, block->data,
FLASH_WRITE_BLOCK_SIZE) == BLT_FALSE)
{
return BLT_FALSE;
}

View File

@ -103,7 +103,8 @@ typedef struct
* Hook functions
****************************************************************************************/
#if (BOOT_FLASH_CRYPTO_HOOKS_ENABLE > 0)
extern blt_bool FlashCryptoDecryptDataHook(blt_int8u * data, blt_int32u size);
extern blt_bool FlashCryptoDecryptDataHook(blt_addr address, blt_int8u * data,
blt_int32u size);
#endif
@ -415,7 +416,8 @@ blt_bool FlashWriteChecksum(void)
/* perform decryption of the bootblock, before calculating the checksum and writing it
* to flash memory.
*/
if (FlashCryptoDecryptDataHook(bootBlockInfo.data, FLASH_WRITE_BLOCK_SIZE) == BLT_FALSE)
if (FlashCryptoDecryptDataHook(bootBlockInfo.base_addr, bootBlockInfo.data,
FLASH_WRITE_BLOCK_SIZE) == BLT_FALSE)
{
return BLT_FALSE;
}
@ -688,7 +690,8 @@ static blt_bool FlashWriteBlock(tFlashBlockInfo *block)
#endif
{
/* perform decryption of the program data before writing it to flash memory. */
if (FlashCryptoDecryptDataHook(block->data, FLASH_WRITE_BLOCK_SIZE) == BLT_FALSE)
if (FlashCryptoDecryptDataHook(block->base_addr, block->data,
FLASH_WRITE_BLOCK_SIZE) == BLT_FALSE)
{
return BLT_FALSE;
}

View File

@ -100,7 +100,8 @@ typedef struct
* Hook functions
****************************************************************************************/
#if (BOOT_FLASH_CRYPTO_HOOKS_ENABLE > 0)
extern blt_bool FlashCryptoDecryptDataHook(blt_int8u * data, blt_int32u size);
extern blt_bool FlashCryptoDecryptDataHook(blt_addr address, blt_int8u * data,
blt_int32u size);
#endif
@ -345,7 +346,8 @@ blt_bool FlashWriteChecksum(void)
/* perform decryption of the bootblock, before calculating the checksum and writing it
* to flash memory.
*/
if (FlashCryptoDecryptDataHook(bootBlockInfo.data, FLASH_WRITE_BLOCK_SIZE) == BLT_FALSE)
if (FlashCryptoDecryptDataHook(bootBlockInfo.base_addr, bootBlockInfo.data,
FLASH_WRITE_BLOCK_SIZE) == BLT_FALSE)
{
return BLT_FALSE;
}
@ -618,7 +620,8 @@ static blt_bool FlashWriteBlock(tFlashBlockInfo *block)
#endif
{
/* perform decryption of the program data before writing it to flash memory. */
if (FlashCryptoDecryptDataHook(block->data, FLASH_WRITE_BLOCK_SIZE) == BLT_FALSE)
if (FlashCryptoDecryptDataHook(block->base_addr, block->data,
FLASH_WRITE_BLOCK_SIZE) == BLT_FALSE)
{
return BLT_FALSE;
}

View File

@ -108,7 +108,8 @@ typedef struct
* Hook functions
****************************************************************************************/
#if (BOOT_FLASH_CRYPTO_HOOKS_ENABLE > 0)
extern blt_bool FlashCryptoDecryptDataHook(blt_int8u * data, blt_int32u size);
extern blt_bool FlashCryptoDecryptDataHook(blt_addr address, blt_int8u * data,
blt_int32u size);
#endif
@ -442,7 +443,8 @@ blt_bool FlashWriteChecksum(void)
/* perform decryption of the bootblock, before calculating the checksum and writing it
* to flash memory.
*/
if (FlashCryptoDecryptDataHook(bootBlockInfo.data, FLASH_WRITE_BLOCK_SIZE) == BLT_FALSE)
if (FlashCryptoDecryptDataHook(bootBlockInfo.base_addr, bootBlockInfo.data,
FLASH_WRITE_BLOCK_SIZE) == BLT_FALSE)
{
return BLT_FALSE;
}
@ -724,7 +726,8 @@ static blt_bool FlashWriteBlock(tFlashBlockInfo *block)
#endif
{
/* perform decryption of the program data before writing it to flash memory. */
if (FlashCryptoDecryptDataHook(block->data, FLASH_WRITE_BLOCK_SIZE) == BLT_FALSE)
if (FlashCryptoDecryptDataHook(block->base_addr, block->data,
FLASH_WRITE_BLOCK_SIZE) == BLT_FALSE)
{
return BLT_FALSE;
}

View File

@ -109,7 +109,8 @@ typedef struct
* Hook functions
****************************************************************************************/
#if (BOOT_FLASH_CRYPTO_HOOKS_ENABLE > 0)
extern blt_bool FlashCryptoDecryptDataHook(blt_int8u * data, blt_int32u size);
extern blt_bool FlashCryptoDecryptDataHook(blt_addr address, blt_int8u * data,
blt_int32u size);
#endif
@ -419,7 +420,8 @@ blt_bool FlashWriteChecksum(void)
/* perform decryption of the bootblock, before calculating the checksum and writing it
* to flash memory.
*/
if (FlashCryptoDecryptDataHook(bootBlockInfo.data, FLASH_WRITE_BLOCK_SIZE) == BLT_FALSE)
if (FlashCryptoDecryptDataHook(bootBlockInfo.base_addr, bootBlockInfo.data,
FLASH_WRITE_BLOCK_SIZE) == BLT_FALSE)
{
result = BLT_FALSE;
}
@ -764,7 +766,8 @@ static blt_bool FlashWriteBlock(tFlashBlockInfo *block)
#endif
{
/* perform decryption of the program data before writing it to flash memory. */
if (FlashCryptoDecryptDataHook(block->data, FLASH_WRITE_BLOCK_SIZE) == BLT_FALSE)
if (FlashCryptoDecryptDataHook(block->base_addr, block->data,
FLASH_WRITE_BLOCK_SIZE) == BLT_FALSE)
{
result = BLT_FALSE;
}

View File

@ -105,7 +105,8 @@ typedef struct
* Hook functions
****************************************************************************************/
#if (BOOT_FLASH_CRYPTO_HOOKS_ENABLE > 0)
extern blt_bool FlashCryptoDecryptDataHook(blt_int8u * data, blt_int32u size);
extern blt_bool FlashCryptoDecryptDataHook(blt_addr address, blt_int8u * data,
blt_int32u size);
#endif
@ -404,7 +405,8 @@ blt_bool FlashWriteChecksum(void)
/* perform decryption of the bootblock, before calculating the checksum and writing it
* to flash memory.
*/
if (FlashCryptoDecryptDataHook(bootBlockInfo.data, FLASH_WRITE_BLOCK_SIZE) == BLT_FALSE)
if (FlashCryptoDecryptDataHook(bootBlockInfo.base_addr, bootBlockInfo.data,
FLASH_WRITE_BLOCK_SIZE) == BLT_FALSE)
{
return BLT_FALSE;
}
@ -677,7 +679,8 @@ static blt_bool FlashWriteBlock(tFlashBlockInfo *block)
#endif
{
/* perform decryption of the program data before writing it to flash memory. */
if (FlashCryptoDecryptDataHook(block->data, FLASH_WRITE_BLOCK_SIZE) == BLT_FALSE)
if (FlashCryptoDecryptDataHook(block->base_addr, block->data,
FLASH_WRITE_BLOCK_SIZE) == BLT_FALSE)
{
return BLT_FALSE;
}

View File

@ -100,7 +100,8 @@ typedef struct
* Hook functions
****************************************************************************************/
#if (BOOT_FLASH_CRYPTO_HOOKS_ENABLE > 0)
extern blt_bool FlashCryptoDecryptDataHook(blt_int8u * data, blt_int32u size);
extern blt_bool FlashCryptoDecryptDataHook(blt_addr address, blt_int8u * data,
blt_int32u size);
#endif
@ -361,7 +362,8 @@ blt_bool FlashWriteChecksum(void)
/* perform decryption of the bootblock, before calculating the checksum and writing it
* to flash memory.
*/
if (FlashCryptoDecryptDataHook(bootBlockInfo.data, FLASH_WRITE_BLOCK_SIZE) == BLT_FALSE)
if (FlashCryptoDecryptDataHook(bootBlockInfo.base_addr, bootBlockInfo.data,
FLASH_WRITE_BLOCK_SIZE) == BLT_FALSE)
{
return BLT_FALSE;
}
@ -634,7 +636,8 @@ static blt_bool FlashWriteBlock(tFlashBlockInfo *block)
#endif
{
/* perform decryption of the program data before writing it to flash memory. */
if (FlashCryptoDecryptDataHook(block->data, FLASH_WRITE_BLOCK_SIZE) == BLT_FALSE)
if (FlashCryptoDecryptDataHook(block->base_addr, block->data,
FLASH_WRITE_BLOCK_SIZE) == BLT_FALSE)
{
return BLT_FALSE;
}

View File

@ -104,7 +104,8 @@ typedef struct
* Hook functions
****************************************************************************************/
#if (BOOT_FLASH_CRYPTO_HOOKS_ENABLE > 0)
extern blt_bool FlashCryptoDecryptDataHook(blt_int8u * data, blt_int32u size);
extern blt_bool FlashCryptoDecryptDataHook(blt_addr address, blt_int8u * data,
blt_int32u size);
#endif
@ -426,7 +427,8 @@ blt_bool FlashWriteChecksum(void)
/* perform decryption of the bootblock, before calculating the checksum and writing it
* to flash memory.
*/
if (FlashCryptoDecryptDataHook(bootBlockInfo.data, FLASH_WRITE_BLOCK_SIZE) == BLT_FALSE)
if (FlashCryptoDecryptDataHook(bootBlockInfo.base_addr, bootBlockInfo.data,
FLASH_WRITE_BLOCK_SIZE) == BLT_FALSE)
{
result = BLT_FALSE;
}
@ -768,7 +770,8 @@ static blt_bool FlashWriteBlock(tFlashBlockInfo *block)
#endif
{
/* perform decryption of the program data before writing it to flash memory. */
if (FlashCryptoDecryptDataHook(block->data, FLASH_WRITE_BLOCK_SIZE) == BLT_FALSE)
if (FlashCryptoDecryptDataHook(block->base_addr, block->data,
FLASH_WRITE_BLOCK_SIZE) == BLT_FALSE)
{
result = BLT_FALSE;
}

View File

@ -104,7 +104,8 @@ typedef struct
* Hook functions
****************************************************************************************/
#if (BOOT_FLASH_CRYPTO_HOOKS_ENABLE > 0)
extern blt_bool FlashCryptoDecryptDataHook(blt_int8u * data, blt_int32u size);
extern blt_bool FlashCryptoDecryptDataHook(blt_addr address, blt_int8u * data,
blt_int32u size);
#endif
@ -424,7 +425,8 @@ blt_bool FlashWriteChecksum(void)
/* perform decryption of the bootblock, before calculating the checksum and writing it
* to flash memory.
*/
if (FlashCryptoDecryptDataHook(bootBlockInfo.data, FLASH_WRITE_BLOCK_SIZE) == BLT_FALSE)
if (FlashCryptoDecryptDataHook(bootBlockInfo.base_addr, bootBlockInfo.data,
FLASH_WRITE_BLOCK_SIZE) == BLT_FALSE)
{
return BLT_FALSE;
}
@ -697,7 +699,8 @@ static blt_bool FlashWriteBlock(tFlashBlockInfo *block)
#endif
{
/* perform decryption of the program data before writing it to flash memory. */
if (FlashCryptoDecryptDataHook(block->data, FLASH_WRITE_BLOCK_SIZE) == BLT_FALSE)
if (FlashCryptoDecryptDataHook(block->base_addr, block->data,
FLASH_WRITE_BLOCK_SIZE) == BLT_FALSE)
{
return BLT_FALSE;
}

View File

@ -106,7 +106,8 @@ typedef struct
* Hook functions
****************************************************************************************/
#if (BOOT_FLASH_CRYPTO_HOOKS_ENABLE > 0)
extern blt_bool FlashCryptoDecryptDataHook(blt_int8u * data, blt_int32u size);
extern blt_bool FlashCryptoDecryptDataHook(blt_addr address, blt_int8u * data,
blt_int32u size);
#endif
@ -376,7 +377,8 @@ blt_bool FlashWriteChecksum(void)
/* perform decryption of the bootblock, before calculating the checksum and writing it
* to flash memory.
*/
if (FlashCryptoDecryptDataHook(bootBlockInfo.data, FLASH_WRITE_BLOCK_SIZE) == BLT_FALSE)
if (FlashCryptoDecryptDataHook(bootBlockInfo.base_addr, bootBlockInfo.data,
FLASH_WRITE_BLOCK_SIZE) == BLT_FALSE)
{
return BLT_FALSE;
}
@ -657,7 +659,8 @@ static blt_bool FlashWriteBlock(tFlashBlockInfo *block)
#endif
{
/* perform decryption of the program data before writing it to flash memory. */
if (FlashCryptoDecryptDataHook(block->data, FLASH_WRITE_BLOCK_SIZE) == BLT_FALSE)
if (FlashCryptoDecryptDataHook(block->base_addr, block->data,
FLASH_WRITE_BLOCK_SIZE) == BLT_FALSE)
{
return BLT_FALSE;
}

View File

@ -129,7 +129,8 @@ typedef struct
* Hook functions
****************************************************************************************/
#if (BOOT_FLASH_CRYPTO_HOOKS_ENABLE > 0)
extern blt_bool FlashCryptoDecryptDataHook(blt_int8u * data, blt_int32u size);
extern blt_bool FlashCryptoDecryptDataHook(blt_addr address, blt_int8u * data,
blt_int32u size);
#endif
@ -391,7 +392,8 @@ blt_bool FlashWriteChecksum(void)
/* perform decryption of the bootblock, before calculating the checksum and writing it
* to flash memory.
*/
if (FlashCryptoDecryptDataHook(bootBlockInfo.data, FLASH_WRITE_BLOCK_SIZE) == BLT_FALSE)
if (FlashCryptoDecryptDataHook(bootBlockInfo.base_addr, bootBlockInfo.data,
FLASH_WRITE_BLOCK_SIZE) == BLT_FALSE)
{
return BLT_FALSE;
}
@ -678,7 +680,8 @@ static blt_bool FlashWriteBlock(tFlashBlockInfo *block)
#endif
{
/* perform decryption of the program data before writing it to flash memory. */
if (FlashCryptoDecryptDataHook(block->data, FLASH_WRITE_BLOCK_SIZE) == BLT_FALSE)
if (FlashCryptoDecryptDataHook(block->base_addr, block->data,
FLASH_WRITE_BLOCK_SIZE) == BLT_FALSE)
{
return BLT_FALSE;
}

View File

@ -100,7 +100,8 @@ typedef struct
* Hook functions
****************************************************************************************/
#if (BOOT_FLASH_CRYPTO_HOOKS_ENABLE > 0)
extern blt_bool FlashCryptoDecryptDataHook(blt_int8u * data, blt_int32u size);
extern blt_bool FlashCryptoDecryptDataHook(blt_addr address, blt_int8u * data,
blt_int32u size);
#endif
@ -350,7 +351,8 @@ blt_bool FlashWriteChecksum(void)
/* perform decryption of the bootblock, before calculating the checksum and writing it
* to flash memory.
*/
if (FlashCryptoDecryptDataHook(bootBlockInfo.data, FLASH_WRITE_BLOCK_SIZE) == BLT_FALSE)
if (FlashCryptoDecryptDataHook(bootBlockInfo.base_addr, bootBlockInfo.data,
FLASH_WRITE_BLOCK_SIZE) == BLT_FALSE)
{
return BLT_FALSE;
}
@ -623,7 +625,8 @@ static blt_bool FlashWriteBlock(tFlashBlockInfo *block)
#endif
{
/* perform decryption of the program data before writing it to flash memory. */
if (FlashCryptoDecryptDataHook(block->data, FLASH_WRITE_BLOCK_SIZE) == BLT_FALSE)
if (FlashCryptoDecryptDataHook(block->base_addr, block->data,
FLASH_WRITE_BLOCK_SIZE) == BLT_FALSE)
{
return BLT_FALSE;
}

View File

@ -101,7 +101,8 @@ typedef struct
* Hook functions
****************************************************************************************/
#if (BOOT_FLASH_CRYPTO_HOOKS_ENABLE > 0)
extern blt_bool FlashCryptoDecryptDataHook(blt_int8u * data, blt_int32u size);
extern blt_bool FlashCryptoDecryptDataHook(blt_addr address, blt_int8u * data,
blt_int32u size);
#endif
@ -381,7 +382,8 @@ blt_bool FlashWriteChecksum(void)
/* perform decryption of the bootblock, before calculating the checksum and writing it
* to flash memory.
*/
if (FlashCryptoDecryptDataHook(bootBlockInfo.data, FLASH_WRITE_BLOCK_SIZE) == BLT_FALSE)
if (FlashCryptoDecryptDataHook(bootBlockInfo.base_addr, bootBlockInfo.data,
FLASH_WRITE_BLOCK_SIZE) == BLT_FALSE)
{
result = BLT_FALSE;
}
@ -725,7 +727,8 @@ static blt_bool FlashWriteBlock(tFlashBlockInfo *block)
#endif
{
/* perform decryption of the program data before writing it to flash memory. */
if (FlashCryptoDecryptDataHook(block->data, FLASH_WRITE_BLOCK_SIZE) == BLT_FALSE)
if (FlashCryptoDecryptDataHook(block->base_addr, block->data,
FLASH_WRITE_BLOCK_SIZE) == BLT_FALSE)
{
result = BLT_FALSE;
}

View File

@ -160,7 +160,8 @@ typedef void (*pFlashExeCmdFct)(void);
* Hook functions
****************************************************************************************/
#if (BOOT_FLASH_CRYPTO_HOOKS_ENABLE > 0)
extern blt_bool FlashCryptoDecryptDataHook(blt_int8u * data, blt_int32u size);
extern blt_bool FlashCryptoDecryptDataHook(blt_addr address, blt_int8u * data,
blt_int32u size);
#endif
@ -576,7 +577,8 @@ blt_bool FlashWriteChecksum(void)
/* perform decryption of the bootblock, before calculating the checksum and writing it
* to flash memory.
*/
if (FlashCryptoDecryptDataHook(bootBlockInfo.data, FLASH_WRITE_BLOCK_SIZE) == BLT_FALSE)
if (FlashCryptoDecryptDataHook(bootBlockInfo.base_addr, bootBlockInfo.data,
FLASH_WRITE_BLOCK_SIZE) == BLT_FALSE)
{
return BLT_FALSE;
}
@ -910,7 +912,8 @@ static blt_bool FlashWriteBlock(tFlashBlockInfo *block)
#endif
{
/* perform decryption of the program data before writing it to flash memory. */
if (FlashCryptoDecryptDataHook(block->data, FLASH_WRITE_BLOCK_SIZE) == BLT_FALSE)
if (FlashCryptoDecryptDataHook(block->base_addr, block->data,
FLASH_WRITE_BLOCK_SIZE) == BLT_FALSE)
{
return BLT_FALSE;
}

View File

@ -114,7 +114,8 @@ typedef struct
* Hook functions
****************************************************************************************/
#if (BOOT_FLASH_CRYPTO_HOOKS_ENABLE > 0)
extern blt_bool FlashCryptoDecryptDataHook(blt_int8u * data, blt_int32u size);
extern blt_bool FlashCryptoDecryptDataHook(blt_addr address, blt_int8u * data,
blt_int32u size);
#endif
@ -512,7 +513,8 @@ blt_bool FlashWriteChecksum(void)
/* perform decryption of the bootblock, before calculating the checksum and writing it
* to flash memory.
*/
if (FlashCryptoDecryptDataHook(bootBlockInfo.data, FLASH_WRITE_BLOCK_SIZE) == BLT_FALSE)
if (FlashCryptoDecryptDataHook(bootBlockInfo.base_addr, bootBlockInfo.data,
FLASH_WRITE_BLOCK_SIZE) == BLT_FALSE)
{
result = BLT_FALSE;
}
@ -860,7 +862,8 @@ static blt_bool FlashWriteBlock(tFlashBlockInfo *block)
#endif
{
/* perform decryption of the program data before writing it to flash memory. */
if (FlashCryptoDecryptDataHook(block->data, FLASH_WRITE_BLOCK_SIZE) == BLT_FALSE)
if (FlashCryptoDecryptDataHook(block->base_addr, block->data,
FLASH_WRITE_BLOCK_SIZE) == BLT_FALSE)
{
result = BLT_FALSE;
}

View File

@ -138,7 +138,8 @@ typedef struct
* Hook functions
****************************************************************************************/
#if (BOOT_FLASH_CRYPTO_HOOKS_ENABLE > 0)
extern blt_bool FlashCryptoDecryptDataHook(blt_int8u * data, blt_int32u size);
extern blt_bool FlashCryptoDecryptDataHook(blt_addr address, blt_int8u * data,
blt_int32u size);
#endif
@ -415,7 +416,8 @@ blt_bool FlashWriteChecksum(void)
/* perform decryption of the bootblock, before calculating the checksum and writing it
* to flash memory.
*/
if (FlashCryptoDecryptDataHook(bootBlockInfo.data, FLASH_WRITE_BLOCK_SIZE) == BLT_FALSE)
if (FlashCryptoDecryptDataHook(bootBlockInfo.base_addr, bootBlockInfo.data,
FLASH_WRITE_BLOCK_SIZE) == BLT_FALSE)
{
result = BLT_FALSE;
}
@ -767,7 +769,8 @@ static blt_bool FlashWriteBlock(tFlashBlockInfo *block)
#endif
{
/* perform decryption of the program data before writing it to flash memory. */
if (FlashCryptoDecryptDataHook(block->data, FLASH_WRITE_BLOCK_SIZE) == BLT_FALSE)
if (FlashCryptoDecryptDataHook(block->base_addr, block->data,
FLASH_WRITE_BLOCK_SIZE) == BLT_FALSE)
{
result = BLT_FALSE;
}