CDC Badge OS
Firmware for the CDC Badge v1.0 hardware security key
Loading...
Searching...
No Matches
cdc::mod_gpg Namespace Reference

Namespaces

namespace  openpgp

Classes

struct  gpg_status_t
 Snapshot of the current OpenPGP card-application state for UI display. More...
class  GpgModule
struct  gpg_recv_key_t
 One GPG public key received from another badge. More...
struct  gpg_recv_index_entry_t
 Sort entry used to expose a stable ordered index over NVS keys. More...
class  GpgRecvStore
 NVS-backed store for cross-sign target keys received via BLE. More...
struct  gpg_self_cert_t
 One third-party certification received over the badge's own key. More...
struct  gpg_self_cert_index_entry_t
 Sort entry exposing a stable ordered index over the NVS blobs. More...
class  GpgSelfCertStore
 NVS-backed store of third-party certifications on the badge's own key. More...
struct  WizardState
struct  DecKeyStorage
struct  AesKeyStorage

Enumerations

enum  GpgMenuAction : uintptr_t {
  GPG_MENU_STATUS = 1 , GPG_MENU_GENERATE , GPG_MENU_EXPORT , GPG_MENU_SEND ,
  GPG_MENU_RECEIVED , GPG_MENU_MYCERTS , GPG_MENU_SETTINGS , GPG_MENU_RESET
}

Functions

size_t gpgBuildCertPayload (const gpg_recv_key_t &signed_key, uint8_t *out, size_t out_size)
 Serialise a certification return message for a cross-signed key.
bool gpgParseCertPayload (const uint8_t *data, size_t len, gpg_self_cert_t *out, uint8_t out_target_fp[20])
 Parse a certification return message into a self-cert record.
size_t gpgBuildOwnKeyPayload (uint8_t *out, size_t out_size)
 Serialise the badge's own public key into the wire payload.
size_t gpgBuildRecvKeyPayload (const gpg_recv_key_t &key, uint8_t *out, size_t out_size)
 Serialise a stored received key into the wire payload (for forwarding).
bool gpgParseKeyPayload (const uint8_t *data, size_t len, gpg_recv_key_t *out)
 Parse a wire payload into a key record, computing the V5 fingerprint.
static void registerStrings ()
static bool deliverGpgKey (const uint8_t *data, uint32_t len, const char *, const char *)
 cdc_msg delivery callback: store a public key pushed by a peer.
static bool deliverGpgCert (const uint8_t *data, uint32_t len, const char *, const char *)
 cdc_msg delivery callback: store a third-party certification on our own key, sent back by a peer that cross-signed it.
static void cmd_gpg_status (const char *args)
 Serial command printing current GPG key status.
static void cmd_gpg_generate (const char *args)
 Serial command generating GPG key with selected curve and user-id.
static void cmd_gpg_export (const char *args)
 Serial command exporting GPG public key in PEM format.
static void cmd_gpg_reset (const char *args)
static void cmd_gpg_recv_list (const char *args)
static void cmd_gpg_recv_info (const char *args)
static void cmd_gpg_recv_delete (const char *args)
static void cmd_gpg_recv_cross_sign (const char *args)
static void cmd_gpg_recv_export (const char *args)
static void cmd_gpg_mycert_list (const char *args)
static void cmd_gpg_mycert_delete (const char *args)
static void cmd_gpg_recv_import (const char *args)
static void cmd_gpg_mycert_import (const char *args)
static void cmd_gpg_rsa_selftest (const char *args)
 Serial self-test: runs the software RSA round-trip on the live firmware (no SE / NVS), for automated host-driven verification.
static void cmd_gpg (const char *args)
static void registerCommands ()
 Registers serial commands exposed by GPG module.
static void fp_to_hex (const uint8_t *fp, size_t len, char *out, size_t out_size)
static bool parse_index (const char *args, uint8_t *out)
static bool parse_hex (const char *args, uint8_t *out, size_t out_cap, size_t *out_len)
 Decode an ASCII-hex string into out. Skips ASCII whitespace between bytes.
static void showStatus ()
 Displays current GPG key status and metadata.
static void wizardStart ()
 Starts key-generation wizard flow.
static void showExport ()
 Exports public key to serial output and QR view.
static void confirmReset ()
 Opens reset confirmation dialog.
static void showSettings ()
 Shows GPG settings menu.
static void onSettingsSelect (uint16_t index, void *)
 Handles settings-menu selection for PW1/PW3 change flow.
static void showSendKey ()
static void showReceivedKeys ()
static void showMyCertifications ()
static void onMenuSelect (uint16_t, void *userData)
 Handles GPG main-menu selections via the entry's userData tag.
static ui::ListItem makeMenuItem (const char *label, GpgMenuAction action)
static void rebuildMenu ()
 Rebuilds GPG main menu labels and populates userData tags.
static bool gpg_verify_pw1 (const char *pin)
 Verifies OpenPGP PW1 using persistent pin-storage backend.
static bool gpg_verify_pw3 (const char *pin)
 Verifies OpenPGP PW3 using persistent pin-storage backend.
static bool gpg_change_pw1 (const char *, const char *newPin)
 Changes OpenPGP PW1 value.
static bool gpg_change_pw3 (const char *, const char *newPin)
 Changes OpenPGP PW3 value.
static uint8_t gpg_retries_pw1 ()
 Returns remaining retries for OpenPGP PW1.
static uint8_t gpg_retries_pw3 ()
 Returns remaining retries for OpenPGP PW3.
static bool gpg_blocked_pw1 ()
 Returns whether OpenPGP PW1 is blocked.
static bool gpg_blocked_pw3 ()
 Returns whether OpenPGP PW3 is blocked.
static void onGpgPinComplete (bool)
 Pin-change completion callback returning to previous view.
static void formatPinLabel (char *out, size_t outLen, const char *base, bool blocked, uint8_t retries)
 Formats a PIN settings label with its remaining-retry status.
static void onWizardName (const char *text)
 Saves wizard name and opens email step.
static void onWizardEmail (const char *text)
 Saves wizard email and opens curve selection.
static void onWizardCurve (uint16_t index, void *)
 Finalizes wizard curve selection and triggers key generation.
static void onResetConfirm (void *)
 Confirm callback resetting all GPG key material.
static void rebuildReceivedList ()
static void onReceivedListSelect (uint16_t index, void *)
static void showReceivedDetail ()
static void onReceivedActionSelect (uint16_t index, void *)
static void onReceivedSignConfirm (void *)
static void onReceivedDeleteConfirm (void *)
static void rebuildMyCertList ()
static void onMyCertListSelect (uint16_t index, void *)
static void onMyCertDeleteConfirm (void *)
size_t buildEcdhPubkeyBody (const uint8_t *pubkey, uint32_t created_at, uint8_t *out, size_t out_size)
 Serialise an RFC 6637 ECDH Public Key Packet body (algorithm 18).
bool calculateFingerprintV4Ecdh (const uint8_t *pubkey, uint32_t created_at, uint8_t out_fp[20])
 Compute the V4 fingerprint of an ECDH (DEC) subkey.
bool calculateFingerprintV4 (uint8_t curve, const uint8_t *pubkey, size_t pubkey_len, uint32_t created_at, uint8_t out_fp[20])
 Compute the RFC 4880 V4 OpenPGP fingerprint (SHA-1, 20 bytes).
bool calculateFingerprintV5 (uint8_t curve, const uint8_t *pubkey, size_t pubkey_len, uint32_t created_at, uint8_t out_fp[32])
 Compute the V5 / RFC 9580 OpenPGP fingerprint (SHA-256, 32 bytes).
bool gpgCrossSignDigest (const uint8_t fp_v4[20], const char *user_id, uint8_t out_hash[32])
 Build the digest input for a cross-signature.
bool gpgCrossSign (const gpg_recv_key_t &target, uint32_t sig_creation_time, uint8_t out_sig[64])
 Cross-sign a received key with the badge's own SIG ECC slot.
size_t buildCertSigPacket (const gpg_recv_key_t &key, uint8_t *out, size_t out_size)
 Build the OpenPGP Signature Packet body certifying key.
bool gpgBuildReceivedKeyArmored (const gpg_recv_key_t &key, char *out, size_t out_size, size_t *out_len)
 Build an ASCII-armored OpenPGP block for a received peer key.
bool gpgBuildPublicKeyArmored (const gpg_recv_key_t &key, char *out, size_t out_size, size_t *out_len)
 Build an ASCII-armored OpenPGP public-key block (no signature).
bool gpgBuildOwnSignedKeyArmored (char *out, size_t out_size, size_t *out_len)
 Build an ASCII-armored OpenPGP block for the badge's own public key, appending every stored third-party certification on it.
bool gpgBuildOwnSubkeyMaterial (uint8_t dec_pubkey[64], uint32_t *dec_created_at, uint8_t self_sig[64], uint8_t binding_sig[64])
 Gather the badge's own encryption-subkey material for transfer.

Variables

constexpr size_t kGpgCertPayloadMin = 20 + 20 + 1 + 2 + 1
 Minimum payload size (empty issuer uid, 1-byte signature packet).
constexpr size_t kGpgCertPayloadMax = 20 + 20 + 1 + 63 + 2 + kGpgSelfCertSigMax
 Maximum payload size (maximum issuer uid + maximum signature packet).
constexpr size_t kGpgKeyDecBlock = 4 + 64 + 64 + 64
 Fixed-size trailing DEC encryption-subkey block.
constexpr size_t kGpgKeyPayloadMin = 1 + 1 + 32 + 4 + 20 + 1 + 1 + kGpgKeyDecBlock
 Minimum payload size (Ed25519 + empty user id + DEC block).
constexpr size_t kGpgKeyPayloadMax = 1 + 1 + 64 + 4 + 20 + 1 + 63 + kGpgKeyDecBlock
 Maximum payload size (P-256 + maximum user id + DEC block).
constexpr uint8_t kGpgRecvFlagVerified = 0x01
constexpr size_t kGpgSelfCertSigMax = 160
 Maximum length of a stored certification signature packet body (Tag 2).
constexpr ui::I18nEntry kStrings []
static constexpr const char * kGpgKeyMime = "application/pgp-keys"
 MIME type for badge-to-badge public-key transfer over cdc_msg.
static constexpr const char * kGpgCertMime = "application/pgp-signature"
 MIME type for badge-to-badge certification return messages over cdc_msg.
static constexpr const char * CMD_MODULE = "gpg"
static bool s_commandsRegistered = false
static const cdc::serial::SubCommand kGpgSubs []
static char s_reset_token [7] = {}
 Serial command resetting GPG key material.
static uint64_t s_reset_token_ts_us = 0
static constexpr uint64_t RESET_TOKEN_TIMEOUT_US = 30ULL * 1000ULL * 1000ULL
static ui::ListView s_menuView
static ui::ListView s_settingsView
static ui::PinChangeView s_pinChangeView
static ui::T9InputView s_t9Input
static ui::ListView s_curveView
static ui::InfoView s_infoView
static ui::QRCodeView s_qrView
static bool s_viewsInitialized = false
static ui::ListItem s_menuItems [8] = {}
static ui::ListItem s_settingsItems []
static WizardState s_wizard = {}
static char s_userPinLabel [48]
static char s_adminPinLabel [48]
static ui::ListView s_recvListView
 Received-keys list UI state.
static ui::ListView s_recvActionView
static ui::ListItem s_recvListItems [GpgRecvStore::kMaxKeys+1]
static ui::ListItem s_recvActionItems [6]
static char s_recvListLabels [GpgRecvStore::kMaxKeys][72]
static uint8_t s_recvSelectedIndex = 0
static gpg_recv_key_t s_recvSelectedKey = {}
static char s_recvDetailText [640]
static char s_recvExportBuf [4096]
static ui::ListView s_myCertListView
 My-certifications (third-party signatures on our own key) UI state.
static ui::ListItem s_myCertListItems [GpgSelfCertStore::kMaxCerts+1]
static char s_myCertLabels [GpgSelfCertStore::kMaxCerts][72]
static uint8_t s_myCertSelectedIndex = 0
static gpg_self_cert_t s_myCertSelected = {}
static char s_myCertDetailText [320]

Enumeration Type Documentation

◆ GpgMenuAction

enum cdc::mod_gpg::GpgMenuAction : uintptr_t
Enumerator
GPG_MENU_STATUS 
GPG_MENU_GENERATE 
GPG_MENU_EXPORT 
GPG_MENU_SEND 
GPG_MENU_RECEIVED 
GPG_MENU_MYCERTS 
GPG_MENU_SETTINGS 
GPG_MENU_RESET 

Definition at line 594 of file GpgModule.cpp.

Function Documentation

◆ buildCertSigPacket()

size_t cdc::mod_gpg::buildCertSigPacket ( const gpg_recv_key_t & key,
uint8_t * out,
size_t out_size )

Build the OpenPGP Signature Packet body certifying key.

Assembles the Tag 2 packet body (version, sig type 0x10, algo, hash algo, hashed + unhashed subpackets, left-16 hash bits and the R || S MPIs) for the cross-signature already stored in key.my_signature. No tag/length header is written. The same bytes are used by the armored export and the badge-to-badge certification return message so both stay identical.

Parameters
keyReceived key descriptor with a populated my_signature / sig_created_at.
outOutput buffer.
out_sizeCapacity of out.
Returns
Body length, or 0 on error / buffer overflow.

Definition at line 683 of file xsig.cpp.

References cdc::mod_gpg::gpg_status_t::curve, cdc::mod_gpg::gpg_status_t::fingerprint, gpg_get_status(), cdc::mod_gpg::gpg_recv_key_t::my_signature, cdc::mod_gpg::gpg_recv_key_t::sig_created_at, cdc::mod_gpg::gpg_recv_key_t::sig_len, and cdc::mod_gpg::gpg_recv_key_t::user_id.

Referenced by gpgBuildCertPayload(), and gpgBuildOwnSignedKeyArmored().

◆ buildEcdhPubkeyBody()

size_t cdc::mod_gpg::buildEcdhPubkeyBody ( const uint8_t * pubkey,
uint32_t created_at,
uint8_t * out,
size_t out_size )

Serialise an RFC 6637 ECDH Public Key Packet body (algorithm 18).

Layout: version 0x04, 4-byte creation time, ECDH algorithm id, P-256 curve OID, the MPI-encoded uncompressed point, then the KDF parameter field 03 01 <hash> <sym>. Used for the decryption (DEC) encryption subkey so the exported packet and the stored fingerprint stay byte-identical.

Parameters
pubkeyRaw 64-byte P-256 point (X || Y, no SEC1 prefix).
created_atSubkey creation timestamp (Unix epoch seconds).
outOutput buffer.
out_sizeCapacity of out.
Returns
body length, or 0 on failure.

Definition at line 94 of file fingerprint.cpp.

References MPI_FULL_SIZE_P256, MPI_HEADER_SIZE, OPENPGP_ALGO_ECDH, OPENPGP_ECDH_KDF_HASH, OPENPGP_ECDH_KDF_SYM, and P256_PUBKEY_BITS.

Referenced by calculateFingerprintV4Ecdh(), gpgBuildOwnSignedKeyArmored(), and gpgBuildOwnSubkeyMaterial().

◆ calculateFingerprintV4()

bool cdc::mod_gpg::calculateFingerprintV4 ( uint8_t curve,
const uint8_t * pubkey,
size_t pubkey_len,
uint32_t created_at,
uint8_t out_fp[20] )

Compute the RFC 4880 V4 OpenPGP fingerprint (SHA-1, 20 bytes).

Parameters
curveCDC_CURVE_ED25519 or CDC_CURVE_P256.
pubkey32-byte Ed25519 point or raw 64-byte P-256 (X || Y, no SEC1 prefix).
pubkey_lenLength of pubkey (32 or 64).
created_atKey creation timestamp (Unix epoch seconds).
out_fp20-byte output buffer.
Returns
true on success.

Definition at line 141 of file fingerprint.cpp.

References curve.

Referenced by gpgParseKeyPayload().

◆ calculateFingerprintV4Ecdh()

bool cdc::mod_gpg::calculateFingerprintV4Ecdh ( const uint8_t * pubkey,
uint32_t created_at,
uint8_t out_fp[20] )

Compute the V4 fingerprint of an ECDH (DEC) subkey.

Hashes the RFC 6637 ECDH public-key body (see buildEcdhPubkeyBody) so the result matches what GnuPG derives from the exported encryption subkey.

Parameters
pubkeyRaw 64-byte P-256 point (X || Y).
created_atSubkey creation timestamp.
out_fp20-byte output buffer.
Returns
true on success.

Definition at line 130 of file fingerprint.cpp.

References buildEcdhPubkeyBody().

Referenced by gpg_generate_key().

◆ calculateFingerprintV5()

bool cdc::mod_gpg::calculateFingerprintV5 ( uint8_t curve,
const uint8_t * pubkey,
size_t pubkey_len,
uint32_t created_at,
uint8_t out_fp[32] )

Compute the V5 / RFC 9580 OpenPGP fingerprint (SHA-256, 32 bytes).

Uses the same body layout as V4 (version 0x04, EdDSA/ECDSA algo byte, curve OID, MPI). Differs from V4 in the hash function and in the prefix: 0x9A || 4-byte body length (vs V4's 0x99 || 2-byte length).

Definition at line 157 of file fingerprint.cpp.

References curve.

Referenced by gpgParseKeyPayload().

◆ cmd_gpg()

void cdc::mod_gpg::cmd_gpg ( const char * args)
static

Definition at line 185 of file GpgModule.cpp.

References cdc::serial::dispatchSubCommand(), and kGpgSubs.

Referenced by registerCommands().

◆ cmd_gpg_export()

void cdc::mod_gpg::cmd_gpg_export ( const char * args)
static

Serial command exporting GPG public key in PEM format.

Parameters
argsUnused command arguments.

Definition at line 258 of file GpgModule.cpp.

References gpgBuildOwnSignedKeyArmored(), cdc::serial::Console::printf(), and cdc::core::psramAlloc().

◆ cmd_gpg_generate()

void cdc::mod_gpg::cmd_gpg_generate ( const char * args)
static

Serial command generating GPG key with selected curve and user-id.

Parameters
argsCommand arguments (<curve> <user_id>).

Definition at line 223 of file GpgModule.cpp.

References CDC_CURVE_ED25519, CDC_CURVE_P256, curve, gpg_generate_key(), gpg_set_pending_user_id(), GPG_USER_ID_MAX, and cdc::serial::Console::printf().

◆ cmd_gpg_mycert_delete()

void cdc::mod_gpg::cmd_gpg_mycert_delete ( const char * args)
static

◆ cmd_gpg_mycert_import()

void cdc::mod_gpg::cmd_gpg_mycert_import ( const char * args)
static

◆ cmd_gpg_mycert_list()

◆ cmd_gpg_recv_cross_sign()

void cdc::mod_gpg::cmd_gpg_recv_cross_sign ( const char * args)
static

◆ cmd_gpg_recv_delete()

void cdc::mod_gpg::cmd_gpg_recv_delete ( const char * args)
static

◆ cmd_gpg_recv_export()

void cdc::mod_gpg::cmd_gpg_recv_export ( const char * args)
static

◆ cmd_gpg_recv_import()

void cdc::mod_gpg::cmd_gpg_recv_import ( const char * args)
static

◆ cmd_gpg_recv_info()

◆ cmd_gpg_recv_list()

◆ cmd_gpg_reset()

void cdc::mod_gpg::cmd_gpg_reset ( const char * args)
static

◆ cmd_gpg_rsa_selftest()

void cdc::mod_gpg::cmd_gpg_rsa_selftest ( const char * args)
static

Serial self-test: runs the software RSA round-trip on the live firmware (no SE / NVS), for automated host-driven verification.

Parameters
argsOptional modulus size (2048 / 3072 / 4096); default 2048.

Definition at line 555 of file GpgModule.cpp.

References gpg_rsa_selftest(), and cdc::serial::Console::printf().

◆ cmd_gpg_status()

void cdc::mod_gpg::cmd_gpg_status ( const char * args)
static

Serial command printing current GPG key status.

Parameters
argsUnused command arguments.

Definition at line 205 of file GpgModule.cpp.

References CDC_CURVE_ED25519, cdc::mod_gpg::gpg_status_t::created_at, cdc::mod_gpg::gpg_status_t::curve, gpg_get_status(), cdc::serial::Console::printf(), cdc::mod_gpg::gpg_status_t::sign_count, and cdc::mod_gpg::gpg_status_t::user_id.

◆ confirmReset()

void cdc::mod_gpg::confirmReset ( )
static

Opens reset confirmation dialog.

Definition at line 958 of file GpgModule.cpp.

References onResetConfirm(), cdc::ui::showConfirm(), cdc::ui::tr(), and cdc::ui::ConfirmView::WARNING.

Referenced by onMenuSelect().

◆ deliverGpgCert()

bool cdc::mod_gpg::deliverGpgCert ( const uint8_t * data,
uint32_t len,
const char * ,
const char *  )
static

cdc_msg delivery callback: store a third-party certification on our own key, sent back by a peer that cross-signed it.

Parameters
dataWire payload.
lenPayload length.
Returns
true if the certification targets our key and was stored.

Definition at line 126 of file GpgModule.cpp.

References cdc::mod_gpg::gpg_status_t::fingerprint, gpg_get_status(), gpgParseCertPayload(), cdc::mod_gpg::GpgSelfCertStore::instance(), cdc::mod_gpg::gpg_self_cert_t::issuer_uid, LOG_I, LOG_W, and TAG.

Referenced by cdc::mod_gpg::GpgModule::init().

◆ deliverGpgKey()

bool cdc::mod_gpg::deliverGpgKey ( const uint8_t * data,
uint32_t len,
const char * ,
const char *  )
static

cdc_msg delivery callback: store a public key pushed by a peer.

Parameters
dataWire payload.
lenPayload length.
Returns
true if the key was parsed and stored.

Definition at line 100 of file GpgModule.cpp.

References gpgParseKeyPayload(), cdc::mod_gpg::GpgRecvStore::instance(), LOG_I, LOG_W, TAG, and cdc::mod_gpg::gpg_recv_key_t::user_id.

Referenced by cdc::mod_gpg::GpgModule::init().

◆ formatPinLabel()

void cdc::mod_gpg::formatPinLabel ( char * out,
size_t outLen,
const char * base,
bool blocked,
uint8_t retries )
static

Formats a PIN settings label with its remaining-retry status.

Parameters
outDestination buffer.
outLenDestination buffer size.
baseLocalized base label (e.g. "User PIN").
blockedWhether the PIN is currently blocked.
retriesRemaining retry count when not blocked.

Definition at line 769 of file GpgModule.cpp.

References cdc::ui::tr().

Referenced by showSettings().

◆ fp_to_hex()

void cdc::mod_gpg::fp_to_hex ( const uint8_t * fp,
size_t len,
char * out,
size_t out_size )
static

◆ gpg_blocked_pw1()

bool cdc::mod_gpg::gpg_blocked_pw1 ( )
static

Returns whether OpenPGP PW1 is blocked.

Returns
true when blocked.

Definition at line 714 of file GpgModule.cpp.

References pin_storage_openpgp_pw1_blocked().

Referenced by onSettingsSelect(), and showSettings().

◆ gpg_blocked_pw3()

bool cdc::mod_gpg::gpg_blocked_pw3 ( )
static

Returns whether OpenPGP PW3 is blocked.

Returns
true when blocked.

Definition at line 722 of file GpgModule.cpp.

References pin_storage_openpgp_pw3_blocked().

Referenced by onSettingsSelect(), and showSettings().

◆ gpg_change_pw1()

bool cdc::mod_gpg::gpg_change_pw1 ( const char * ,
const char * newPin )
static

Changes OpenPGP PW1 value.

Parameters
oldPinIgnored old PIN parameter from generic callback signature.
newPinNew PW1 value.
Returns
true on success.

Definition at line 680 of file GpgModule.cpp.

References pin_storage_openpgp_change_pw1().

Referenced by onSettingsSelect().

◆ gpg_change_pw3()

bool cdc::mod_gpg::gpg_change_pw3 ( const char * ,
const char * newPin )
static

Changes OpenPGP PW3 value.

Parameters
oldPinIgnored old PIN parameter from generic callback signature.
newPinNew PW3 value.
Returns
true on success.

Definition at line 690 of file GpgModule.cpp.

References pin_storage_openpgp_change_pw3().

Referenced by onSettingsSelect().

◆ gpg_retries_pw1()

uint8_t cdc::mod_gpg::gpg_retries_pw1 ( )
static

Returns remaining retries for OpenPGP PW1.

Returns
Retry counter.

Definition at line 698 of file GpgModule.cpp.

References pin_storage_openpgp_pw1_retries().

Referenced by onSettingsSelect(), and showSettings().

◆ gpg_retries_pw3()

uint8_t cdc::mod_gpg::gpg_retries_pw3 ( )
static

Returns remaining retries for OpenPGP PW3.

Returns
Retry counter.

Definition at line 706 of file GpgModule.cpp.

References pin_storage_openpgp_pw3_retries().

Referenced by onSettingsSelect(), and showSettings().

◆ gpg_verify_pw1()

bool cdc::mod_gpg::gpg_verify_pw1 ( const char * pin)
static

Verifies OpenPGP PW1 using persistent pin-storage backend.

Parameters
pinCandidate PW1 value.
Returns
true when valid.

Definition at line 661 of file GpgModule.cpp.

References pin_storage_openpgp_verify_pw1().

Referenced by onSettingsSelect().

◆ gpg_verify_pw3()

bool cdc::mod_gpg::gpg_verify_pw3 ( const char * pin)
static

Verifies OpenPGP PW3 using persistent pin-storage backend.

Parameters
pinCandidate PW3 value.
Returns
true when valid.

Definition at line 670 of file GpgModule.cpp.

References pin_storage_openpgp_verify_pw3().

Referenced by onSettingsSelect().

◆ gpgBuildCertPayload()

size_t cdc::mod_gpg::gpgBuildCertPayload ( const gpg_recv_key_t & signed_key,
uint8_t * out,
size_t out_size )

Serialise a certification return message for a cross-signed key.

Builds the Tag 2 signature packet from signed_key (which must already hold my_signature) and frames it with the target fingerprint and the badge's own issuer identity.

Parameters
signed_keyReceived key that was cross-signed by this badge.
outOutput buffer.
out_sizeCapacity of out.
Returns
Bytes written, or 0 on failure (key unsigned / buffer too small).

Definition at line 15 of file GpgCertPayload.cpp.

References buildCertSigPacket(), cdc::mod_gpg::gpg_status_t::fingerprint, cdc::mod_gpg::gpg_recv_key_t::fingerprint_v4, gpg_get_status(), kGpgSelfCertSigMax, cdc::mod_gpg::gpg_recv_key_t::sig_len, and cdc::mod_gpg::gpg_status_t::user_id.

Referenced by onReceivedActionSelect().

◆ gpgBuildOwnKeyPayload()

size_t cdc::mod_gpg::gpgBuildOwnKeyPayload ( uint8_t * out,
size_t out_size )

Serialise the badge's own public key into the wire payload.

Parameters
outOutput buffer.
out_sizeCapacity of out.
Returns
Bytes written, or 0 on failure (no key configured / buffer too small).

Definition at line 37 of file GpgKeyPayload.cpp.

References CDC_CURVE_ED25519, cdc::mod_gpg::gpg_status_t::created_at, cdc::mod_gpg::gpg_status_t::curve, curve, cdc::mod_gpg::gpg_status_t::fingerprint, cdc::hal::getSecureElementInstance(), gpg_get_status(), gpg_storage_sig_slot(), gpgBuildOwnSubkeyMaterial(), kGpgKeyDecBlock, cdc::hal::OK, cdc::hal::P256, and cdc::mod_gpg::gpg_status_t::user_id.

Referenced by showSendKey().

◆ gpgBuildOwnSignedKeyArmored()

bool cdc::mod_gpg::gpgBuildOwnSignedKeyArmored ( char * out,
size_t out_size,
size_t * out_len )

Build an ASCII-armored OpenPGP block for the badge's own public key, appending every stored third-party certification on it.

Packs the badge's own Public Key Packet (Tag 6) + User ID Packet (Tag 13) followed by one Certification Signature Packet (Tag 2) per cert held in GpgSelfCertStore. Importing the result merges the accumulated third-party signatures onto the badge's key in a GPG keyring.

Parameters
outOutput character buffer.
out_sizeCapacity of out.
out_lenBytes written (excluding any terminating null).
Returns
true on success; false on buffer overflow or no key configured.

Definition at line 716 of file xsig.cpp.

References buildCertSigPacket(), buildEcdhPubkeyBody(), cdc::mod_gpg::gpg_recv_key_t::created_at, cdc::mod_gpg::gpg_recv_key_t::curve, cdc::mod_gpg::gpg_recv_key_t::fingerprint_v4, gpg_get_dec_pubkey(), gpgCrossSign(), cdc::mod_gpg::GpgSelfCertStore::instance(), KEY_DEC, kGpgSelfCertSigMax, cdc::mod_gpg::gpg_recv_key_t::my_signature, openpgp_get_gen_time(), P256_PUBKEY_SIZE, cdc::core::psramAlloc(), cdc::mod_gpg::gpg_recv_key_t::sig_created_at, cdc::mod_gpg::gpg_recv_key_t::sig_len, cdc::mod_gpg::gpg_self_cert_t::sig_pkt, cdc::mod_gpg::gpg_self_cert_t::sig_pkt_len, and cdc::mod_gpg::gpg_recv_key_t::user_id.

Referenced by cmd_gpg_export(), and showExport().

◆ gpgBuildOwnSubkeyMaterial()

bool cdc::mod_gpg::gpgBuildOwnSubkeyMaterial ( uint8_t dec_pubkey[64],
uint32_t * dec_created_at,
uint8_t self_sig[64],
uint8_t binding_sig[64] )

Gather the badge's own encryption-subkey material for transfer.

Derives the DEC (RFC 6637 ECDH P-256) public point, its creation time, the UID self-signature over the primary SIG key and the DEC subkey-binding signature, all signed with the badge's own SIG slot. The receiver cannot forge these, so they travel in the badge-to-badge key payload and let an exchanged key be imported as a full sign + encrypt OpenPGP key.

Parameters
dec_pubkey64-byte output: raw P-256 point X || Y.
dec_created_atOutput: DEC subkey creation timestamp.
self_sig64-byte output: UID self-certification (R || S).
binding_sig64-byte output: subkey-binding signature (R || S).
Returns
true on success.

Definition at line 792 of file xsig.cpp.

References buildEcdhPubkeyBody(), cdc::mod_gpg::gpg_recv_key_t::created_at, gpg_get_dec_pubkey(), gpgCrossSign(), KEY_DEC, openpgp_get_gen_time(), and P256_PUBKEY_SIZE.

Referenced by gpgBuildOwnKeyPayload().

◆ gpgBuildPublicKeyArmored()

bool cdc::mod_gpg::gpgBuildPublicKeyArmored ( const gpg_recv_key_t & key,
char * out,
size_t out_size,
size_t * out_len )

Build an ASCII-armored OpenPGP public-key block (no signature).

Packs the received key as Public Key Packet (Tag 6) + User ID Packet (Tag 13) into a single BEGIN/END PGP PUBLIC KEY BLOCK payload, suitable for gpg --import or display as a QR code. Works for unsigned keys.

Parameters
keyReceived key descriptor.
outOutput character buffer.
out_sizeCapacity of out.
out_lenBytes written (excluding any terminating null).
Returns
true on success; false on buffer overflow or invalid input.

Definition at line 709 of file xsig.cpp.

Referenced by onReceivedActionSelect().

◆ gpgBuildReceivedKeyArmored()

bool cdc::mod_gpg::gpgBuildReceivedKeyArmored ( const gpg_recv_key_t & key,
char * out,
size_t out_size,
size_t * out_len )

Build an ASCII-armored OpenPGP block for a received peer key.

Packs the received key as Public Key Packet (Tag 6) + User ID Packet (Tag 13) + the owner's UID self-signature + the DEC encryption subkey (Tag 14) with the owner's binding signature, so the result imports into GnuPG as a usable sign + encrypt key. Our own cross-certification is added only when the entry has been cross-signed; the export works either way.

Parameters
keyReceived key descriptor.
outOutput character buffer.
out_sizeCapacity of out.
out_lenBytes written (excluding any terminating null).
Returns
true on success; false on buffer overflow or invalid input.

Definition at line 702 of file xsig.cpp.

Referenced by cmd_gpg_recv_export(), and onReceivedActionSelect().

◆ gpgBuildRecvKeyPayload()

size_t cdc::mod_gpg::gpgBuildRecvKeyPayload ( const gpg_recv_key_t & key,
uint8_t * out,
size_t out_size )

◆ gpgCrossSign()

bool cdc::mod_gpg::gpgCrossSign ( const gpg_recv_key_t & target,
uint32_t sig_creation_time,
uint8_t out_sig[64] )

Cross-sign a received key with the badge's own SIG ECC slot.

Builds the RFC 4880 certification hash (sig type 0x10 over the target's Public Key Packet + User ID Packet), signs it with the badge's signature subkey via TROPIC01, and returns R || S as 64 bytes.

The badge's own curve is read from gpg_get_status; sig length is always 64 regardless of curve (Ed25519 and P-256 both produce 32+32-byte concatenated R || S in this implementation).

Parameters
targetReceived key descriptor.
sig_creation_timeTimestamp embedded into the hashed-subpackets.
out_sig64-byte output (R || S).
Returns
true on success.

Definition at line 593 of file xsig.cpp.

References CDC_CURVE_ED25519, cdc::mod_gpg::gpg_status_t::curve, cdc::hal::getSecureElementInstance(), gpg_get_status(), gpg_storage_sig_slot(), LOG_W, cdc::hal::OK, OPENPGP_ALGO_ECDSA, OPENPGP_ALGO_EDDSA, TAG, and cdc::mod_gpg::gpg_recv_key_t::user_id.

Referenced by cmd_gpg_recv_cross_sign(), gpgBuildOwnSignedKeyArmored(), gpgBuildOwnSubkeyMaterial(), and onReceivedSignConfirm().

◆ gpgCrossSignDigest()

bool cdc::mod_gpg::gpgCrossSignDigest ( const uint8_t fp_v4[20],
const char * user_id,
uint8_t out_hash[32] )

Build the digest input for a cross-signature.

Per docs/CROSS_SIGNING.md: data = fp_v4 (20 B) || user_id padded with zeros to 64 B hash = SHA-256(data)

Definition at line 188 of file fingerprint.cpp.

References user_id.

◆ gpgParseCertPayload()

bool cdc::mod_gpg::gpgParseCertPayload ( const uint8_t * data,
size_t len,
gpg_self_cert_t * out,
uint8_t out_target_fp[20] )

Parse a certification return message into a self-cert record.

Parameters
dataPayload bytes.
lenPayload length.
outOutput self-cert record (zeroed on entry, received_at stamped).
out_target_fp20-byte buffer receiving the certified-key fingerprint.
Returns
true on a well-formed payload, otherwise false.

Definition at line 45 of file GpgCertPayload.cpp.

References cdc::mod_gpg::gpg_self_cert_t::issuer_fp_v4, cdc::mod_gpg::gpg_self_cert_t::issuer_uid, kGpgCertPayloadMin, kGpgSelfCertSigMax, cdc::mod_gpg::gpg_self_cert_t::received_at, cdc::mod_gpg::gpg_self_cert_t::sig_pkt, and cdc::mod_gpg::gpg_self_cert_t::sig_pkt_len.

Referenced by cmd_gpg_mycert_import(), and deliverGpgCert().

◆ gpgParseKeyPayload()

◆ makeMenuItem()

ui::ListItem cdc::mod_gpg::makeMenuItem ( const char * label,
GpgMenuAction action )
inlinestatic

Definition at line 632 of file GpgModule.cpp.

Referenced by rebuildMenu().

◆ onGpgPinComplete()

void cdc::mod_gpg::onGpgPinComplete ( bool )
static

Pin-change completion callback returning to previous view.

Parameters
changedResult flag (unused).

Definition at line 730 of file GpgModule.cpp.

References cdc::ui::ViewStack::instance(), and cdc::ui::ViewStack::pop().

Referenced by onSettingsSelect().

◆ onMenuSelect()

void cdc::mod_gpg::onMenuSelect ( uint16_t ,
void * userData )
static

◆ onMyCertDeleteConfirm()

◆ onMyCertListSelect()

◆ onReceivedActionSelect()

◆ onReceivedDeleteConfirm()

◆ onReceivedListSelect()

void cdc::mod_gpg::onReceivedListSelect ( uint16_t index,
void * userData )
static

◆ onReceivedSignConfirm()

◆ onResetConfirm()

void cdc::mod_gpg::onResetConfirm ( void * )
static

Confirm callback resetting all GPG key material.

Parameters
userDataOptional callback context (unused).

Definition at line 947 of file GpgModule.cpp.

References gpg_reset(), cdc::ui::showToastError(), cdc::ui::showToastSuccess(), and cdc::ui::tr().

Referenced by confirmReset().

◆ onSettingsSelect()

void cdc::mod_gpg::onSettingsSelect ( uint16_t index,
void *  )
static

◆ onWizardCurve()

void cdc::mod_gpg::onWizardCurve ( uint16_t index,
void *  )
static

Finalizes wizard curve selection and triggers key generation.

Parameters
indexSelected curve index.
userDataOptional callback context (unused).

Definition at line 867 of file GpgModule.cpp.

References CDC_CURVE_ED25519, CDC_CURVE_P256, gpg_generate_key(), gpg_set_pending_user_id(), GPG_USER_ID_MAX, cdc::ui::ViewStack::instance(), cdc::ui::ViewStack::popToAnchor(), s_menuView, s_wizard, cdc::ui::showToastError(), cdc::ui::showToastSuccess(), cdc::ui::tr(), and user_id.

Referenced by onWizardEmail().

◆ onWizardEmail()

void cdc::mod_gpg::onWizardEmail ( const char * text)
static

Saves wizard email and opens curve selection.

Parameters
textEntered email.

Definition at line 849 of file GpgModule.cpp.

References cdc::ui::ViewStack::instance(), cdc::ui::ListItem::label, onWizardCurve(), cdc::ui::ViewStack::push(), s_curveView, s_wizard, and cdc::ui::tr().

Referenced by onWizardName().

◆ onWizardName()

void cdc::mod_gpg::onWizardName ( const char * text)
static

Saves wizard name and opens email step.

Parameters
textEntered name.

Definition at line 838 of file GpgModule.cpp.

References cdc::ui::ViewStack::instance(), onWizardEmail(), cdc::ui::ViewStack::push(), s_t9Input, s_wizard, and cdc::ui::tr().

Referenced by wizardStart().

◆ parse_hex()

bool cdc::mod_gpg::parse_hex ( const char * args,
uint8_t * out,
size_t out_cap,
size_t * out_len )
static

Decode an ASCII-hex string into out. Skips ASCII whitespace between bytes.

Definition at line 481 of file GpgModule.cpp.

Referenced by cmd_gpg_mycert_import(), and cmd_gpg_recv_import().

◆ parse_index()

bool cdc::mod_gpg::parse_index ( const char * args,
uint8_t * out )
static

◆ rebuildMenu()

void cdc::mod_gpg::rebuildMenu ( )
static

◆ rebuildMyCertList()

◆ rebuildReceivedList()

◆ registerCommands()

void cdc::mod_gpg::registerCommands ( )
static

Registers serial commands exposed by GPG module.

Definition at line 192 of file GpgModule.cpp.

References cmd_gpg(), CMD_MODULE, cdc::serial::getCommandRegistry(), kGpgSubs, and s_commandsRegistered.

Referenced by cdc::mod_gpg::GpgModule::init().

◆ registerStrings()

void cdc::mod_gpg::registerStrings ( )
static

◆ showExport()

◆ showMyCertifications()

void cdc::mod_gpg::showMyCertifications ( )
static

◆ showReceivedDetail()

◆ showReceivedKeys()

void cdc::mod_gpg::showReceivedKeys ( )
static

◆ showSendKey()

void cdc::mod_gpg::showSendKey ( )
static

◆ showSettings()

◆ showStatus()

◆ wizardStart()

void cdc::mod_gpg::wizardStart ( )
static

Starts key-generation wizard flow.

Definition at line 827 of file GpgModule.cpp.

References cdc::ui::ViewStack::instance(), onWizardName(), cdc::ui::ViewStack::push(), s_t9Input, s_wizard, and cdc::ui::tr().

Referenced by onMenuSelect().

Variable Documentation

◆ CMD_MODULE

const char* cdc::mod_gpg::CMD_MODULE = "gpg"
staticconstexpr

Definition at line 149 of file GpgModule.cpp.

Referenced by registerCommands().

◆ kGpgCertMime

const char* cdc::mod_gpg::kGpgCertMime = "application/pgp-signature"
staticconstexpr

MIME type for badge-to-badge certification return messages over cdc_msg.

Definition at line 117 of file GpgModule.cpp.

Referenced by cdc::mod_gpg::GpgModule::init(), onReceivedActionSelect(), and cdc::mod_gpg::GpgModule::stop().

◆ kGpgCertPayloadMax

size_t cdc::mod_gpg::kGpgCertPayloadMax = 20 + 20 + 1 + 63 + 2 + kGpgSelfCertSigMax
constexpr

Maximum payload size (maximum issuer uid + maximum signature packet).

Definition at line 28 of file GpgCertPayload.h.

Referenced by cmd_gpg_mycert_import(), and onReceivedActionSelect().

◆ kGpgCertPayloadMin

size_t cdc::mod_gpg::kGpgCertPayloadMin = 20 + 20 + 1 + 2 + 1
constexpr

Minimum payload size (empty issuer uid, 1-byte signature packet).

Definition at line 26 of file GpgCertPayload.h.

Referenced by gpgParseCertPayload().

◆ kGpgKeyDecBlock

size_t cdc::mod_gpg::kGpgKeyDecBlock = 4 + 64 + 64 + 64
constexpr

Fixed-size trailing DEC encryption-subkey block.

Definition at line 30 of file GpgKeyPayload.h.

Referenced by gpgBuildOwnKeyPayload(), gpgBuildRecvKeyPayload(), and gpgParseKeyPayload().

◆ kGpgKeyMime

const char* cdc::mod_gpg::kGpgKeyMime = "application/pgp-keys"
staticconstexpr

MIME type for badge-to-badge public-key transfer over cdc_msg.

Definition at line 92 of file GpgModule.cpp.

Referenced by cdc::mod_gpg::GpgModule::init(), onReceivedActionSelect(), showSendKey(), and cdc::mod_gpg::GpgModule::stop().

◆ kGpgKeyPayloadMax

size_t cdc::mod_gpg::kGpgKeyPayloadMax = 1 + 1 + 64 + 4 + 20 + 1 + 63 + kGpgKeyDecBlock
constexpr

Maximum payload size (P-256 + maximum user id + DEC block).

Definition at line 34 of file GpgKeyPayload.h.

Referenced by cmd_gpg_recv_import(), onReceivedActionSelect(), and showSendKey().

◆ kGpgKeyPayloadMin

size_t cdc::mod_gpg::kGpgKeyPayloadMin = 1 + 1 + 32 + 4 + 20 + 1 + 1 + kGpgKeyDecBlock
constexpr

Minimum payload size (Ed25519 + empty user id + DEC block).

Definition at line 32 of file GpgKeyPayload.h.

Referenced by gpgParseKeyPayload().

◆ kGpgRecvFlagVerified

uint8_t cdc::mod_gpg::kGpgRecvFlagVerified = 0x01
constexpr

Definition at line 8 of file GpgRecvStore.h.

Referenced by cmd_gpg_recv_cross_sign(), cmd_gpg_recv_info(), and onReceivedSignConfirm().

◆ kGpgSelfCertSigMax

size_t cdc::mod_gpg::kGpgSelfCertSigMax = 160
constexpr

Maximum length of a stored certification signature packet body (Tag 2).

Definition at line 9 of file GpgSelfCertStore.h.

Referenced by cdc::mod_gpg::GpgSelfCertStore::addCert(), gpgBuildCertPayload(), gpgBuildOwnSignedKeyArmored(), and gpgParseCertPayload().

◆ kGpgSubs

const cdc::serial::SubCommand cdc::mod_gpg::kGpgSubs[]
static
Initial value:
= {
{"STATUS", "", "Show keys, fingerprints, counters", cmd_gpg_status},
{"GENERATE", "<curve> <user_id>", "Generate SIG+DEC+AUT keys (curve 1=Ed25519, 2=P-256)", cmd_gpg_generate},
{"EXPORT", "", "Print own OpenPGP public key (armored, with certifications)", cmd_gpg_export},
{"RESET", "[token]", "Two-step destructive reset of all GPG keys", cmd_gpg_reset},
{"RECV_LIST", "", "List public keys received from peers", cmd_gpg_recv_list},
{"RECV_INFO", "<index>", "Show a received peer key's details", cmd_gpg_recv_info},
{"RECV_DELETE", "<index>", "Delete a received peer key", cmd_gpg_recv_delete},
{"RECV_IMPORT", "<hex>", "Import a peer key wire payload (hex) into the received store", cmd_gpg_recv_import},
{"RECV_CROSS_SIGN", "<index>", "Cross-sign a received peer key with our signature key", cmd_gpg_recv_cross_sign},
{"RECV_EXPORT", "<index>", "Export a received peer key (armored, encryptable; adds our cross-signature if present)", cmd_gpg_recv_export},
{"MYCERT_LIST", "", "List third-party certifications collected on the own key", cmd_gpg_mycert_list},
{"MYCERT_DELETE", "<index>", "Delete a stored certification on the own key", cmd_gpg_mycert_delete},
{"MYCERT_IMPORT", "<hex>", "Import a certification return payload (hex) onto the own key", cmd_gpg_mycert_import},
{"RSA_SELFTEST", "[bits]", "Software RSA self-test (gen/sign/verify/decrypt), default 2048", cmd_gpg_rsa_selftest},
{nullptr, nullptr, nullptr, nullptr},
}
static void cmd_gpg_rsa_selftest(const char *args)
Serial self-test: runs the software RSA round-trip on the live firmware (no SE / NVS),...
static void cmd_gpg_recv_info(const char *args)
static void cmd_gpg_recv_cross_sign(const char *args)
static void cmd_gpg_status(const char *args)
Serial command printing current GPG key status.
static void cmd_gpg_mycert_delete(const char *args)
static void cmd_gpg_recv_list(const char *args)
static void cmd_gpg_recv_delete(const char *args)
static void cmd_gpg_recv_import(const char *args)
static void cmd_gpg_recv_export(const char *args)
static void cmd_gpg_export(const char *args)
Serial command exporting GPG public key in PEM format.
static void cmd_gpg_reset(const char *args)
static void cmd_gpg_mycert_list(const char *args)
static void cmd_gpg_mycert_import(const char *args)
static void cmd_gpg_generate(const char *args)
Serial command generating GPG key with selected curve and user-id.

Definition at line 167 of file GpgModule.cpp.

Referenced by cmd_gpg(), and registerCommands().

◆ kStrings

ui::I18nEntry cdc::mod_gpg::kStrings[]
constexpr

Definition at line 45 of file GpgModule.cpp.

Referenced by registerStrings().

◆ RESET_TOKEN_TIMEOUT_US

uint64_t cdc::mod_gpg::RESET_TOKEN_TIMEOUT_US = 30ULL * 1000ULL * 1000ULL
staticconstexpr

Definition at line 279 of file GpgModule.cpp.

Referenced by cmd_gpg_reset().

◆ s_adminPinLabel

char cdc::mod_gpg::s_adminPinLabel[48]
static

Definition at line 759 of file GpgModule.cpp.

Referenced by showSettings().

◆ s_commandsRegistered

bool cdc::mod_gpg::s_commandsRegistered = false
static

Definition at line 150 of file GpgModule.cpp.

Referenced by registerCommands().

◆ s_curveView

ui::ListView cdc::mod_gpg::s_curveView
static

Definition at line 576 of file GpgModule.cpp.

Referenced by onWizardEmail().

◆ s_infoView

ui::InfoView cdc::mod_gpg::s_infoView
static

◆ s_menuItems

ui::ListItem cdc::mod_gpg::s_menuItems[8] = {}
static

Definition at line 580 of file GpgModule.cpp.

Referenced by rebuildMenu().

◆ s_menuView

ui::ListView cdc::mod_gpg::s_menuView
static

◆ s_myCertDetailText

char cdc::mod_gpg::s_myCertDetailText[320]
static

Definition at line 1187 of file GpgModule.cpp.

Referenced by onMyCertListSelect().

◆ s_myCertLabels

char cdc::mod_gpg::s_myCertLabels[GpgSelfCertStore::kMaxCerts][72]
static

Definition at line 1184 of file GpgModule.cpp.

Referenced by rebuildMyCertList().

◆ s_myCertListItems

ui::ListItem cdc::mod_gpg::s_myCertListItems[GpgSelfCertStore::kMaxCerts+1]
static

Definition at line 1183 of file GpgModule.cpp.

Referenced by rebuildMyCertList().

◆ s_myCertListView

ui::ListView cdc::mod_gpg::s_myCertListView
static

My-certifications (third-party signatures on our own key) UI state.

Definition at line 1182 of file GpgModule.cpp.

Referenced by rebuildMyCertList(), and showMyCertifications().

◆ s_myCertSelected

gpg_self_cert_t cdc::mod_gpg::s_myCertSelected = {}
static

Definition at line 1186 of file GpgModule.cpp.

Referenced by onMyCertListSelect().

◆ s_myCertSelectedIndex

uint8_t cdc::mod_gpg::s_myCertSelectedIndex = 0
static

Definition at line 1185 of file GpgModule.cpp.

Referenced by onMyCertDeleteConfirm(), and onMyCertListSelect().

◆ s_pinChangeView

ui::PinChangeView cdc::mod_gpg::s_pinChangeView
static

Definition at line 574 of file GpgModule.cpp.

Referenced by onSettingsSelect().

◆ s_qrView

ui::QRCodeView cdc::mod_gpg::s_qrView
static

Definition at line 578 of file GpgModule.cpp.

Referenced by onReceivedActionSelect(), and showExport().

◆ s_recvActionItems

ui::ListItem cdc::mod_gpg::s_recvActionItems[6]
static

Definition at line 969 of file GpgModule.cpp.

Referenced by showReceivedDetail().

◆ s_recvActionView

ui::ListView cdc::mod_gpg::s_recvActionView
static

Definition at line 967 of file GpgModule.cpp.

Referenced by showReceivedDetail().

◆ s_recvDetailText

char cdc::mod_gpg::s_recvDetailText[640]
static

Definition at line 973 of file GpgModule.cpp.

Referenced by showReceivedDetail().

◆ s_recvExportBuf

char cdc::mod_gpg::s_recvExportBuf[4096]
static

Definition at line 974 of file GpgModule.cpp.

Referenced by onReceivedActionSelect().

◆ s_recvListItems

ui::ListItem cdc::mod_gpg::s_recvListItems[GpgRecvStore::kMaxKeys+1]
static

Definition at line 968 of file GpgModule.cpp.

Referenced by rebuildReceivedList().

◆ s_recvListLabels

char cdc::mod_gpg::s_recvListLabels[GpgRecvStore::kMaxKeys][72]
static

Definition at line 970 of file GpgModule.cpp.

Referenced by rebuildReceivedList().

◆ s_recvListView

ui::ListView cdc::mod_gpg::s_recvListView
static

Received-keys list UI state.

Definition at line 966 of file GpgModule.cpp.

Referenced by rebuildReceivedList(), and showReceivedKeys().

◆ s_recvSelectedIndex

uint8_t cdc::mod_gpg::s_recvSelectedIndex = 0
static

◆ s_recvSelectedKey

gpg_recv_key_t cdc::mod_gpg::s_recvSelectedKey = {}
static

◆ s_reset_token

char cdc::mod_gpg::s_reset_token[7] = {}
static

Serial command resetting GPG key material.

Parameters
argsUnused command arguments.

Definition at line 277 of file GpgModule.cpp.

Referenced by cmd_gpg_reset().

◆ s_reset_token_ts_us

uint64_t cdc::mod_gpg::s_reset_token_ts_us = 0
static

Definition at line 278 of file GpgModule.cpp.

Referenced by cmd_gpg_reset().

◆ s_settingsItems

ui::ListItem cdc::mod_gpg::s_settingsItems[]
static
Initial value:
= {
{ nullptr, 0, false, nullptr },
{ nullptr, 0, false, nullptr },
}

Definition at line 581 of file GpgModule.cpp.

Referenced by showSettings().

◆ s_settingsView

ui::ListView cdc::mod_gpg::s_settingsView
static

Definition at line 573 of file GpgModule.cpp.

Referenced by showSettings().

◆ s_t9Input

ui::T9InputView cdc::mod_gpg::s_t9Input
static

Definition at line 575 of file GpgModule.cpp.

Referenced by onWizardName(), and wizardStart().

◆ s_userPinLabel

char cdc::mod_gpg::s_userPinLabel[48]
static

Definition at line 758 of file GpgModule.cpp.

Referenced by showSettings().

◆ s_viewsInitialized

bool cdc::mod_gpg::s_viewsInitialized = false
static

Definition at line 579 of file GpgModule.cpp.

Referenced by cdc::mod_gpg::GpgModule::getMenuItems().

◆ s_wizard

WizardState cdc::mod_gpg::s_wizard = {}
static

Definition at line 592 of file GpgModule.cpp.

Referenced by onWizardCurve(), onWizardEmail(), onWizardName(), and wizardStart().