manifest: revert canonicalization to old behaviour

JSON keys MUST be quoted. this is a one-time break in signature
validation for backups created with the broken canonicalization code.
QEMU backups are not affected, as libproxmox-backup-qemu never linked
the broken versions.

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
This commit is contained in:
Fabian Grünbichler 2020-07-20 10:22:12 +02:00 committed by Thomas Lamprecht
parent eb13d9151a
commit 1b1110581a
1 changed files with 2 additions and 2 deletions

View File

@ -160,12 +160,12 @@ impl BackupManifest {
keys.sort();
let mut iter = keys.into_iter();
if let Some(key) = iter.next() {
output.extend(key.as_bytes());
Self::write_canonical_json(&key.into(), output)?;
output.push(b':');
Self::write_canonical_json(&map[key], output)?;
for key in iter {
output.push(b',');
output.extend(key.as_bytes());
Self::write_canonical_json(&key.into(), output)?;
output.push(b':');
Self::write_canonical_json(&map[key], output)?;
}