diff --git a/include/checks.h b/include/checks.h index f0e9851af..157e44003 100644 --- a/include/checks.h +++ b/include/checks.h @@ -23,7 +23,6 @@ #define CHECK_NOT_AUDITED_TLV_TAG 0x9F #define CHECK_NOT_AUDITED_TLV_VAL 0x01 -#define CHECK_NOT_AUDITED_MAX_LEN 0x40 void check_audited_app(void); #endif // !defined(HAVE_BOLOS) && defined(HAVE_PENDING_REVIEW_SCREEN) diff --git a/src/checks.c b/src/checks.c index ae253f2fb..1019d6011 100644 --- a/src/checks.c +++ b/src/checks.c @@ -28,6 +28,7 @@ // This label ultimately comes from the application link. extern unsigned int const _install_parameters; +extern unsigned int const _einstall_parameters; #ifdef HAVE_BAGL @@ -173,8 +174,9 @@ void check_audited_app(void) { unsigned char data = BOLOS_FALSE; unsigned char *buffer = &data; + unsigned int install_parameters_len = (unsigned char *)&_einstall_parameters - (unsigned char *)&_install_parameters; unsigned int length = os_parse_bertlv((unsigned char *) (&_install_parameters), - CHECK_NOT_AUDITED_MAX_LEN, + install_parameters_len, NULL, CHECK_NOT_AUDITED_TLV_TAG, 0x00,