From: Charles McGarvey Date: Fri, 8 Jul 2022 03:48:15 +0000 (-0600) Subject: Use expanded title, username in OTP parameters X-Git-Tag: v0.904~1 X-Git-Url: https://git.brokenzipper.com/gitweb?a=commitdiff_plain;h=3a28d16f9cfdf4fa7db4b513f143374ddc7598b1;p=chaz%2Fp5-File-KDBX Use expanded title, username in OTP parameters --- diff --git a/Changes b/Changes index ec16232..fb326fa 100644 --- a/Changes +++ b/Changes @@ -1,6 +1,7 @@ Revision history for File-KDBX. {{$NEXT}} + * Use expanded title, username in OTP parameters. 0.903 2022-05-11 17:17:13-0600 diff --git a/lib/File/KDBX/Entry.pm b/lib/File/KDBX/Entry.pm index b685835..0119b67 100644 --- a/lib/File/KDBX/Entry.pm +++ b/lib/File/KDBX/Entry.pm @@ -11,7 +11,7 @@ use File::KDBX::Constants qw(:history :icon); use File::KDBX::Error; use File::KDBX::Util qw(:assert :class :coercion :erase :function :uri generate_uuid load_optional); use Hash::Util::FieldHash; -use List::Util qw(first sum0); +use List::Util qw(any first sum0); use Ref::Util qw(is_coderef is_hashref is_plain_hashref); use Scalar::Util qw(blessed looks_like_number); use Storable qw(dclone); @@ -654,8 +654,8 @@ sub _hotp_params { my %params = ( type => 'hotp', - issuer => $self->title || 'KDBX', - account => $self->username || 'none', + issuer => $self->expand_title || 'KDBX', + account => $self->expand_username || 'none', digits => 6, counter => $self->string_value('HmacOtp-Counter') // 0, $self->_otp_secret_params('Hmac'), @@ -680,8 +680,8 @@ sub _totp_params { ); my %params = ( type => 'totp', - issuer => $self->title || 'KDBX', - account => $self->username || 'none', + issuer => $self->expand_title || 'KDBX', + account => $self->expand_username || 'none', digits => $self->string_value('TimeOtp-Length') // 6, algorithm => $algorithms{$self->string_value('TimeOtp-Algorithm') || ''} || 'sha1', period => $self->string_value('TimeOtp-Period') // 30,