[pbs-devel] [PATCH proxmox-backup-qemu 1/2] encryption key tracking: use fingerprint

Dietmar Maurer dietmar at proxmox.com
Tue Nov 24 16:36:56 CET 2020


Does this improve something? I can't see the purpose of this change.


> @@ -152,7 +154,8 @@ pub(crate) fn check_last_encryption_key(
>      let digest_guard = PREVIOUS_CRYPT_CONFIG_DIGEST.lock().unwrap();
>      match (*digest_guard, config)  {
>          (Some(last_digest), Some(current_config)) => {
> -            crypt_config_digest(current_config) == last_digest
> +            current_config.fingerprint().bytes() == &last_digest
> +                || crypt_config_digest(current_config) == last_digest
>          },
>          (None, None) => true,
>          _ => false,
> @@ -440,7 +443,13 @@ pub(crate) async fn finish_backup(
>  
>      {
>          let crypt_config_digest = match crypt_config {
> -            Some(current_config) => Some(crypt_config_digest(current_config)),
> +            Some(current_config) => {
> +                let fp = current_config
> +                    .fingerprint()
> +                    .bytes()
> +                    .to_owned();
> +                Some(fp)
> +            },
>              None => None,
>          };
>





More information about the pbs-devel mailing list