]> git.proxmox.com Git - proxmox.git/commit
tfa: log all tfa verify errors and treat as failure, count
authorWolfgang Bumiller <w.bumiller@proxmox.com>
Tue, 25 Apr 2023 07:37:11 +0000 (09:37 +0200)
committerWolfgang Bumiller <w.bumiller@proxmox.com>
Wed, 10 May 2023 08:35:54 +0000 (10:35 +0200)
commita3448feb1a8124ad85914ab743d8bc215d9883f7
treea4268eec7872f1337ff058a661eaae05eecff648
parent50b793db8d3421bbfe2bce060a486263f18a90cb
tfa: log all tfa verify errors and treat as failure, count

Use a custom result type to return success/failure and the
need to save the user data to the caller, while having
logged the error messages rather than returning them.

We count general TFA failures and also TOTP specifically,
and lock the user out of their 2nd factors on too many
failures.

To this end, all errors are now treated as failures.
While technically we can have crypto errors the user might
not be able to cause, we can't always know, and not all
errors are guaranteed to be a host side configuration issue,
so instead, all errors (since they are rare) now now counted
as a regular TFA error.

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
proxmox-tfa/src/api/mod.rs
proxmox-tfa/src/totp.rs