From ec489a9530a8427792ac2751fe38595951b586a5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=96=9F=E9=85=8C=20=E9=B5=AC=E5=85=84?= Date: Thu, 11 Jul 2024 06:54:47 +0800 Subject: [PATCH] Reset secret if decrypt failed --- bash/sources/16_keystore | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/bash/sources/16_keystore b/bash/sources/16_keystore index 205a635..f8bb249 100644 --- a/bash/sources/16_keystore +++ b/bash/sources/16_keystore @@ -128,6 +128,11 @@ function _kstoredec { fi openssl enc -d -aes-256-cbc -pbkdf2 -k "$_AUTH_SECRET" -a -A + _code=$? + if [ $_code -ne 0 ]; then + _AUTH_SECRET= + return $_code + fi } function _kstoresecret-auto {