public inbox for pbs-devel@lists.proxmox.com
 help / color / mirror / Atom feed
From: "Fabian Grünbichler" <f.gruenbichler@proxmox.com>
To: Dietmar Maurer <dietmar@proxmox.com>,
	Proxmox Backup Server development discussion
	<pbs-devel@lists.proxmox.com>
Subject: Re: [pbs-devel] [PATCH proxmox-backup 09/13] paperkey: add short key ID to subject
Date: Mon, 23 Nov 2020 09:16:43 +0100	[thread overview]
Message-ID: <1606118041.ki3x6lhgym.astroid@nora.none> (raw)
In-Reply-To: <766783011.72.1606115268068@webmail.proxmox.com>

On November 23, 2020 8:07 am, Dietmar Maurer wrote:
> 
>> +            Ok(mut key_config) => {
>> +                // add display version of fingerprint to subject and strip from key data
>> +                let subject = match (subject, key_config.fingerprint.take()) {
>> +                    (Some(mut subject), Some(fingerprint)) => {
>> +                        subject.push_str(&format!(" ({})", fingerprint));
>> +                        Some(subject)
>> +                    },
>> +                    (None, Some(fingerprint)) => Some(format!("Fingerprint: {}", fingerprint)),
>> +                    (subject, _) => subject,
>> +                };
>> +
> 
> I still don't get why we need a 32byte fingerprint - this is the same length as the key itself!

the key (on disk) is 8 + 8 + 8 + 32 (key derivation) + 64 (encrypted key 
data) + 8 + 8 (timestamps), totalling 136 bytes. serialized it's a bit 
more, although there the fingerprint skews the numbers more heavily 
(because I opted for a readable serialization, not one optimized for 
size). even in-memory, the key is not 32-byte long, but 32+32+however 
long the PKey struct from openssl is.

I want to have the "full" fingerprint because we persist this in places 
where we can't (easily) update it, so it's more future-proof to keep the 
full value there. it also makes it possible to use the full value for 
the actual comparison done on manifest load/check (where we not only 
have to think about collisions for a single user, but potentially 
hundreds/thousands if they share a datastore!).

> I want to avoid having keys with different content (strip fingerprint), because this only
> confuse people.

I originally wanted to keep the full fingerprint in, but conceded to 
your space arguments here and only included the short version.. I also 
don't really buy the confusion, since unless the user has manually 
looked inside the key file they don't even know that or how the 
fingerprint is stored there - in the user-facing parts we only ever show 
the short key ID. furthermore we already paperkey the pretty-printed 
version so if the user restores that the checksum of the keyfile is 
different anyhow.




  reply	other threads:[~2020-11-23  8:17 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-11-20 16:38 [pbs-devel] [PATCH v2 proxmox-backup(-qemu) 00/15] add, persist and check fingerprint Fabian Grünbichler
2020-11-20 16:38 ` [pbs-devel] [PATCH proxmox-backup 01/13] crypt config: add fingerprint mechanism Fabian Grünbichler
2020-11-20 16:38 ` [pbs-devel] [PATCH proxmox-backup 02/13] key: add fingerprint to key config Fabian Grünbichler
2020-11-23  8:07   ` Wolfgang Bumiller
2020-11-20 16:38 ` [pbs-devel] [PATCH proxmox-backup 03/13] client: print key fingerprint and master key Fabian Grünbichler
2020-11-20 16:38 ` [pbs-devel] [PATCH proxmox-backup 04/13] client: add 'key show' command Fabian Grünbichler
2020-11-20 16:38 ` [pbs-devel] [PATCH proxmox-backup 05/13] fix #3139: add key fingerprint to manifest Fabian Grünbichler
2020-11-20 16:38 ` [pbs-devel] [PATCH proxmox-backup 06/13] manifest: check fingerprint when loading with key Fabian Grünbichler
2020-11-20 16:38 ` [pbs-devel] [PATCH proxmox-backup 07/13] client: check fingerprint after downloading manifest Fabian Grünbichler
2020-11-20 16:38 ` [pbs-devel] [PATCH proxmox-backup 08/13] paperkey: refactor common code Fabian Grünbichler
2020-11-20 16:38 ` [pbs-devel] [PATCH proxmox-backup 09/13] paperkey: add short key ID to subject Fabian Grünbichler
2020-11-23  7:07   ` Dietmar Maurer
2020-11-23  8:16     ` Fabian Grünbichler [this message]
2020-11-23  8:30       ` Dietmar Maurer
2020-11-23  8:47         ` Fabian Grünbichler
2020-11-23  8:41       ` Dietmar Maurer
2020-11-23  8:55       ` Dietmar Maurer
2020-11-23  9:44         ` Fabian Grünbichler
2020-11-20 16:38 ` [pbs-devel] [RFC proxmox-backup 10/13] expose previous backup time in backup env Fabian Grünbichler
2020-11-20 16:38 ` [pbs-devel] [PATCH proxmox-backup 11/13] refactor BackupInfo -> SnapshotListItem helper Fabian Grünbichler
2020-11-20 16:38 ` [pbs-devel] [PATCH proxmox-backup 12/13] list_snapshots: return manifest fingerprint Fabian Grünbichler
2020-11-20 16:38 ` [pbs-devel] [PATCH proxmox-backup 13/13] gui: add snapshot/file fingerprint tooltip Fabian Grünbichler
2020-11-20 16:38 ` [pbs-devel] [PATCH proxmox-backup-qemu 1/2] adapt to proxmox-backup fingerprint changes Fabian Grünbichler
2020-11-24  8:07   ` [pbs-devel] applied: " Dietmar Maurer
2020-11-20 16:38 ` [pbs-devel] [PATCH proxmox-backup-qemu 2/2] restore: improve error if key is missing Fabian Grünbichler
2020-11-24  7:47 ` [pbs-devel] [PATCH v2 proxmox-backup(-qemu) 00/15] add, persist and check fingerprint Dietmar Maurer

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=1606118041.ki3x6lhgym.astroid@nora.none \
    --to=f.gruenbichler@proxmox.com \
    --cc=dietmar@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
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal