all lists on lists.proxmox.com
 help / color / mirror / Atom feed
* [PATCH proxmox-backup] pbs-key-config: ensure password-protected key is long enough
@ 2026-11-05 11:07 Fabian Grünbichler
  0 siblings, 0 replies; only message in thread
From: Fabian Grünbichler @ 2026-11-05 11:07 UTC (permalink / raw)
  To: pbs-devel

while openssl fails if provided an empty slice, the resulting error message
points at the password instead of the key. checking for at least one byte of
data ensures plain and password-protected keys are distinguished.

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
---
 pbs-key-config/src/lib.rs | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/pbs-key-config/src/lib.rs b/pbs-key-config/src/lib.rs
index 7b87b4ea9..0cffdf008 100644
--- a/pbs-key-config/src/lib.rs
+++ b/pbs-key-config/src/lib.rs
@@ -211,7 +211,7 @@ impl KeyConfig {
 
             let derived_key = kdf.derive_key(&passphrase)?;
 
-            if raw_data.len() < 32 {
+            if raw_data.len() < EXPECTED_KEY_LEN + 1 {
                 bail!("Unable to decrypt key - short data");
             }
             let iv = &raw_data[0..16];
-- 
2.47.3





^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2026-11-05 11:07 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-05 11:07 [PATCH proxmox-backup] pbs-key-config: ensure password-protected key is long enough Fabian Grünbichler

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal