theupdateframework / theupdateframework/rust-tuf

Investigate use of binary protocol instead of JSON for data transfer

Open
#38 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Feature :: Improvement Flag :: Research Priority :: Low
Dominant language
Rust
Stars
198
Forks
39
Avg merge
9h 19m
Merged PRs (30d)
2

Description

A disadvantage of JSON is that in order to verify the metadata, it has to be parsed first. It would be better to use a binary protocol that lets us treat the signed field as raw bytes until after we verify it. Then, do a second round of parsing on the trusted data. For example:

message SignedRootMetadata {
  repeated Signature signature = 1;
  bytes signed = 2;   
}

message Signature {
    bytes keyid = 1;
    bytes sig = 2;
}

Followed by

let signed_root = parse_signed_root(bytes_from_network)?;
let root = if verify(signed_root) {
    parse_root(signed_root.signed)?
} else {
    return Err("oh dear")
}
// do stuff with root

Protobufs were used in the example here, but they may not be deterministic, so something like ASN.1 / DER would need to be used.

This is motivated by my dislike of parsers being allowed to work on any more untrusted data than necessary.

Contributor guide

No contributing guide indexed for this repository

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

No files, tests, or entry points are named. Start by locating the current JSON metadata parsing and signature-verification flow, then assess a deterministic binary format such as ASN.1/DER against the stated two-stage parsing goal. Done would require a decided approach and an agreed implementation scope.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
cryptography, security
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
20/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.