From 3a28d16f9cfdf4fa7db4b513f143374ddc7598b1 Mon Sep 17 00:00:00 2001 From: Charles McGarvey Date: Thu, 7 Jul 2022 21:48:15 -0600 Subject: [PATCH] Use expanded title, username in OTP parameters --- Changes | 1 + lib/File/KDBX/Entry.pm | 10 +++++----- 2 files changed, 6 insertions(+), 5 deletions(-) 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, -- 2.45.2