update 1.2.2.3 beta

This commit is contained in:
MacRimi
2026-07-06 00:39:43 +02:00
parent 20d10fc268
commit 7156af1965
4 changed files with 52 additions and 13 deletions

View File

@@ -1 +1 @@
ab9f30de3517bf2aa0746691e230186e647fb68ad57a298837c7c871700e0c4c ProxMenux-1.2.2.3-beta.AppImage
2a42c1b604a8a42b553c79fe924a33534dfa7314d1f7a9df4d1a4d34861ad32e ProxMenux-1.2.2.3-beta.AppImage

View File

@@ -13870,16 +13870,27 @@ def api_pbs_encryption_keyfile_info():
# without their passphrase, so parsing the JSON manually gives us
# a hint even for imported scrypt keys the operator brought their
# own passphrase for.
# KDF detection covers all three shapes proxmox-backup-client
# writes across versions:
# - modern kdf=none → JSON `null` → Python None
# - legacy kdf=none → string "None"
# - kdf=scrypt → object {"Scrypt": {...}}
kdf_hint = 'unknown'
try:
with open(_PBS_KEYFILE_PATH, 'r') as f:
raw = f.read(4096)
body = json.loads(raw)
kdf_raw = body.get('kdf')
if isinstance(kdf_raw, str):
# `body.get('kdf', 'MISSING')` distinguishes "field explicitly
# null" (present with JSON null → we want 'none') from "field
# absent" (unlikely but treat as unknown to be safe).
_sentinel = object()
kdf_raw = body.get('kdf', _sentinel)
if kdf_raw is None:
kdf_hint = 'none'
elif isinstance(kdf_raw, str):
# "None" → "none", any other string mirrors verbatim.
kdf_hint = kdf_raw.lower()
elif isinstance(kdf_raw, dict):
# scrypt keyfiles carry `"kdf": {"Scrypt": {...}}`.
kdf_hint = next(iter(kdf_raw)).lower() if kdf_raw else 'unknown'
except (OSError, json.JSONDecodeError, ValueError, StopIteration):
pass