|
Embedded SDK
Embedded SDK
|
Provide Ledger Account Contact flow (P1=0x21, struct type 0x34). More...
#include <string.h>#include "os_utils.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"
Go to the source code of this file.
Classes | |
| struct | s_provide_ledger_account_ctx |
Macros | |
| #define | STRUCT_VERSION 0x01 |
| #define | PROVIDE_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 | handle_hmac_proof (const tlv_data_t *data, void *context_ptr) |
| Handler for tag HMAC_PROOF. | |
| static bool | verify_fields (const s_provide_ledger_account_ctx *context) |
| Check that all mandatory TLV tags were received. | |
| static void | print_payload (const s_provide_ledger_account_ctx *context) |
| Print the received descriptor. | |
| bolos_err_t | provide_ledger_account_contact (uint8_t *buffer_in, size_t buffer_in_length) |
| Deliver a verified Ledger Account contact to the coin application. | |
Provide Ledger Account Contact flow (P1=0x21, struct type 0x34).
Delivers a previously registered Ledger Account to the coin application so that the application can substitute the human-readable account name for the raw derived address during transaction review.
Unlike the Identity Provide Contact flow (P1=0x20), a Ledger Account has no external address, no group_handle, no scope, and no hmac_rest. The only proof required is the HMAC Proof of Registration returned by register_ledger_account (P1=0x11).
Flow:
Active under HAVE_ADDRESS_BOOK && HAVE_ADDRESS_BOOK_LEDGER_ACCOUNT.
Definition in file ledger_account_provide_contact.c.
| #define PROVIDE_LEDGER_ACCOUNT_TAGS | ( | X | ) |
Definition at line 68 of file ledger_account_provide_contact.c.
| #define STRUCT_VERSION 0x01 |
Definition at line 58 of file ledger_account_provide_contact.c.
|
static |
Handler for tag BLOCKCHAIN_FAMILY.
| [in] | data | the tlv data |
| [out] | context_ptr | the received payload |
Definition at line 174 of file ledger_account_provide_contact.c.
|
static |
Handler for tag CHAIN_ID.
| [in] | data | the tlv data |
| [out] | context_ptr | the received payload |
Definition at line 160 of file ledger_account_provide_contact.c.
|
static |
Handler for tag CONTACT_NAME.
| [in] | data | the tlv data |
| [out] | context_ptr | the received payload |
Definition at line 126 of file ledger_account_provide_contact.c.
|
static |
Handler for tag DERIVATION_PATH.
| [in] | data | the tlv data |
| [out] | context_ptr | the received payload |
Definition at line 146 of file ledger_account_provide_contact.c.
|
static |
Handler for tag HMAC_PROOF.
| [in] | data | the tlv data |
| [out] | context_ptr | the received payload |
Definition at line 188 of file ledger_account_provide_contact.c.
|
static |
Handler for tag STRUCTURE_TYPE.
| [in] | data | the tlv data |
| [in] | context_ptr | the received payload |
Definition at line 88 of file ledger_account_provide_contact.c.
|
static |
Handler for tag STRUCTURE_VERSION.
| [in] | data | the tlv data |
| [in] | context_ptr | the received payload |
Definition at line 107 of file ledger_account_provide_contact.c.
|
static |
Print the received descriptor.
| [in] | context | the received payload |
Definition at line 238 of file ledger_account_provide_contact.c.
| bolos_err_t provide_ledger_account_contact | ( | uint8_t * | buffer_in, |
| size_t | buffer_in_length ) |
Deliver a verified Ledger Account contact to the coin application.
Parses, verifies the HMAC Proof of Registration, and passes the account to the coin app callback. Returns SWO_SUCCESS (9000) with no response data.
| [in] | buffer_in | the fully assembled TLV payload |
| [in] | buffer_in_length | the length of the payload |
Definition at line 276 of file ledger_account_provide_contact.c.
|
static |
Check that all mandatory TLV tags were received.
| [in] | context | the received payload |
Definition at line 210 of file ledger_account_provide_contact.c.