src/backup/data_blob.rs: new load_from_reader(), which verifies the CRC

And make verify_crc private for now. We always call load_from_reader() to
verify the CRC.

Also add load_chunk() to datastore.rs (from chunk_store::read_chunk())
This commit is contained in:
Dietmar Maurer
2020-07-28 10:23:16 +02:00
parent 69d970a658
commit 39f18b30b6
12 changed files with 58 additions and 62 deletions

View File

@ -50,8 +50,7 @@ fn verify_test_blob(mut cursor: Cursor<Vec<u8>>) -> Result<(), Error> {
let raw_data = cursor.into_inner();
let blob = DataBlob::from_raw(raw_data)?;
blob.verify_crc()?;
let blob = DataBlob::load_from_reader(&mut &raw_data[..])?;
let data = blob.decode(Some(&CRYPT_CONFIG))?;
if data != *TEST_DATA {