|
Embedded SDK
Embedded SDK
|
#include <string.h>#include "os_helpers.h"#include "os_print.h"#include "os_utils.h"#include "status_words.h"#include "apdu_chunks.h"#include "transaction_check.h"#include "transaction_check_entrypoints.h"#include "transaction_check_internal.h"
Go to the source code of this file.
Classes | |
| struct | tx_check_report_t |
Macros | |
| #define | P1_DESCRIPTOR 0x00 |
| #define | P1_OPT_IN 0x01 |
| #define | TX_CHECK_WARNINGS |
Functions | |
| static bool | report_matches (const tx_check_context_t *ctx) |
| Check that the stored report applies to the operation being signed. | |
| static const char * | warning_text (void) |
| Text displayed in the warning, from the report risk and category. | |
| void | tx_check_clear (void) |
| Erase the stored report. | |
| tx_check_status_t | tx_check_provide_descriptor (const buffer_t *payload) |
| Parse, verify and store a descriptor, replacing a report not bound to a review. | |
| void | tx_check_apply_report (nbgl_warning_t *warning, const tx_check_context_t *ctx) |
| Bind the stored report to the operation being signed and fill the review warning. | |
| uint16_t | tx_check_status_to_sw (tx_check_status_t status) |
| Standard status word of a Transaction Check status. | |
| bolos_err_t | tx_check_handle_apdu (const uint8_t *buffer, size_t buffer_len, uint8_t p1, uint8_t p2, uint8_t *buffer_out, size_t *buffer_out_length) |
| Handle the SDK APDU: chunked descriptor (P1 0x00) or opt-in request (P1 0x01). | |
Variables | |
| static tx_check_report_t | s_report |
| #define P1_DESCRIPTOR 0x00 |
Definition at line 31 of file transaction_check.c.
| #define P1_OPT_IN 0x01 |
Definition at line 32 of file transaction_check.c.
| #define TX_CHECK_WARNINGS |
Warning bits set by the Transaction Check.
Definition at line 35 of file transaction_check.c.
|
static |
Check that the stored report applies to the operation being signed.
| [in] | ctx | Operation being signed |
Definition at line 68 of file transaction_check.c.
| void tx_check_apply_report | ( | nbgl_warning_t * | warning, |
| const tx_check_context_t * | ctx ) |
Bind the stored report to the operation being signed and fill the review warning.
| [in,out] | warning | Review warning |
| [in] | ctx | Operation being signed |
Definition at line 239 of file transaction_check.c.
| void tx_check_clear | ( | void | ) |
Erase the stored report.
Definition at line 156 of file transaction_check.c.
| bolos_err_t tx_check_handle_apdu | ( | const uint8_t * | buffer, |
| size_t | buffer_len, | ||
| uint8_t | p1, | ||
| uint8_t | p2, | ||
| uint8_t * | buffer_out, | ||
| size_t * | buffer_out_length ) |
Handle the SDK APDU: chunked descriptor (P1 0x00) or opt-in request (P1 0x01).
Handle the SDK default APDU (CLA 0xB0, INS DEFAULT_APDU_INS_TRANSACTION_CHECK).
| [in] | buffer | APDU data |
| [in] | buffer_len | APDU data length |
| [in] | p1 | APDU P1 |
| [in] | p2 | APDU P2 |
| [out] | buffer_out | Response data |
| [in,out] | buffer_out_length | Response capacity in, response length out |
Definition at line 315 of file transaction_check.c.
| tx_check_status_t tx_check_provide_descriptor | ( | const buffer_t * | payload | ) |
Parse, verify and store a descriptor, replacing a report not bound to a review.
Parse, verify and store a Transaction Check descriptor.
| [in] | payload | Complete TLV descriptor |
Definition at line 167 of file transaction_check.c.
| uint16_t tx_check_status_to_sw | ( | tx_check_status_t | status | ) |
Standard status word of a Transaction Check status.
| [in] | status | Status returned by tx_check_provide_descriptor() or tx_check_opt_in() |
Definition at line 283 of file transaction_check.c.
|
static |
Text displayed in the warning, from the report risk and category.
Definition at line 114 of file transaction_check.c.
|
static |
Definition at line 58 of file transaction_check.c.