theupdateframework / rust-tuf

Rust implementation of The Update Framework (TUF)
https://crates.io/crates/tuf
Apache License 2.0
174 stars 32 forks source link

Upstream changes to canonical_json #3

Closed heartsucker closed 7 years ago

heartsucker commented 7 years ago

Remove the file cjson.rs once the crate canonical_json supports serde >= 0.9.

heartsucker commented 7 years ago

As noted in f95bc52, the canonicalize function is borked for input that actually uses the escapes. It's fine for testing because we're just putting in simple strings, but this crate is totally unsuitable for real world use until this gets fixed.

heartsucker commented 7 years ago

Removing this from the 0.1.0 milestone because so far thing "just work" somehow. I think a prelim version could ship without this fix and we'll wait on a bug report since this seems to be a pain to implement.

heartsucker commented 7 years ago

It turns out this does work and the only reason it seemed buggy was because the python lib canonicaljson does incorrect encoding. This gave the impression that test cases were valid and the code was wrong when in reality the test cases were invalid and the code was (mostly) correct.

heartsucker commented 7 years ago

Closing this since it seems that 1) the canonical_json is abandoned, and 2) we don't need to deserialize cjson, just convert regular json to it. This minimizes the dependencies, and the bits that exist in the code currently are sufficient.