|
Embedded SDK
Embedded SDK
|
Register Identity flow (P1=0x01, struct type 0x2d). More...
#include <string.h>#include "os_utils.h"#include "os_apdu.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"#include "io.h"#include "nbgl_use_case.h"
Go to the source code of this file.
Classes | |
| struct | s_identity_ctx |
Macros | |
| #define | STRUCT_VERSION 0x01 |
| #define | REGISTER_IDENTITY_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_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_group_handle (const tlv_data_t *data, void *context_ptr) |
| Handler for tag GROUP_HANDLE (optional — links to an existing group). | |
| static bool | handle_hmac_proof (const tlv_data_t *data, void *context_ptr) |
| Handler for tag HMAC_PROOF (optional — proves ownership of an existing group). | |
| static bool | verify_fields (const s_identity_ctx *context) |
| Check that all mandatory TLV tags were received. | |
| static void | print_payload (const s_identity_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. | |
| static void | ui_display (const s_identity_ctx *context) |
| Display the Register Identity review screen. | |
| bolos_err_t | register_identity (uint8_t *buffer_in, size_t buffer_in_length) |
| Register a new identity. | |
Register Identity flow (P1=0x01, struct type 0x2d).
Flow:
Active under HAVE_ADDRESS_BOOK.
Definition in file identity_register.c.
| #define REGISTER_IDENTITY_TAGS | ( | X | ) |
Definition at line 61 of file identity_register.c.
| #define STRUCT_VERSION 0x01 |
Definition at line 49 of file identity_register.c.
|
static |
Build and send response.
Two paths depending on whether an existing group was provided:
Response format: TYPE_REGISTER_IDENTITY(1) | group_handle(64) | hmac_proof(32) | hmac_rest(32) = 129 B
Definition at line 322 of file identity_register.c.
|
static |
Handler for tag BLOCKCHAIN_FAMILY.
| [in] | data | the tlv data |
| [in] | context_ptr | the received payload |
Definition at line 195 of file identity_register.c.
|
static |
Handler for tag CHAIN_ID.
| [in] | data | the tlv data |
| [in] | context_ptr | the received payload |
Definition at line 181 of file identity_register.c.
|
static |
Handler for tag CONTACT_NAME.
| [in] | data | the tlv data |
| [in] | context_ptr | the received payload |
Definition at line 121 of file identity_register.c.
|
static |
Handler for tag GROUP_HANDLE (optional — links to an existing group).
| [in] | data | the tlv data |
| [in] | context_ptr | the received payload |
Definition at line 210 of file identity_register.c.
|
static |
Handler for tag HMAC_PROOF (optional — proves ownership of an existing group).
| [in] | data | the tlv data |
| [in] | context_ptr | the received payload |
Definition at line 232 of file identity_register.c.
|
static |
Handler for tag ACCOUNT_IDENTIFIER.
| [in] | data | the tlv data |
| [in] | context_ptr | the received payload |
Definition at line 160 of file identity_register.c.
|
static |
Handler for tag SCOPE.
| [in] | data | the tlv data |
| [in] | context_ptr | the received payload |
Definition at line 141 of file identity_register.c.
|
static |
Handler for tag STRUCTURE_TYPE.
| [in] | data | the tlv data |
| [in] | context_ptr | the received payload |
Definition at line 83 of file identity_register.c.
|
static |
Handler for tag STRUCTURE_VERSION.
| [in] | data | the tlv data |
| [in] | context_ptr | the received payload |
Definition at line 102 of file identity_register.c.
|
static |
Print the received descriptor.
| [in] | context | the received payload Only for debug purpose. |
Definition at line 290 of file identity_register.c.
| bolos_err_t register_identity | ( | uint8_t * | buffer_in, |
| size_t | buffer_in_length ) |
Register a new identity.
| [in] | buffer_in | the input buffer containing the identity data |
| [in] | buffer_in_length | the length of the input buffer |
Definition at line 430 of file identity_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 383 of file identity_register.c.
|
static |
Display the Register Identity review screen.
Definition at line 403 of file identity_register.c.
|
static |
Check that all mandatory TLV tags were received.
| [in] | context | the received payload |
Definition at line 254 of file identity_register.c.