Commit Graph

14 Commits

Author SHA1 Message Date
Michael Grand 5047f032c9 fih: Hardening of fault injection countermeasures
Returned values are now hardcoded. Indeed, while it is not
strictly needed (few return values different from SUCCESS
or FAILURE) complexity added by encoding return values might
cause the software to be vulnerable to fault attacks.

Return type changed from fih_int to fih_ret to make
the whole thing much simpler and therefore more robust
to fault attacks. In addition, its easier to predict
compiler behavior.

Affectation of sentive variables has been hardened using macro
FIH_SET (affectation + check wether write access has been properly
done). FIH_DECLARE() is added to ease the declaration of sentive
variables.

Equality tests fih_eq() and fih_not_eq() are now macros because
inlining produce more complex code (and weaker) than macros.
In addition fih_not_eq is modified to be the negation of fih_eq
which was not the case until now.

when FIH_NOT_EQ is used , FIH_SET(fih_rc, FIH_FAILURE) has been added
in some part of the code.

variable image_mask (bootutil_priv.h) is now volatile because a
double IF test is made on it.

some others parts of the code have been hardenned (eg. loop on images)

Signed-off-by: Michael Grand <m.grand@trustngo.tech>
2023-01-30 09:34:34 -07:00
Xiang Xiao 36bac4f6a5 Fix error: format '%u' expects argument of type 'unsigned int', but argument 5 has type 'uint32_t'
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-11-14 11:10:08 -03:00
Andrés Sánchez Pascual 6ea3e9bd17 boot: nuttx: Support application specific
wdg initialization.

Signed-off-by: Andrés Sánchez Pascual <tito97_sp@hotmail.com>
2022-11-10 09:34:43 -03:00
Andrés Sánchez Pascual 246aca368e Fix sign-comparison issue
Signed-off-by: Andrés Sánchez Pascual <tito97_sp@hotmail.com>
2022-11-07 19:26:24 -03:00
Andrés Sánchez Pascual 414ac87cfd boot: nuttx: main: add suport for board late
initialization.

When using nuttx MCUBoot app as a main entry point in
place of nsh_main it is necesary to perform board-specific
driver initialization through boardctl().

Signed-off-by: Andrés Sánchez Pascual <tito97_sp@hotmail.com>

boot: nuttx: main: fix minor errors according

Signed-off-by: Andrés Sánchez Pascual <tito97_sp@hotmail.com>
2022-09-05 15:50:06 -03:00
Andrés Sánchez Pascual 1595488a92 Update for C++ compiler compatibility
Update flash_map_backend.h to be compatible with a C++ compiler

Signed-off-by: Andrés Sánchez Pascual <tito97_sp@hotmail.com>
Signed-off-by: GitHub <noreply@github.com>
2022-08-23 19:10:44 +02:00
Gerson Fernando Budke d9307312f7 boot/nuttx: Switch from printf to syslog
Use syslog in favor of printf function for print messages. The syslog
ensure that all characters are corrected flushed. Syslog is already
used when log is enabled and this only switch to same log interface.

Signed-off-by: Gerson Fernando Budke <gerson.budke@ossystems.com.br>
2021-12-22 09:34:38 -03:00
Gustavo Henrique Nihei 4aa286d2db flash_map: Increase minimum supported write align via flash_area_align
Signed-off-by: Gustavo Henrique Nihei <gustavo.nihei@espressif.com>
2021-12-16 13:19:12 -07:00
Petro Karashchenko bb927ac014 nuttx: extend configuration options
Signed-off-by: Petro Karashchenko <petro.karashchenko@gmail.com>
2021-12-09 13:06:35 -03:00
Petro Karashchenko 7c890f4b07 nuttx: fix compilation warnings
improved code consistency

Signed-off-by: Petro Karashchenko <petro.karashchenko@gmail.com>
2021-11-25 13:34:34 -03:00
Andres Sanchez 9eff1e08bd nuttx: solve referenciation error in memset call
Signed-off-by: Andres Sanchez <tito97_sp@hotmail.com>
2021-11-16 10:45:59 -03:00
Gustavo Henrique Nihei fca1aa4764 boot/nuttx: Fix trivial compiler warnings emitted by NuttX port
Signed-off-by: Gustavo Henrique Nihei <gustavo.nihei@espressif.com>
2021-08-20 12:25:24 -03:00
Gustavo Henrique Nihei 01184bd036 boot/nuttx: Enable crypto backend according to configuration from NuttX
Signed-off-by: Gustavo Henrique Nihei <gustavo.nihei@espressif.com>
2021-08-19 14:50:03 -03:00
Gustavo Henrique Nihei 7bcf9862de boot: Add support for the Apache NuttX RTOS
Signed-off-by: Gustavo Henrique Nihei <gustavo.nihei@espressif.com>
2021-08-18 18:37:50 -03:00