public inbox for pbs-devel@lists.proxmox.com
 help / color / mirror / Atom feed
* [pbs-devel] [PATCH proxmox-backup 1/2] manifest: revert canonicalization to old behaviour
@ 2020-07-20  8:22 Fabian Grünbichler
  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
  0 siblings, 2 replies; 3+ messages in thread
From: Fabian Grünbichler @ 2020-07-20  8:22 UTC (permalink / raw)
  To: pbs-devel

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





^ permalink raw reply	[flat|nested] 3+ messages in thread

* [pbs-devel] [PATCH proxmox-backup 2/2] build: run tests on build (again)
  2020-07-20  8:22 [pbs-devel] [PATCH proxmox-backup 1/2] manifest: revert canonicalization to old behaviour Fabian Grünbichler
@ 2020-07-20  8:22 ` 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
  1 sibling, 0 replies; 3+ messages in thread
From: Fabian Grünbichler @ 2020-07-20  8:22 UTC (permalink / raw)
  To: pbs-devel

now that all examples and tests are fixed again.

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
---
 Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Makefile b/Makefile
index 40c1186d..2e10487b 100644
--- a/Makefile
+++ b/Makefile
@@ -60,7 +60,7 @@ $(SUBDIRS):
 test:
 	#cargo test test_broadcast_future
 	#cargo test $(CARGO_BUILD_ARGS)
-	#$(CARGO) test $(tests) $(CARGO_BUILD_ARGS)
+	$(CARGO) test $(tests) $(CARGO_BUILD_ARGS)
 
 doc:
 	$(CARGO) doc --no-deps $(CARGO_BUILD_ARGS)
-- 
2.20.1





^ permalink raw reply	[flat|nested] 3+ messages in thread

* [pbs-devel] applied-series: [PATCH proxmox-backup 1/2] manifest: revert canonicalization to old behaviour
  2020-07-20  8:22 [pbs-devel] [PATCH proxmox-backup 1/2] manifest: revert canonicalization to old behaviour Fabian Grünbichler
  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 ` Thomas Lamprecht
  1 sibling, 0 replies; 3+ messages in thread
From: Thomas Lamprecht @ 2020-07-20 10:00 UTC (permalink / raw)
  To: Proxmox Backup Server development discussion, Fabian Grünbichler

On 20.07.20 10:22, Fabian Grünbichler wrote:
> 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(-)
> 
>

applied series, thanks!





^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2020-07-20 10:01 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-07-20  8:22 [pbs-devel] [PATCH proxmox-backup 1/2] manifest: revert canonicalization to old behaviour Fabian Grünbichler
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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal