From 7c311fe9fe6b63e4340a1bbdf1a6011d886ad1c3 Mon Sep 17 00:00:00 2001 From: Marcel de Rooy Date: Thu, 9 Sep 2021 12:42:01 +0000 Subject: [PATCH] Bug 28772: (QA follow-up) Apply change to other dbrev too [STABLE] Signed-off-by: Marcel de Rooy Signed-off-by: Wainui Witika-Park (cherry picked from commit d84b2254a8dc08a3999ae25a9577332f1026ff08) Signed-off-by: Victor Grousset/tuxayo --- installer/data/mysql/atomicupdate/bug_28772_api_keys.perl | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/installer/data/mysql/atomicupdate/bug_28772_api_keys.perl b/installer/data/mysql/atomicupdate/bug_28772_api_keys.perl index cb4529a71a..6265944586 100755 --- a/installer/data/mysql/atomicupdate/bug_28772_api_keys.perl +++ b/installer/data/mysql/atomicupdate/bug_28772_api_keys.perl @@ -19,8 +19,10 @@ if( CheckVersion( $DBversion ) ) { }); foreach my $api_key (@$results) { - my $digest = Koha::AuthUtils::hash_password( $api_key->{secret} ); - $sth->execute( $digest, $api_key->{client_id} ); + unless ( $api_key->{secret} =~ m/^\$2a\$08\$/ ) { + my $digest = Koha::AuthUtils::hash_password( $api_key->{secret} ); + $sth->execute( $digest, $api_key->{client_id} ); + } } NewVersion( $DBversion, 28772, "Store hashed API key secrets" ); -- 2.39.5