Skip to content

Commit

Permalink
Merge pull request #766 from LedgerHQ/kme_pending_review_refacto
Browse files Browse the repository at this point in the history
Kme Add flag pending review refacto.
  • Loading branch information
kmeudic-ledger authored Sep 17, 2024
2 parents 3cf221a + ed7420d commit 9a9e153
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 11 deletions.
7 changes: 7 additions & 0 deletions Makefile.standard_app
Original file line number Diff line number Diff line change
Expand Up @@ -198,8 +198,15 @@ ifeq ($(HAVE_APPLICATION_FLAG_LIBRARY), 1)
# APPLICATION_FLAG_LIBRARY 0x800
STANDARD_APP_FLAGS := $(shell echo $$(($(STANDARD_APP_FLAGS) + 0x800)))
endif
ifeq ($(HAVE_APPLICATION_FLAG_NOT_REVIEWED), 1)
# APPLICATION_FLAG_LIBRARY 0x2000
STANDARD_APP_FLAGS := $(shell echo $$(($(STANDARD_APP_FLAGS) + 0x20000)))
endif


# deprecated
# Pending review flag
# use HAVE_APPLICATION_FLAG_NOT_REVIEWED flag instead
ifeq ($(ENABLE_PENDING_REVIEW_SCREEN), 1)
TLVRAW_APP_LOAD_PARAMS += 9F:01
DEFINES += HAVE_PENDING_REVIEW_SCREEN
Expand Down
11 changes: 5 additions & 6 deletions include/appflags.h
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,11 @@
*/
#define APPLICATION_FLAG_BACKGROUND_IMG 0x10000

/**
* Application was not yet audited by ledger
*/
#define APPLICATION_FLAG_NOT_REVIEWED 0x20000

/**
* Custom AEM flag to test AEM capabilities without standard UX permissions
*/
Expand All @@ -89,15 +94,9 @@
#define APPLICATION_FLAG_AEM_PIN APPLICATION_FLAG_BOLOS_UX
#endif // BOLOS_DEBUG_UX_PERMISSION_FLAG

#ifdef HAVE_BACKGROUND_IMG
#define APPLICATION_FLAGS_MASK (0x00000000FFFFFFFFULL)
#define APPLICATION_FLAG_NEG_MASK (0xFFFFFFFF00000000ULL)
#define APPLICATION_FLAGS_SHIFT (32)
#else
#define APPLICATION_FLAGS_MASK (0x0000FFFF)
#define APPLICATION_FLAG_NEG_MASK (0xFFFF0000)
#define APPLICATION_FLAGS_SHIFT (16)
#endif // HAVE_BACKGROUND_IMG

#define GET_COMPLEMENTED_APPLICATION_FLAGS(flags) \
(((~((flags) &APPLICATION_FLAGS_MASK) << APPLICATION_FLAGS_SHIFT)) \
Expand Down
5 changes: 0 additions & 5 deletions include/os_app.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,13 +38,8 @@ typedef struct application_s {
// into Thumb code
appmain_t main;

#ifdef HAVE_BACKGROUND_IMG
// special flags for this application
uint64_t flags;
#else
// special flags for this application
uint32_t flags;
#endif

// Memory organization: [ code (RX) |alignpage| data (RW) |alignpage| install params (R) ]

Expand Down

0 comments on commit 9a9e153

Please sign in to comment.