Commit graph

30 commits

Author SHA1 Message Date
Christian Mollekopf
f3a19e0a43 Generate a 32 character long totp secret
This provides 160bit length instead of the previous 80, as
recommended by the rfc4226 (hotp), which is the basis for rfc6238 (totp).
128 bit is required by the rfc, and e.g. FreeOTP complains with an 80bit secret.
2025-02-25 12:53:26 +01:00
Aleksander Machniak
bb8710a747 kolab_2fa: Fix so removed factors are removed for real 2024-09-12 13:32:08 +02:00
Aleksander Machniak
a2119c58f6 kolab_2fa: Store driver config with the "token"
This way if we change the configuration registered OTP apps will still work.
2024-09-06 12:39:58 +02:00
Aleksander Machniak
4f8869529e Fix fatal error when parsing an event with broken recurrence 2024-04-18 13:53:13 +02:00
Aleksander Machniak
cbc8078c79 Fix more phpstan code issues 2024-04-16 08:58:06 +02:00
Aleksander Machniak
176f557ec7 PHPStan Level:4 fixes 2024-01-30 14:45:46 +01:00
Aleksander Machniak
5271b6e787 Use consistent PHP code style 2024-01-24 11:24:41 +01:00
Aleksander Machniak
f3319891d5 PHPStan Level:1 fixes, also fixed tests 2024-01-24 10:59:25 +01:00
Daniel Hoffend
18882d02dd Don't accept invalid yubikey tokens
Summary: Don't accept empty/invalid yubikey token input when adding a factor

Test Plan: Use empty yubikey field or token < 12 chars

Reviewers: #roundcube_kolab_plugins_developers, mollekopf

Reviewed By: #roundcube_kolab_plugins_developers, mollekopf

Subscribers: #roundcube_kolab_plugins_developers

Differential Revision: https://git.kolab.org/D375
2023-09-21 15:35:21 +02:00
Aleksander Machniak
4ff91e51de Fix PHP8 warning 2023-06-15 14:03:15 +02:00
Aleksander Machniak
70810e1f88 kolab_2fa: Bump spomky-labs/otphp to version 10
Fixes various PHP8 warnings
2023-06-15 12:26:53 +02:00
Aleksander Machniak
84f10a366b Fix PHP8 warnings 2023-06-14 15:10:51 +02:00
Aleksander Machniak
8430605f6c Fix PHP8 warnings 2023-06-14 15:05:00 +02:00
Christoph Erhardt
32f1865339 Fix TOTP authentication
Summary:
Kolab used to depend on version 4 of the otphp library, which returns
its computed OTP codes as integers. Hence, the kolab_2fa plugin converts
the user input to `int` in order to facilitate comparisons using the
`===` operator.

Starting with version 5, which is now bundled with Kolab, otphp returns
a string instead of an integer. Now the comparison is between an `int`
and a `string`, and thus consistently yields `false`. As a result, no
TOTP code is ever accepted.

Fix TOTP authentication by removing the now-obsolete conversion to
`int`.

Reviewers: machniak

Reviewed By: machniak

Differential Revision: https://git.kolab.org/D4370
2023-06-14 14:54:18 +02:00
Aleksander Machniak
096b7a8181 Fix PHP8 warnings 2023-06-12 12:07:58 +02:00
Aleksander Machniak
6841eb8207 Fix constant name (LOG_EMERGE -> LOG_EMERG) 2023-06-10 09:25:55 +02:00
Aleksander Machniak
2129b4e2c0 Fix PHP warnings 2021-03-08 14:29:23 +01:00
Thomas Bruederli
db2d3bc800 Fix driver initialization with config properties for the right method (T1784)
Summary:
Proposed fix for the bug reported in T1784

The method kolab_2fa::get_driver() is called with the full factor ID (<method>:<uuid>)
and therefore fails to retrieve the right properties from plugin config. This change fixes this at the right place.

Reviewers: machniak

Reviewed By: machniak

Subscribers: jh23453

Differential Revision: https://git.kolab.org/D242
2016-11-09 09:55:34 +01:00
Aleksander Machniak
669feb6b02 Comment out console() calls, CS fixes 2016-01-28 17:12:23 +01:00
Aleksander Machniak
f1eada2be3 Fix "Failed to save authentication token" when adding token to kolab-2fa plugin (T968) 2016-01-28 17:07:11 +01:00
Thomas Bruederli
bbddeb6345 Replace stubs with actual implementation which was missing in the repo
Resolves T595
2015-07-06 22:37:45 +02:00
Jeroen van Meeuwen (Kolab Systems)
c7e0545e85 Workaround T595 2015-07-06 16:47:33 +02:00
Jeroen van Meeuwen (Kolab Systems)
d535d137e5 Fix TOTP (Resolves T603) 2015-07-06 16:32:34 +02:00
Thomas Bruederli
0a24a09a73 Add logging facilities for Storage classes as requested by T469. Not finished yet... 2015-06-14 17:17:08 +02:00
Thomas Bruederli
3e52521c3e Finished LDAP storage backend to work with FreeIPA ipaToken subclasses
Resolves T421
2015-06-11 16:38:47 +02:00
Thomas Bruederli
7f3a76fdad Refactor the 2FA plugin/drivers/storage to allow multiple factors of the same type 2015-06-10 18:20:08 +02:00
Thomas Bruederli
358ac3e33f Implement LDAP storage backend for 2-factor-auth (T421).
Allow kolab_auth plugin to populate 'kolab_2fa_factors' config option through 'kolab_auth_role_settings'
and hereby define the active authentication factors from the one LDAP query.
2015-06-09 09:58:32 +02:00
Thomas Bruederli
8e51918f64 Small refactoring of the 2FA storage layer + also use it for determining the active factors 2015-06-08 15:58:52 +02:00
Thomas Bruederli
c83d6d7341 Minor code cleanup 2015-06-04 16:18:56 +02:00
Thomas Bruederli
1b10eb060a Initial version of the Kolab 2-Factor-Authentication plugin.
This already includes:
- Drivers supporting TOTP, HOTP, Yubikey
- Storage backend abstraction
- Additional authentication step at login
- Settings section to provision and remove authentication factors
- Sample config with comments

Resolves T415
2015-06-04 15:53:04 +02:00