Function flash_area_sector_from_off is replaced with newly used
flash_area_get_sector to cope with calls in bootutil_misc.c file.
This is required for CONFIG_MCUBOOT_SWAP_USING_MOVE to work correctly.
Signed-off-by: Michal Lenc <michallenc@seznam.cz>
Definition of MCUBOOT_SWAP_USING_MOVE in case swap without scratch area
is configured in NuttX was missing from mcuboot_config.h file.
Also necessary function flash_area_sector_from_off() is defined and
declared in order to support swap without scratch.
Signed-off-by: Michal Lenc <michallenc@seznam.cz>
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>
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>
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>
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>