|
Embedded SDK
Embedded SDK
|
Edit Scope flow (P1=0x04, struct type 0x32). More...
#include <string.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_edit_scope_ctx |
Macros | |
| #define | STRUCT_VERSION 0x01 |
| #define | EDIT_SCOPE_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_previous_scope (const tlv_data_t *data, void *context_ptr) |
| Handler for tag PREVIOUS_SCOPE. | |
| 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_edit_scope_ctx *context) |
| Check that all mandatory TLV tags were received. | |
| static void | print_payload (const s_edit_scope_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 edit. | |
| static void | ui_display (void) |
| Display the Edit Scope review screen. | |
| bolos_err_t | edit_scope (uint8_t *buffer_in, size_t buffer_in_length) |
| Edit the SCOPE of an existing Identity contact. | |
Edit Scope flow (P1=0x04, struct type 0x32).
Allows changing the SCOPE of an existing Identity contact while keeping the same contact_name and identifier.
Flow:
Active under HAVE_ADDRESS_BOOK.
Definition in file identity_edit_scope.c.
| #define EDIT_SCOPE_TAGS | ( | X | ) |
Definition at line 69 of file identity_edit_scope.c.
| #define STRUCT_VERSION 0x01 |
Definition at line 57 of file identity_edit_scope.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 360 of file identity_edit_scope.c.
| bolos_err_t edit_scope | ( | uint8_t * | buffer_in, |
| size_t | buffer_in_length ) |
Edit the SCOPE of an existing Identity contact.
| [in] | buffer_in | the fully assembled TLV payload |
| [in] | buffer_in_length | the length of the payload |
Definition at line 446 of file identity_edit_scope.c.
|
static |
Handler for tag BLOCKCHAIN_FAMILY.
| [in] | data | the tlv data |
| [in] | context_ptr | the received payload |
Definition at line 249 of file identity_edit_scope.c.
|
static |
Handler for tag CHAIN_ID.
| [in] | data | the tlv data |
| [in] | context_ptr | the received payload |
Definition at line 235 of file identity_edit_scope.c.
|
static |
Handler for tag CONTACT_NAME.
| [in] | data | the tlv data |
| [in] | context_ptr | the received payload |
Definition at line 131 of file identity_edit_scope.c.
|
static |
Handler for tag GROUP_HANDLE.
| [in] | data | the tlv data |
| [in] | context_ptr | the received payload |
Definition at line 214 of file identity_edit_scope.c.
|
static |
Handler for tag HMAC_PROOF.
| [in] | data | the tlv data |
| [in] | context_ptr | the received payload |
Definition at line 263 of file identity_edit_scope.c.
|
static |
Handler for tag HMAC_REST.
| [in] | data | the tlv data |
| [in] | context_ptr | the received payload |
Definition at line 283 of file identity_edit_scope.c.
|
static |
Handler for tag ACCOUNT_IDENTIFIER.
| [in] | data | the tlv data |
| [in] | context_ptr | the received payload |
Definition at line 172 of file identity_edit_scope.c.
|
static |
Handler for tag PREVIOUS_SCOPE.
Used to verify the HMAC proof of the previous registration.
| [in] | data | the tlv data |
| [in] | context_ptr | the received payload |
Definition at line 195 of file identity_edit_scope.c.
|
static |
Handler for tag SCOPE.
Stores the new scope.
| [in] | data | the tlv data |
| [in] | context_ptr | the received payload |
Definition at line 153 of file identity_edit_scope.c.
|
static |
Handler for tag STRUCTURE_TYPE.
| [in] | data | the tlv data |
| [in] | context_ptr | the received payload |
Definition at line 93 of file identity_edit_scope.c.
|
static |
Handler for tag STRUCTURE_VERSION.
| [in] | data | the tlv data |
| [in] | context_ptr | the received payload |
Definition at line 112 of file identity_edit_scope.c.
|
static |
Print the received descriptor.
| [in] | context | the received payload Only for debug purpose. |
Definition at line 337 of file identity_edit_scope.c.
|
static |
NBGL callback invoked after the user confirms or rejects the edit.
| [in] | confirm | true if user confirmed, false if rejected |
Definition at line 385 of file identity_edit_scope.c.
|
static |
Display the Edit Scope review screen.
Definition at line 409 of file identity_edit_scope.c.
|
static |
Check that all mandatory TLV tags were received.
| [in] | context | the received payload |
Definition at line 304 of file identity_edit_scope.c.