From: Tollef Fog Heen Date: Sat, 27 Jul 2019 00:35:27 +0000 (+0200) Subject: Chomp secret and account name X-Git-Url: https://git.adam-barratt.org.uk/?p=mirror%2Fuserdir-ldap-cgi.git;a=commitdiff_plain;h=65d4016e9d0581ca3f7d80146e52b3c5d4f30ecd Chomp secret and account name --- diff --git a/fetch-totp-seed.cgi b/fetch-totp-seed.cgi index f7d4c56..98ed798 100644 --- a/fetch-totp-seed.cgi +++ b/fetch-totp-seed.cgi @@ -26,7 +26,9 @@ if ($timestamp + 1800 < time()) { my $filename = $config{totpticketdirectory} . "/" . $random_id; open(my $fh, "<", $filename) or &Util::HTMLError("TOTP seed file not found or permission denied: $! ; $filename"); my $hex_seed = <$fh>; +chomp $hex_seed; my $accountname = <$fh>; +chomp $accountname; my $seed = encode_base32(pack('H*', $hex_seed)); close $fh; #unlink $filename;