From: Christian Ebner <c.ebner@proxmox.com>
To: pbs-devel@lists.proxmox.com
Subject: [PATCH proxmox-backup 1/2] pbs-key-config: drop useless length check enforce by type
Date: Wed, 21 Oct 2026 18:41:11 +0200 [thread overview]
Message-ID: <20261021164112.464267-2-c.ebner@proxmox.com> (raw)
In-Reply-To: <20261021164112.464267-1-c.ebner@proxmox.com>
The fixed size byte slice passed as parameter to the method call
already enfoces the length of 32, so checking that is not required.
Drop the useless check.
Signed-off-by: Christian Ebner <c.ebner@proxmox.com>
---
pbs-key-config/src/lib.rs | 4 ----
1 file changed, 4 deletions(-)
diff --git a/pbs-key-config/src/lib.rs b/pbs-key-config/src/lib.rs
index b8e00d227..3147845ca 100644
--- a/pbs-key-config/src/lib.rs
+++ b/pbs-key-config/src/lib.rs
@@ -125,10 +125,6 @@ impl KeyConfig {
/// Creates a new instance, protect raw_key with passphrase.
pub fn with_key(raw_key: &[u8; 32], passphrase: &[u8], kdf: Kdf) -> Result<Self, Error> {
- if raw_key.len() != 32 {
- bail!("got strange key length ({} != 32)", raw_key.len())
- }
-
let salt = proxmox_sys::linux::random_data(32)?;
let kdf = match kdf {
--
2.47.3
next prev parent reply other threads:[~2026-10-21 16:41 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-21 16:41 [PATCH proxmox-backup 0/2] fix potential panic on key decryption Christian Ebner
2026-10-21 16:41 ` Christian Ebner [this message]
2026-10-21 16:41 ` [PATCH proxmox-backup 2/2] fix: pbs-key-config: do not panic on short decrypted keys Christian Ebner
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=20261021164112.464267-2-c.ebner@proxmox.com \
--to=c.ebner@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