INNER CODE UNIT · Rust

CONFIG_LOCK_TLV_LEN

TheMaxMur/RS-Key · crates/rsk-devconf/src/lib.rs:119

const CONFIG_LOCK_TLV_LEN: usize = 2 + 1;

/// Build the READ CONFIG TLV: a leading overall-length byte, then
/// USB_SUPPORTED / SERIAL / FORM_FACTOR / VERSION, then either the persisted
/// `EF_DEV_CONF` blob or the default USB_ENABLED / DEVICE_FLAGS / CONFIG_LOCK
/// tail. Public because the OTP applet serves the same TLV (P1=0x13).
pub fn config_tlv<S: Storage>(serial: &[u8; 4], fs: &mut Fs<S>, res: &mut ResBuf) -> Sw {
    let mut buf = [0u8; 128];
    let mut n = 1; // byte 0 = overall length, filled at the end.

    push_tlv(
        &mut buf,
        &mut n,
        TAG_USB_SUPPORTED,
        &SUPPORTED_CAPS.to_be_bytes(),
    );
    push_tlv(&mut buf, &mut n, TAG_SERIAL, serial);
    push_tlv(

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…