oxidecomputer / oxidecomputer/hubris

barcode validation

Open
#2,408 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

robustness root-of-trust
Dominant language
Rust
Stars
3.6k
Forks
239
Avg merge
1d 12h
Merged PRs (30d)
23

Description

This work started in https://github.com/oxidecomputer/hubris/issues/2187 w/ some testing to ensure we could accommodate the new v2 serial number format as prep for cosmo. The code reminded me that we already supported this new format in Hubris because we don't do any barcode filtering / validation. Barcode validation was implemented in the dice-mfg utility for FCS as our first line of defense, but not Hubris. So the work necessary to minimally support v2 SNs actually needed to be implemented in dice-mfg https://github.com/oxidecomputer/dice-util/pull/298, w/ follow on cleanup in https://github.com/oxidecomputer/dice-util/pull/307.

Hubris still needs to be able to defend itself from malformed barcodes. I did some initial work to integrate the barcode parsing library from dice-mfg here: https://github.com/flihp/hubris/tree/sn-parse-dice-mfg but the code size is unacceptably large. I had to put this work down in favor of customer stuff before I could address this but it's most likely a matter of getting rid of a number of unnecessary calls to the barcode validation logic. The direction I had intended to go next was to remove all call to the barcode validation code except for the mfg loop where we assign the barcode to the system @ mfg time. Evey time we handle the barcode after this we don't need to / shouldn't do any validation (I think).

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reviewing the barcode parsing integration from the sn-parse-dice-mfg branch and the validation logic in the dice-mfg utility. Trace every barcode-validation call and compare it with the manufacturing loop where the barcode is assigned. Done means malformed barcodes are rejected at that point without retaining unnecessary validation elsewhere, while v2 serial numbers remain supported.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
embedded-iot
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.