mirror of
https://github.com/vincentmli/bpfire.git
synced 2026-04-28 11:43:25 +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),
|
darkcolor => Imager::Color->new(0, 0, 0),
|
||||||
);
|
);
|
||||||
my $cn = $confighash{$cgiparams{'KEY'}}[2];
|
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 $issuer = "$mainsettings{'HOSTNAME'}.$mainsettings{'DOMAINNAME'}";
|
||||||
my $qrcodeimg = $qrcode->plot("otpauth://totp/$cn?secret=$secret&issuer=$issuer");
|
my $qrcodeimg = $qrcode->plot("otpauth://totp/$cn?secret=$secret&issuer=$issuer");
|
||||||
my $qrcodeimgdata;
|
my $qrcodeimgdata;
|
||||||
|
|||||||
Reference in New Issue
Block a user