Embedded SDK
Embedded SDK
Loading...
Searching...
No Matches
identity_provide_contact.c File Reference

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"
Include dependency graph for identity_provide_contact.c:

Go to the source code of this file.

Detailed Description

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:

  1. Receive fully assembled payload (multi-chunk reassembly handled by address_book.c)
  2. Parse TLV payload (contact_name + scope + identifier + group_handle + derivation_path + blockchain_family [+ chain_id] + hmac_proof + hmac_rest)
  3. Verify group_handle → extract gid
  4. Verify HMAC_PROOF over (gid, contact_name)
  5. Verify HMAC_REST over (gid, scope, identifier, family[, chain_id])
  6. Call handle_provide_identity() so the coin app can store the contact
  7. Return SWO_SUCCESS (9000, no data)

Active under HAVE_ADDRESS_BOOK.

Definition in file identity_provide_contact.c.