SIGN IN SIGN UP

Fix security issues found by audit in lib_nbgl

nbgl_layout.c: OOB write on alias tag/value pairs (HIGH)
  Allocation of container->children was gated on pair->valueIcon != NULL,
  but the render path also adds an icon slot for pair->aliasValue (auto
  MINI_PUSH_ICON). For alias pairs without an explicit valueIcon, 2 slots
  were allocated but 3 (or 4 with aliasSubName) were written, corrupting
  adjacent objContainerPool entries on every clear-signing screen
  displaying a trusted name.

nbgl_use_case.c: keyboard buffer overrun for KEYBOARD_WITH_SUGGESTIONS (MEDIUM)
  keyboardCallback wrote to entryBuffer before checking entryMaxLen for
  the KEYBOARD_WITH_SUGGESTIONS path, allowing a one-byte overrun when
  the buffer was exactly full and a new character was typed before the
  suggestion callback masked the key.

nbgl_use_case.c: silent address truncation with no visual indicator (LOW)
  When an address exceeds ADDR_VERIF_NB_PAIRS chunks, the remainder was
  silently dropped without setting hideEndOfLastLine, giving the user no
  indication that the displayed address was incomplete.

nbgl_layout_keyboard.c: unsigned underflow in updateSuggestionButtons (LOW)
  Three comparisons subtracted NB_MAX_VISIBLE_SUGGESTION_BUTTONS or loop
  index i from the uint8_t nbActiveButtons without a prior lower-bound
  guard, wrapping to a large uint32_t and triggering incorrect swipe
  handling and stale choiceTexts reads when nbActiveButtons is small.
C
Charles-Edouard de la Vergne committed
50659b0ce3dcc1d9815cdb965af1bf27e71bfcb9
Parent: dea0bed