|
Embedded SDK
Embedded SDK
|
Register Ledger Account flow (P1=0x11, struct type 0x2f). More...
#include <string.h>#include "os_utils.h"#include "os_apdu.h"#include "os_pic.h"#include "status_words.h"#include "tlv_library.h"#include "buffer.h"#include "bip32.h"#include "address_book.h"#include "address_book_entrypoints.h"#include "address_book_crypto.h"#include "address_book_common.h"#include "ledger_account.h"#include "io.h"#include "nbgl_use_case.h"
Go to the source code of this file.
Classes | |
| struct | s_ledger_account_ctx |
Macros | |
| #define | STRUCT_VERSION 0x01 |
| #define | LEDGER_ACCOUNT_TAGS(X) |
Functions | |
| static bool | handle_struct_type (const tlv_data_t *data, void *context_ptr) |
| Handler for tag STRUCTURE_TYPE. | |
| static bool | handle_struct_version (const tlv_data_t *data, void *context_ptr) |
| Handler for tag STRUCTURE_VERSION. | |
| static bool | handle_contact_name (const tlv_data_t *data, void *context_ptr) |
| Handler for tag CONTACT_NAME. | |
| static bool | handle_derivation_path (const tlv_data_t *data, void *context_ptr) |
| Handler for tag DERIVATION_PATH. | |
| static bool | handle_chain_id (const tlv_data_t *data, void *context_ptr) |
| Handler for tag CHAIN_ID. | |
| static bool | handle_blockchain_family (const tlv_data_t *data, void *context_ptr) |
| Handler for tag BLOCKCHAIN_FAMILY. | |
| static bool | verify_fields (const s_ledger_account_ctx *context) |
| Check that all mandatory TLV tags were received. | |
| static void | print_payload (const s_ledger_account_ctx *context) |
| Print the received descriptor. | |
| static bool | build_and_send_response (void) |
| Build and send response. | |
| static void | review_choice (bool confirm) |
| NBGL callback invoked after the user confirms or rejects the registration. | |
| bolos_err_t | register_ledger_account (uint8_t *buffer_in, size_t buffer_in_length) |
| Register a new Ledger Account. | |
Register Ledger Account flow (P1=0x11, struct type 0x2f).
Flow:
Active under HAVE_ADDRESS_BOOK_LEDGER_ACCOUNT.
Definition in file ledger_account_register.c.
| #define LEDGER_ACCOUNT_TAGS | ( | X | ) |
Definition at line 63 of file ledger_account_register.c.
| #define STRUCT_VERSION 0x01 |
Definition at line 51 of file ledger_account_register.c.
|
static |
Build and send response.
Compute HMAC Proof of Registration and send it to the host Response format: type(1) | hmac_proof(32).
Definition at line 245 of file ledger_account_register.c.
|
static |
Handler for tag BLOCKCHAIN_FAMILY.
| [in] | data | the tlv data |
| [in] | context_ptr | the received payload |
Definition at line 168 of file ledger_account_register.c.
|
static |
Handler for tag CHAIN_ID.
| [in] | data | the tlv data |
| [in] | context_ptr | the received payload |
Definition at line 154 of file ledger_account_register.c.
|
static |
Handler for tag CONTACT_NAME.
| [in] | data | the tlv data |
| [in] | context_ptr | the received payload |
Definition at line 120 of file ledger_account_register.c.
|
static |
Handler for tag DERIVATION_PATH.
| [in] | data | the tlv data |
| [in] | context_ptr | the received payload |
Definition at line 140 of file ledger_account_register.c.
|
static |
Handler for tag STRUCTURE_TYPE.
| [in] | data | the tlv data |
| [in] | context_ptr | the received payload |
Definition at line 82 of file ledger_account_register.c.
|
static |
Handler for tag STRUCTURE_VERSION.
| [in] | data | the tlv data |
| [in] | context_ptr | the received payload |
Definition at line 101 of file ledger_account_register.c.
|
static |
Print the received descriptor.
| [in] | context | the received payload Only for debug purpose. |
Definition at line 211 of file ledger_account_register.c.
| bolos_err_t register_ledger_account | ( | uint8_t * | buffer_in, |
| size_t | buffer_in_length ) |
Register a new Ledger Account.
| [in] | buffer_in | the input buffer containing the account data |
| [in] | buffer_in_length | the length of the input buffer |
Definition at line 293 of file ledger_account_register.c.
|
static |
NBGL callback invoked after the user confirms or rejects the registration.
| [in] | confirm | true if user confirmed, false if rejected |
Definition at line 269 of file ledger_account_register.c.
|
static |
Check that all mandatory TLV tags were received.
| [in] | context | the received payload |
Definition at line 183 of file ledger_account_register.c.