You are reading content from Scuttlebutt
@aljoscha %8C4muzwvOywlOEeK4UFgsikK5OT8+Tk9BdkGrcX+gsk=.sha256
Re: %ZBzVJhKOY

Dev Diary 04/10/2018

Today was somewhat grindy, chasing a lot of errors.

Fuzzers are magical, this is all the test code I wrote to weed out errors in the json parser:

#![no_main]
#[macro_use]
extern crate libfuzzer_sys;
extern crate ssb_legacy_msg;

use ssb_legacy_msg::json::{from_slice, Value, to_vec};

fuzz_target!(|data: &[u8]| {
    match from_slice::<Value>(data) {
        Ok(val) => {
            let sign_json = to_vec(&val, true);
            let redecoded = from_slice::<Value>(&sign_json[..]).unwrap();
            assert_eq!(val, redecoded);
        }
        Err(_) => {}
    }
});

Next steps:

  • fix the remaining errors so that the rs implementation is compliant with the js one
  • a lot more fuzzing, then minimize the corpus, generate test data, and publish a test suite
  • decide on an order in which to do the remaining legacy message work:
    • spec and impl json metadata
    • clean up the code
    • clean up the specs
    • define and implement cbor encoding for legacy messages
    • js bindings?
Join Scuttlebutt now