src/backup/manifest.rs: cleanup signature generation

This commit is contained in:
Dietmar Maurer
2020-07-09 09:20:49 +02:00
parent 152a926149
commit b53f637914
3 changed files with 169 additions and 73 deletions

View File

@ -1081,16 +1081,14 @@ async fn create_backup(
}
// create manifest (index.json)
let manifest = manifest.into_json(crypt_config.as_ref().map(Arc::as_ref));
// manifests are never encrypted, but include a signature
let manifest = manifest.into_string(crypt_config.as_ref().map(Arc::as_ref))
.map_err(|err| format_err!("unable to format manifest - {}", err))?;
println!("Upload index.json to '{:?}'", repo);
let manifest = serde_json::to_string_pretty(&manifest)?.into();
// manifests are never encrypted, but include a signature
// fixme: sign manifest
client
.upload_blob_from_data(manifest, MANIFEST_BLOB_NAME, true, false)
.upload_blob_from_data(manifest.into_bytes(), MANIFEST_BLOB_NAME, true, false)
.await?;
client.finish().await?;