Commit Graph
339 Commits
Author SHA1 Message Date
Suyog Tandel afb316e41b feat: add wiki button in about screen and update application description v0.7.0 2026-07-19 22:36:24 +05:30
Suyog Tandel dfc11b5770 merge:PR 103 that adds RS-Key firmware support and fixes bugs 2026-07-19 22:14:10 +05:30
Maxim Muravev 6cc2a64645 fmt: Run cargo fmt 2026-07-19 18:52:39 +03:00
Maxim Muravev a8ab4b7c09 feat(ui): auto-detect device hot-plug and refresh live
A ~1s background watcher on DeviceRepo samples a cheap FIDO HID presence
fingerprint (vid:pid:serial, by enumeration only — it never opens the
device, so it can't contend with an in-flight read or write) and triggers
a refresh whenever the key is plugged, unplugged or swapped. Every screen
then reflects the current device without the manual Refresh button. The
watcher skips a tick while a refresh/write is in flight and stops cleanly
when the repo is dropped.
2026-07-19 18:35:58 +03:00
Maxim Muravev 1f7a6b0d92 fix: correctly read and write RS-Key device configuration
Several Configuration-screen fields were blank, wrong, or silently
overwrote a working device on save when talking to RS-Key firmware:

- CONFIG_READ over CTAPHID 0x41 answers with a CBOR `{1: blob}` map, but
  the client fed the raw CBOR bytes downstream. The PHY read only worked
  by accident for records under 24 bytes and broke once a product name
  pushed it over; the LED read never worked. Decode the map and return
  the inner record.
- Parse the LED status block at the correct stride ((len-1)/4) in one
  shared helper, fixing the CCID path that read a 17-byte block as a
  legacy 9-byte one (colour shown as the effect id).
- Read hardware LED (GPIO/brightness/driver) and touch-timeout as
  optionals: an absent phy tag now means "firmware default" (blank
  field) and is not written back, so a virgin phy is no longer clobbered
  with GPIO=0 / driver=Pico / brightness=0 on the next Apply. A value is
  written only when the user sets one.
- Hide the "Supported Curves" card for RS-Key: its firmware ignores the
  phy ENABLED_CURVES tag (curve support is compile-time), so the toggles
  were a no-op that also wrote a meaningless tag on save.
- Preserve each status' LED effect/speed on a colour write (read-modify-
  write), reject over-long product names, read the enabled USB apps over
  the 0xC2 vendor command, and fall back to the USB product string when
  the phy record carries no product override.
2026-07-19 18:35:57 +03:00
Maxim Muravev e5b2219679 fix(hal): open the FIDO HID non-exclusively on macOS
macOS holds FIDO-usage-page (0xF1D0) HID devices exclusively, so hidapi's
default open fails with 0xE00002C5 ("exclusive access and device already
open") and the entire FIDO transport is unreachable. GetInfo, the VID/PID
seed and hardware-config-over-FIDO then silently fall back to rescue-only,
leaving the Configuration screen blank on an otherwise healthy key.

Enable hidapi's `macos-shared-device` feature so opens go through
hid_darwin_set_open_exclusive(0). No-op on Linux/Windows; hidapi 2.6
explicitly allows several concurrent HidApi contexts.
2026-07-19 18:33:39 +03:00
Suyog Tandel fd0752b152 chore: make UI more responsive and more wide 2026-07-19 16:44:43 +05:30
Suyog TandelandGitHub ef51114758 Merge pull request #101 from librekeys/build/update-nix-package
build(package.nix): update
2026-07-12 16:16:12 +05:30
github-actions[bot] 6faa63f00b picoforge: 0.5.0+1 -> 0.6.0
Diff: https://github.com/librekeys/picoforge/compare/v0.5.0+1...v0.6.0

Changelog: https://github.com/librekeys/picoforge/releases/tag/v0.6.0
2026-07-12 03:20:34 +00:00
Suyog Tandel 0e9ca1a8c3 chore: automate spec sync via PRs and update release workflow 2026-07-10 19:47:15 +05:30
Suyog Tandel f72c5fc45d fix(ci): security audit issues 2026-07-09 23:18:45 +05:30
Suyog Tandel e8f379a248 fix(ci): add write perms to code CI workflow for security audit step 2026-07-09 22:51:24 +05:30
Suyog Tandel 86dfa606aa chore: rename local variables across UI module for readability
- dialog.rs: pin entity/text bindings (current/new/confirm)
- config/view_model.rs: entity→weak_self, parsed_gpio/driver_value, new_* form fields
- config/view.rs: fido_no_rskey→is_fido_no_rskey
- passkeys/view_model.rs: entity→weak_self, new→new_pin_value, s→submit_clone/status_content
- passkeys/view.rs: ep_set→enterprise_attestation_set
- home/view.rs: rk→resident_keys_supported, ep_set→enterprise_attestation_set
- sidebar.rs: t→padding_anim_t
- ci.yml: fix audit-check short SHA→full SHA
2026-07-09 22:42:53 +05:30
Suyog Tandel c24999d3a4 refactor(hal): rename variables for clarity and extract format_firmware_version helper
- fido/mod.rs: extract format_firmware_version, rename v→entry, s→error_text,
  val→field_data in TLV parsers
- fido/ops.rs: rename auth_x/y→auth_point_x/y, rng→system_rng, err_str→error_string
- rescue/ops.rs: rename rx_*→*_response, rdr→cursor, i→offset, val→field_data,
  opts_val→options_raw, curves_val→raw_curves_value
- rescue/constants.rs: rename val→tag_value/color_value in from_u8 methods
- transport/fido.rs: rename drain_buf→stale_packet_buffer, buf→packet_buf,
  start_time→deadline_start, status→keepalive_status/ctap_status_byte
- firmwares/mod.rs: rename fw_type→firmware_variant, ver→firmware_version
2026-07-09 21:48:12 +05:30
Suyog Tandel a43f840a1a fix(ci): codeql build failure and securiy audit node 20 deprecation 2026-07-09 20:56:28 +05:30
Suyog Tandel fa96a849f6 fix(ci): docs workflow deps step missing 2026-07-09 20:45:31 +05:30
Suyog Tandel 2707ff6602 fix: codebase formatting 2026-07-09 20:34:13 +05:30
Suyog Tandel c272e148da fix: replace manual and_then/filter pattern with Option::filter
Fixes clippy::manual_filter lint on Rust 1.97 (CI), while
keeping compatibility with 1.96 (local).
2026-07-09 20:29:12 +05:30
Suyog Tandel 8a769bc169 ci: replace Nix with rust-toolchain, add audit-check and CodeQL jobs
- Switch `checks` and docs jobs from Nix to dtolnay/rust-toolchain +
  Swatinem/rust-cache + apt system deps for faster setup
- Add dependency vulnerability scanning via rustsec/audit-check@v2.0.0
- Add CodeQL static analysis via github/codeql-action@v4 (manual build)
2026-07-09 20:22:32 +05:30
Suyog Tandel 5121bb011d feat: RS-Key curve selection card, transport priority fix, RescueCurves re-export
- Reversed transport priority: PCSC/Rescue preferred over FIDO
- Added `RescueCurves` bitflags re-export to `hal/types.rs`
- Replaced single secp256k1 toggle with full "Supported Curves" card
  (11 curves) gated on RS-Key, with mask-building in apply_changes
- Updated FIDO/Rescue write status messages to match transport behavior
- Cleaned up device status display (green "Online" for RS-Key)

Changes: src/ui/screens/config/view.rs, view_model.rs, hal/io.rs, hal/transport/mod.rs, hal/types.rs.
2026-07-09 00:04:38 +05:30
Suyog TandelandGitHub 8ad80adbc3 Merge pull request #100 from librekeys/feat/rskey-0.3.1-support
feat: RSKey v0.3.x support and refactor hal module
2026-07-08 23:07:53 +05:30
Suyog Tandel 20c56d947d docs: add module/item docs across all 43 source files and enable #![deny(missing_docs)]
- Add //! module-level headers and /// item-level docs to every source file
- Fix unresolved doc links in hal/mod.rs, ui/mod.rs, transport/pcsc.rs, transport/fido.rs
- Add #![deny(missing_docs)] at crate root to enforce doc completeness in CI
2026-07-08 22:57:20 +05:30
Suyog Tandel 423b5ae470 refactor(hal): extract transport layer and split rescue/fido ops
- Move HidTransport from hal/fido/hid.rs to hal/transport/fido.rs
- Add PcscTransport in hal/transport/pcsc.rs for CCID communication
- Refactor DeviceHandle::Rescue to hold PcscTransport instead of bare FirmwareType
- Split monolithic rescue/mod.rs into high-level interface and ops.rs with APDU logic
- Rename hal/fido/hid.rs → hal/fido/ops.rs (FidoOperations), depend on transport::fido
- Update FIDO config-write capability checks with more specific trait methods
- Fix all import paths in hal/io.rs and ui/models/device.rs
2026-07-08 22:20:35 +05:30
Suyog Tandel c76b059ae6 feat(hal): introduce RS-Key(0.3.x) support and FirmwareTrait architecture
This commit significantly refactors the HAL layer to introduce proper support for the RS-Key firmware and abstraction across different hardware profiles
  (PicoFido, RSKey, LkOne).

    Key changes include:
    - **Firmware Abstraction**: Added `FirmwareTrait` and `AnyFirmware` in `src/hal/firmwares/mod.rs` with specific implementations for `PicoFidoFirmware` and
  `RSKeyFirmware` to decouple hardware-specific logic from the high-level `io.rs` layer.
    - **RS-Key FIDO Support**: Implemented RS-Key payload logic in `src/hal/fido/mod.rs` to support reading/writing LED configuration and DEV_CONF directly over
  the CTAPHID FIDO transport using TLV and custom command targets.
    - **Constants Cleanup**: Stripped out and consolidated 200+ lines of raw CTAP2 constants and vendor opcodes from `src/hal/fido/constants.rs` to clean up the
  module.
    - **UI & PIN Dialogs**: Updated `src/ui/screens/config/view_model.rs` to route `DeviceMethod` correctly when applying configurations. Added
  `StatusDialogHandle` integration to prompt the user for their FIDO PIN and instruct them to "Please touch your device if it flashes" when performing hardware
  config writes over FIDO.
    - **LkOne Type**: Added the `LkOne` AAGUID and firmware types to the hardware definition tree.
    - **Home View Check**: Fixed a UI issue in `home/view.rs` to conditionally display the LED config card based on whether the `FirmwareType` actually supports
  FIDO config modifications (like RS-Key).

    This lays the architectural foundation needed to handle FIDO configurations dynamically based on the discovered firmware type.
2026-07-08 21:14:55 +05:30
Suyog Tandel b293e294f5 feat: refactor hal module architecture and add tests in fido module 2026-07-07 01:23:26 +05:30