]> git.proxmox.com Git - pve-access-control.git/commit - PVE/AccessControl.pm
partially fix #2825: authkey: rotate if it was generated in the future
authorThomas Lamprecht <t.lamprecht@proxmox.com>
Fri, 3 Jul 2020 09:06:55 +0000 (11:06 +0200)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Sat, 4 Jul 2020 16:22:51 +0000 (18:22 +0200)
commit9de25de807b6843c971f1863e811cf76ee4c9b23
treefaed792f23dfc7217785a0129c86ac63c11ff618
parent8304b226d615f8d883b3cbb69e1c1d4b4010e00f
partially fix #2825: authkey: rotate if it was generated in the future

Can happen if the RTC is in the future during installation and first
boot, when during key generation the clock is in the future and then,
after the key was already generated, jumps back in time.

Allow a fuzz of $auth_graceperiod, which is currently 5 minutes, as
that fuzz allows some minor, not really problematic, time sync
disparity in clusters.

If an old authkey exists, meaning we rotated at least once, check it's
time too. Only rotate if it'd not be valid for any tickets in the
cluster anymore, i.e., if it difference between the current key is >
$ticket_lifetime (2 hours)..

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
PVE/AccessControl.pm