Bugzilla – Attachment 129568 Details for
Bug 28786
Two-factor authentication for staff client - TOTP
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 28786: (QA follow-up) Do not call generate_secret32
Bug-28786-QA-follow-up-Do-not-call-generatesecret3.patch (text/plain), 1.93 KB, created by
Marcel de Rooy
on 2022-01-18 12:58:12 UTC
(
hide
)
Description:
Bug 28786: (QA follow-up) Do not call generate_secret32
Filename:
MIME Type:
Creator:
Marcel de Rooy
Created:
2022-01-18 12:58:12 UTC
Size:
1.93 KB
patch
obsolete
>From 956a7720ed8be10fb37903d5a56fc8111c2bcc17 Mon Sep 17 00:00:00 2001 >From: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >Date: Mon, 17 Jan 2022 12:53:46 +0000 >Subject: [PATCH] Bug 28786: (QA follow-up) Do not call generate_secret32 >Content-Type: text/plain; charset=utf-8 > >Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >--- > Koha/Auth/TwoFactorAuth.pm | 6 ++---- > members/two_factor_auth.pl | 5 ++--- > 2 files changed, 4 insertions(+), 7 deletions(-) > >diff --git a/Koha/Auth/TwoFactorAuth.pm b/Koha/Auth/TwoFactorAuth.pm >index 8932006763..81ddf06a3d 100644 >--- a/Koha/Auth/TwoFactorAuth.pm >+++ b/Koha/Auth/TwoFactorAuth.pm >@@ -29,10 +29,8 @@ Koha::Auth::TwoFactorAuth- Koha class deal with Two factor authentication > use Koha::Auth::TwoFactorAuth; > > my $secret = Koha::AuthUtils::generate_salt( 'weak', 16 ); >-my $auth = Koha::Auth::TwoFactorAuth->new( >- { patron => $patron, secret => $secret } ); >-my $secret32 = $auth->generate_secret32; >-my $ok = $auth->verify($pin_code, 1, $secret32); >+my $auth = Koha::Auth::TwoFactorAuth->new({ patron => $patron, secret => $secret }); >+my $ok = $auth->verify( $pin_code, 1 ); > > It's based on Auth::GoogleAuth > >diff --git a/members/two_factor_auth.pl b/members/two_factor_auth.pl >index 2a5a996c56..3d763d23f3 100755 >--- a/members/two_factor_auth.pl >+++ b/members/two_factor_auth.pl >@@ -78,14 +78,13 @@ if ( $op eq 'enable-2FA' ) { > my $auth = Koha::Auth::TwoFactorAuth->new( > { patron => $logged_in_user, secret => $secret } ); > >- my $secret32 = $auth->generate_secret32; > my $qr_code_url = >- $auth->qr_code( $secret32, $auth->key_id, $auth->issuer, ); >+ $auth->qr_code( undef, $auth->key_id, $auth->issuer ); # no need to pass secret32 > > $template->param( > issuer => $auth->issuer, > key_id => $auth->key_id, >- secret32 => $secret32, >+ secret32 => $auth->secret32, > qr_code_url => $qr_code_url, > ); > $auth->clear; >-- >2.20.1
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 28786
:
123375
|
123376
|
123377
|
123378
|
123379
|
123380
|
123381
|
123397
|
123398
|
123399
|
123400
|
123401
|
123402
|
123403
|
124569
|
124770
|
124771
|
124844
|
124845
|
124846
|
124847
|
128841
|
128842
|
129383
|
129384
|
129474
|
129521
|
129557
|
129558
|
129559
|
129560
|
129561
|
129562
|
129563
|
129564
|
129565
|
129566
|
129567
|
129568
|
129569
|
129654
|
129655
|
129656
|
129657
|
129658
|
129659
|
129660
|
129661
|
129662
|
129665
|
131940
|
131941
|
131942
|
131943
|
131944
|
131945
|
131946
|
131947
|
131948
|
131949
|
131950
|
131951
|
131952
|
131953
|
131954
|
131955
|
131956
|
131957
|
131958
|
132142
|
132143
|
132144
|
132145
|
132146
|
132147
|
132148
|
132149
|
132150
|
132153
|
132154
|
132155
|
132156
|
132157
|
133222
|
133516
|
133522
|
133531
|
133533
|
133541
|
133548
|
133643
|
133686