mirror of
https://github.com/vincentmli/bpfire.git
synced 2026-04-09 18:45:54 +02:00
ovpnmain.cgi: Fix OTP secret handling
Convert stored hex OTP secret to binary prior to converting to base32.
This commit is contained in:
committed by
Michael Tremer
parent
16d4a5c264
commit
10b32d3895
@@ -2655,7 +2655,7 @@ else
|
||||
darkcolor => Imager::Color->new(0, 0, 0),
|
||||
);
|
||||
my $cn = $confighash{$cgiparams{'KEY'}}[2];
|
||||
my $secret = encode_base32($confighash{$cgiparams{'KEY'}}[44]);
|
||||
my $secret = encode_base32(pack('H*', $confighash{$cgiparams{'KEY'}}[44]));
|
||||
my $issuer = "$mainsettings{'HOSTNAME'}.$mainsettings{'DOMAINNAME'}";
|
||||
my $qrcodeimg = $qrcode->plot("otpauth://totp/$cn?secret=$secret&issuer=$issuer");
|
||||
my $qrcodeimgdata;
|
||||
|
||||
Reference in New Issue
Block a user