Skip to content

Commit

Permalink
src/checks.c: Use correct install_parameters length
Browse files Browse the repository at this point in the history
(cherry picked from commit db83c5c)
  • Loading branch information
Xavier Chapron committed Dec 5, 2023
1 parent 09dce6e commit 1b2a2f7
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
1 change: 0 additions & 1 deletion include/checks.h
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
7 changes: 5 additions & 2 deletions src/checks.c
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -173,8 +174,10 @@ void check_audited_app(void)
{
unsigned char data = BOLOS_FALSE;
unsigned char *buffer = &data;
unsigned int length = os_parse_bertlv((unsigned char *) (&_install_parameters),
CHECK_NOT_AUDITED_MAX_LEN,
unsigned int install_parameters_len
= (unsigned char *) &_einstall_parameters - (unsigned char *) &_install_parameters;
unsigned int length = os_parse_bertlv((unsigned char *) &_install_parameters,
install_parameters_len,
NULL,
CHECK_NOT_AUDITED_TLV_TAG,
0x00,
Expand Down

0 comments on commit 1b2a2f7

Please sign in to comment.