|
Embedded SDK
Embedded SDK
|
Provide Contact flow (P1=0x20, struct type 0x33). 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 "identity.h"
Go to the source code of this file.
Classes | |
| struct | s_provide_contact_ctx |
Macros | |
| #define | STRUCT_VERSION 0x01 |
| #define | PROVIDE_CONTACT_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_scope (const tlv_data_t *data, void *context_ptr) |
| Handler for tag SCOPE. | |
| static bool | handle_identifier (const tlv_data_t *data, void *context_ptr) |
| Handler for tag ACCOUNT_IDENTIFIER. | |
| static bool | handle_group_handle (const tlv_data_t *data, void *context_ptr) |
| Handler for tag GROUP_HANDLE. | |
| 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 | handle_hmac_rest (const tlv_data_t *data, void *context_ptr) |
| Handler for tag HMAC_REST. | |
| static bool | verify_fields (const s_provide_contact_ctx *context) |
| Check that all mandatory TLV tags were received. | |
| static void | print_payload (const s_provide_contact_ctx *context) |
| Print the received descriptor. | |
| bolos_err_t | provide_contact (uint8_t *buffer_in, size_t buffer_in_length) |
| Deliver a verified contact to the coin application. | |
Provide Contact flow (P1=0x20, struct type 0x33).
Delivers a previously registered contact to the coin application so that the application can substitute the human-readable name for a raw identifier (e.g. an Ethereum address) during transaction review.
Flow:
Active under HAVE_ADDRESS_BOOK.
Definition in file identity_provide_contact.c.
| #define PROVIDE_CONTACT_TAGS | ( | X | ) |
Definition at line 68 of file identity_provide_contact.c.
| #define STRUCT_VERSION 0x01 |
Definition at line 56 of file identity_provide_contact.c.
|
static |
Handler for tag BLOCKCHAIN_FAMILY.
| [in] | data | the tlv data |
| [out] | context_ptr | the received payload |
Definition at line 223 of file identity_provide_contact.c.
|
static |
Handler for tag CHAIN_ID.
| [in] | data | the tlv data |
| [out] | context_ptr | the received payload |
Definition at line 209 of file identity_provide_contact.c.
|
static |
Handler for tag CONTACT_NAME.
| [in] | data | the tlv data |
| [out] | context_ptr | the received payload |
Definition at line 129 of file identity_provide_contact.c.
|
static |
Handler for tag GROUP_HANDLE.
| [in] | data | the tlv data |
| [out] | context_ptr | the received payload |
Definition at line 188 of file identity_provide_contact.c.
|
static |
Handler for tag HMAC_PROOF.
| [in] | data | the tlv data |
| [out] | context_ptr | the received payload |
Definition at line 237 of file identity_provide_contact.c.
|
static |
Handler for tag HMAC_REST.
| [in] | data | the tlv data |
| [out] | context_ptr | the received payload |
Definition at line 258 of file identity_provide_contact.c.
|
static |
Handler for tag ACCOUNT_IDENTIFIER.
| [in] | data | the tlv data |
| [out] | context_ptr | the received payload |
Definition at line 167 of file identity_provide_contact.c.
|
static |
Handler for tag SCOPE.
| [in] | data | the tlv data |
| [out] | context_ptr | the received payload |
Definition at line 148 of file identity_provide_contact.c.
|
static |
Handler for tag STRUCTURE_TYPE.
| [in] | data | the tlv data |
| [in] | context_ptr | the received payload |
Definition at line 91 of file identity_provide_contact.c.
|
static |
Handler for tag STRUCTURE_VERSION.
| [in] | data | the tlv data |
| [in] | context_ptr | the received payload |
Definition at line 110 of file identity_provide_contact.c.
|
static |
Print the received descriptor.
| [in] | context | the received payload Only for debug purpose. |
Definition at line 311 of file identity_provide_contact.c.
| bolos_err_t provide_contact | ( | uint8_t * | buffer_in, |
| size_t | buffer_in_length ) |
Deliver a verified contact to the coin application.
Parses, verifies, and passes the contact to the coin app callback. Returns SWO_SUCCESS (9000) with no response data on success.
| [in] | buffer_in | the fully assembled TLV payload |
| [in] | buffer_in_length | the length of the payload |
Definition at line 337 of file identity_provide_contact.c.
|
static |
Check that all mandatory TLV tags were received.
| [in] | context | the received payload |
Definition at line 279 of file identity_provide_contact.c.