You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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:
let signed_root = parse_signed_root(bytes_from_network)?;let root = ifverify(signed_root){parse_root(signed_root.signed)?
}else{returnErr("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.
The text was updated successfully, but these errors were encountered:
For what it's worth, I've been working on a "Merkelized Protobufs" format which can be bidirectionally transcoded to (T)JSON while preserving the same content hashes:
I'm not implementing anything yet, but I had to do a huge rewrite because the current API backed me into a corner. The rewrite includes support for non-JSON formats, and implementation should be trivial now that Serialize and Deserialize are correctly implemented. Work tracked in rewrite branch.
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:Followed by
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.
The text was updated successfully, but these errors were encountered: