Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion fuzzing/extra/apdu_parser.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ include(${BOLOS_SDK}/fuzzing/libs/lib_standard_app.cmake)

# Define the executable and its properties
add_executable(fuzz_apdu_parser
${BOLOS_SDK}/fuzzing/harness/fuzzer_apdu_parser.c)
${BOLOS_SDK}/fuzzing/harness/fuzzer_apdu_parser.c ${BOLOS_SDK}/lib_alloc/mem_alloc.c)
target_compile_options(fuzz_apdu_parser PUBLIC ${COMPILATION_FLAGS})
target_link_options(fuzz_apdu_parser PUBLIC ${LINK_FLAGS})

Expand Down
2 changes: 1 addition & 1 deletion fuzzing/extra/base58.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ include_guard()
include(${BOLOS_SDK}/fuzzing/libs/lib_standard_app.cmake)

# Define the executable and its properties
add_executable(fuzz_base58 ${BOLOS_SDK}/fuzzing/harness/fuzzer_base58.c)
add_executable(fuzz_base58 ${BOLOS_SDK}/fuzzing/harness/fuzzer_base58.c ${BOLOS_SDK}/lib_alloc/mem_alloc.c)
target_compile_options(fuzz_base58 PUBLIC ${COMPILATION_FLAGS})
target_link_options(fuzz_base58 PUBLIC ${LINK_FLAGS})

Expand Down
2 changes: 1 addition & 1 deletion fuzzing/extra/bip32.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ include_guard()
include(${BOLOS_SDK}/fuzzing/libs/lib_standard_app.cmake)

# Define the executable and its properties
add_executable(fuzz_bip32 ${BOLOS_SDK}/fuzzing/harness/fuzzer_bip32.c)
add_executable(fuzz_bip32 ${BOLOS_SDK}/fuzzing/harness/fuzzer_bip32.c ${BOLOS_SDK}/lib_alloc/mem_alloc.c)
target_compile_options(fuzz_bip32 PUBLIC ${COMPILATION_FLAGS})
target_link_options(fuzz_bip32 PUBLIC ${LINK_FLAGS})

Expand Down
2 changes: 1 addition & 1 deletion fuzzing/extra/qrcodegen.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ include(${BOLOS_SDK}/fuzzing/mock/mock.cmake)
include(${BOLOS_SDK}/fuzzing/libs/lib_qrcode.cmake)

# Define the executable and its properties
add_executable(fuzz_qrcodegen ${BOLOS_SDK}/fuzzing/harness/fuzzer_qrcodegen.c)
add_executable(fuzz_qrcodegen ${BOLOS_SDK}/fuzzing/harness/fuzzer_qrcodegen.c ${BOLOS_SDK}/lib_alloc/mem_alloc.c)
target_compile_options(fuzz_qrcodegen PUBLIC ${COMPILATION_FLAGS})
target_link_options(fuzz_qrcodegen PUBLIC ${LINK_FLAGS})

Expand Down
1 change: 1 addition & 0 deletions fuzzing/mock/mock.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ target_compile_options(mock PUBLIC ${COMPILATION_FLAGS}
target_include_directories(
mock
PUBLIC "${BOLOS_SDK}/lib_cxng/include/"
"${BOLOS_SDK}/lib_alloc/"
"${BOLOS_SDK}/target/${TARGET}/include/"
"${BOLOS_SDK}/lib_standard_app/"
"${BOLOS_SDK}/include/"
Expand Down
Binary file modified fuzzing/shared_libs/libnbgl_shared_apex_p.a
Binary file not shown.
Binary file modified fuzzing/shared_libs/libnbgl_shared_flex.a
Binary file not shown.
Binary file modified fuzzing/shared_libs/libnbgl_shared_nanosp.a
Binary file not shown.
Binary file modified fuzzing/shared_libs/libnbgl_shared_nanox.a
Binary file not shown.
Binary file modified fuzzing/shared_libs/libnbgl_shared_stax.a
Binary file not shown.
2 changes: 1 addition & 1 deletion include/errors.h
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,6 @@ enum sdk_generic_identifiers {
#define EXCEPTION_IO_STATE 0x11 // keep original value // SWO_MUI_UNK_15
#define EXCEPTION_CXPORT 0x12 // keep original value // SWO_MUI_UNK_16
#define EXCEPTION_SYSTEM 0x13 // keep original value // SWO_MUI_UNK_17
#define EXCEPTION_CORRUPT 0x14
#define EXCEPTION_CORRUPT 0x14 // dynamic memory corruption detected

#endif // ERRORS_H
55 changes: 28 additions & 27 deletions include/nbgl_stubs.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,30 +26,31 @@
#define _NR_nbgl_screenHandler 0xa7
#define _NR_nbgl_objPoolGet 0xa8
#define _NR_nbgl_objPoolGetArray 0xa9
#define _NR_nbgl_containerPoolGet 0xaa
#define _NR_nbgl_getCharWidth 0xab
#define _NR_nbgl_getFont 0xac
#define _NR_nbgl_getFontHeight 0xad
#define _NR_nbgl_getFontLineHeight 0xae
#define _NR_nbgl_getSingleLineTextWidth 0xaf
#define _NR_nbgl_getSingleLineTextWidthInLen 0xb0
#define _NR_nbgl_getTextHeight 0xb1
#define _NR_nbgl_getTextHeightInWidth 0xb2
#define _NR_nbgl_getTextMaxLenAndWidth 0xb3
#define _NR_nbgl_getTextNbLinesInWidth 0xb4
#define _NR_nbgl_getTextNbPagesInWidth 0xb5
#define _NR_nbgl_getTextWidth 0xb6
#define _NR_nbgl_getTextMaxLenInNbLines 0xb7
#define _NR_nbgl_textReduceOnNbLines 0xb8
#define _NR_nbgl_textWrapOnNbLines 0xb9
#define _NR_nbgl_refreshUnicodeFont 0xba
#define _NR_nbgl_touchHandler 0xbb
#define _NR_nbgl_touchGetTouchDuration 0xbc
#define _NR_nbgl_touchGetTouchedPosition 0xbd
#define _NR_nbgl_buttonsHandler 0xbe
#define _NR_nbgl_buttonsReset 0xbf
#define _NR_nbgl_keyboardCallback 0xc0
#define _NR_nbgl_keypadCallback 0xc1
#define _NR_nbgl_drawText 0xc2
#define _NR_pic_shared 0xc3
#define _NR_pic_init 0xc4
#define _NR_nbgl_objPoolStat 0xaa
#define _NR_nbgl_containerPoolGet 0xab
#define _NR_nbgl_getCharWidth 0xac
#define _NR_nbgl_getFont 0xad
#define _NR_nbgl_getFontHeight 0xae
#define _NR_nbgl_getFontLineHeight 0xaf
#define _NR_nbgl_getSingleLineTextWidth 0xb0
#define _NR_nbgl_getSingleLineTextWidthInLen 0xb1
#define _NR_nbgl_getTextHeight 0xb2
#define _NR_nbgl_getTextHeightInWidth 0xb3
#define _NR_nbgl_getTextMaxLenAndWidth 0xb4
#define _NR_nbgl_getTextNbLinesInWidth 0xb5
#define _NR_nbgl_getTextNbPagesInWidth 0xb6
#define _NR_nbgl_getTextWidth 0xb7
#define _NR_nbgl_getTextMaxLenInNbLines 0xb8
#define _NR_nbgl_textReduceOnNbLines 0xb9
#define _NR_nbgl_textWrapOnNbLines 0xba
#define _NR_nbgl_refreshUnicodeFont 0xbb
#define _NR_nbgl_touchHandler 0xbc
#define _NR_nbgl_touchGetTouchDuration 0xbd
#define _NR_nbgl_touchGetTouchedPosition 0xbe
#define _NR_nbgl_buttonsHandler 0xbf
#define _NR_nbgl_buttonsReset 0xc0
#define _NR_nbgl_keyboardCallback 0xc1
#define _NR_nbgl_keypadCallback 0xc2
#define _NR_nbgl_drawText 0xc3
#define _NR_pic_shared 0xc4
#define _NR_pic_init 0xc5
4 changes: 0 additions & 4 deletions include/os_ux.h
Original file line number Diff line number Diff line change
Expand Up @@ -75,10 +75,6 @@ typedef struct bolos_ux_params_s {
/* ----------------------------------------------------------------------- */
/* - UX-RELATED - */
/* ----------------------------------------------------------------------- */
#if defined(BOLOS_TEST_APDUS_UX)
void bolos_test_ux_apdu(void);
#endif // defined(BOLOS_TEST_APDUS_UX)

// return !0 when ux scenario has ended, else 0
// while not ended, all display/touch/ticker and other events are to be processed by the ux. only io
// is not processed. when returning !0 the application must send a general status (or continue its
Expand Down
8 changes: 4 additions & 4 deletions lib_nbgl/include/nbgl_obj.h
Original file line number Diff line number Diff line change
Expand Up @@ -708,17 +708,17 @@ void nbgl_objAllowDrawing(bool enable);
uint8_t *nbgl_objGetRAMBuffer(void);
bool nbgl_objIsUx(nbgl_obj_t *obj);

void nbgl_objPoolRelease(uint8_t layer);
void nbgl_objPoolRelease(nbgl_obj_t *obj);
nbgl_obj_t *nbgl_objPoolGet(nbgl_obj_type_t type, uint8_t layer);
uint8_t nbgl_objPoolGetId(nbgl_obj_t *obj);
int nbgl_objPoolGetArray(nbgl_obj_type_t type,
uint8_t nbObjs,
uint8_t layer,
nbgl_obj_t **objArray);
uint8_t nbgl_objPoolGetNbUsed(uint8_t layer);
void nbgl_containerPoolRelease(uint8_t layer);
void nbgl_containerPoolRelease(nbgl_obj_t **obj);
nbgl_obj_t **nbgl_containerPoolGet(uint8_t nbObjs, uint8_t layer);
uint8_t nbgl_containerPoolGetNbUsed(uint8_t layer);
void nbgl_objPoolStat(size_t *allocated_size, uint32_t *nb_allocated);
void nbgl_objPoolReset(void);

// for internal use
void nbgl_objDrawKeyboard(nbgl_keyboard_t *kbd);
Expand Down
1 change: 1 addition & 0 deletions src/nbgl_stubs.S
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ NBGL_TRAMPOLINE _NR_nbgl_screenReset nbgl_screenReset
NBGL_TRAMPOLINE _NR_nbgl_screenHandler nbgl_screenHandler
NBGL_TRAMPOLINE _NR_nbgl_objPoolGet nbgl_objPoolGet
NBGL_TRAMPOLINE _NR_nbgl_objPoolGetArray nbgl_objPoolGetArray
NBGL_TRAMPOLINE _NR_nbgl_objPoolStat nbgl_objPoolStat
NBGL_TRAMPOLINE _NR_nbgl_containerPoolGet nbgl_containerPoolGet
NBGL_TRAMPOLINE _NR_nbgl_getCharWidth nbgl_getCharWidth
NBGL_TRAMPOLINE _NR_nbgl_getFont nbgl_getFont
Expand Down
2 changes: 2 additions & 0 deletions tests/screenshots/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,7 @@ INC:= \
$(SRC_DIR)/uzlib \
$(PUBLIC_SDK_DIR)/target/$(TARGET_PRODUCT_NAME)/include \
$(PUBLIC_SDK_DIR)/include \
$(PUBLIC_SDK_DIR)/lib_alloc \
$(PUBLIC_SDK_DIR)/lib_ux_nbgl \
$(PUBLIC_SDK_DIR)/lib_cxng/include \
$(PUBLIC_SDK_DIR)/io/include \
Expand All @@ -198,6 +199,7 @@ SRCS += $(shell find $(SRC_DIR)/uzlib -type f -name '*.c')
SRCS += $(shell find $(SRC_DIR)/main -type f -name '*.c')
LIB_SRCS := $(shell find $(NBGL_PATH)/src -type f -name '*.c')
LIB_SRCS += $(shell find $(PUBLIC_SDK_DIR)/qrcode/src -type f -name '*.c')
LIB_SRCS += $(PUBLIC_SDK_DIR)/lib_alloc/mem_alloc.c

ifneq (, $(filter $(TARGET_DEFINES), SCREEN_SIZE_WALLET))
APP_GLYPHS_PATH := $(APP_PATH)/glyphs/$(APP_ICON_SIZE)/
Expand Down
Binary file not shown.
Binary file modified tests/screenshots/shared_libs/libnbgl_shared_screenshots_flex.a
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file modified tests/screenshots/shared_libs/libnbgl_shared_screenshots_stax.a
Binary file not shown.
13 changes: 13 additions & 0 deletions tests/screenshots/src/main/stubs.c
Original file line number Diff line number Diff line change
Expand Up @@ -292,3 +292,16 @@ void *pic(void *linked_address)
{
return linked_address;
}

//===================================================
// Exception-related functions. Exceptions are not handled, functions are just defined so that tests
// can compile.
try_context_t *try_context_get(void)
{
return NULL;
}

void os_longjmp(uint32_t exception)
{
longjmp(try_context_get()->jmp_buf, exception);
}