Re: [PATCH proxmox-backup v3 07/30] pbs-config: implement encryption key config handling

Christian Ebner
2026-04-20T07:22:59Z

On 4/19/26 11:06 PM, Thomas Lamprecht wrote:
> Am 14.04.26 um 14:59 schrieb Christian Ebner:
>> diff --git a/pbs-config/src/encryption_keys.rs b/pbs-config/src/encryption_keys.rs
>>
>> +/// Mark the key as archived by setting the `archived-at` timestamp.
>> +pub fn archive_key(id: &str, mut config: SectionConfigData) -> Result<(), Error> {
>
> nit: Unlike delete_key, which has a "Safety: caller must acquire and hold
> config lock" doc comment, archive_key has no such note even though it has
> the same precondition (takes `mut config` without re-locking). Might be good
> to add an equivalent note here for consistency - this also nicely documents
> the intent alongside the pending must_use-based fix for the missing lock
> binding in store_key.

Added the safety docstring for archive_key as well.

>
>> +/// Config type for encryption key config entries
>> +pub const ENCRYPTION_KEYS_CFG_TYPE_ID: &str = "sync-key";
>
> nit: the type id "sync-key" hardcodes a sync-only assumption into what is
> otherwise named as a generic "encryption keys" config. If there's any intent
> to reuse this config outside of sync jobs later, albeit renaming it is a
> minor migration cost, if some use cases really come up, just wanted to
> notice this tiny boundary "leak" as now it'd be still trivial to adapt the
> name, but really no hard feelings at all.

The intend was to keep the door open in case we decide to merge this
config with the tape key config for PBS 5.