Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix recovery device in CLI #8747

Open
2 tasks
FirelightFlagboy opened this issue Oct 17, 2024 · 1 comment
Open
2 tasks

Fix recovery device in CLI #8747

FirelightFlagboy opened this issue Oct 17, 2024 · 1 comment
Assignees
Labels
A-Client Area: Parsec desktop application C-Bug Issue related to a bug I-CLI Impact: Command-line interface I-Rust Impact: Rust-related stuff

Comments

@FirelightFlagboy
Copy link
Contributor

parsec-cli appear to use the recovery device mechanism the intended way.

Currently way creating a recovery device, it use the current device without creating a new device.
And when importing the recovery device, we import the device as is without using it to create a new device.

The shamir (wip) system behave like intended and we could reuse some part to fix the issues:

  • When creating a shamir device:

    let recovery_device = LocalDevice::generate_new_device(
    certificate_ops.device.organization_addr.clone(),
    certificate_ops.device.initial_profile,
    certificate_ops.device.human_handle.clone(),
    DeviceLabel::try_from(
    format!(
    "recovery-{timestamp}-{}",
    u32::from_be_bytes(brief[..4].try_into().expect("u32 from 4 u8 should be ok"))
    )
    .as_str(),
    )
    .expect("Invalid device label"),
    Some(certificate_ops.device.user_id),
    None,
    None,
    None,
    None,
    );

  • When importing a shamir device:

    let (device_certificate, redacted_device_certificate) =
    create_new_device(recovery_device, certificate_ops.device.clone(), timestamp);
    match certificate_ops
    .cmds
    .send(device_create::Req {
    device_certificate,
    redacted_device_certificate,
    })
    .await?

TODOs

  • [CLI] Create a dedicated device when creating a recovery device
  • [CLI] Create a dedicated device when importing a recovery device
@FirelightFlagboy FirelightFlagboy added A-Client Area: Parsec desktop application C-Bug Issue related to a bug I-CLI Impact: Command-line interface I-Rust Impact: Rust-related stuff labels Oct 17, 2024
@NicoTuxx
Copy link
Contributor

related to #8585

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-Client Area: Parsec desktop application C-Bug Issue related to a bug I-CLI Impact: Command-line interface I-Rust Impact: Rust-related stuff
Projects
None yet
Development

No branches or pull requests

3 participants