From: "Fabian Grünbichler" <f.gruenbichler@proxmox.com>
To: pbs-devel@lists.proxmox.com
Subject: [pbs-devel] [PATCH proxmox-backup 1/2] manifest: revert canonicalization to old behaviour
Date: Mon, 20 Jul 2020 10:22:12 +0200 [thread overview]
Message-ID: <20200720082213.1246052-1-f.gruenbichler@proxmox.com> (raw)
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>
---
Note: after this has been applied and proxmox-backup has been bumped,
libproxmox-backup-qemu needs to be be re-built with the new code and
bumped for restore to work again.
src/backup/manifest.rs | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backup/manifest.rs b/src/backup/manifest.rs
index 2ee3d440..f90f1159 100644
--- a/src/backup/manifest.rs
+++ b/src/backup/manifest.rs
@@ -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)?;
}
--
2.20.1
next reply other threads:[~2020-07-20 8:22 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-07-20 8:22 Fabian Grünbichler [this message]
2020-07-20 8:22 ` [pbs-devel] [PATCH proxmox-backup 2/2] build: run tests on build (again) Fabian Grünbichler
2020-07-20 10:00 ` [pbs-devel] applied-series: [PATCH proxmox-backup 1/2] manifest: revert canonicalization to old behaviour Thomas Lamprecht
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20200720082213.1246052-1-f.gruenbichler@proxmox.com \
--to=f.gruenbichler@proxmox.com \
--cc=pbs-devel@lists.proxmox.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox