From 49c0179ccf89db97077d4f41487faf94e18f7ca7 Mon Sep 17 00:00:00 2001 From: Pol Henarejos Date: Wed, 19 Mar 2025 13:33:35 +0100 Subject: [PATCH] Fix swap files. When a dynamic file is deleted, all scoped references to other dynamic files are invalidated. Fixes #124 Signed-off-by: Pol Henarejos --- src/fido/otp.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/fido/otp.c b/src/fido/otp.c index c91b013..021143f 100644 --- a/src/fido/otp.c +++ b/src/fido/otp.c @@ -443,6 +443,8 @@ int cmd_otp() { } else { delete_file(ef1); + // When a dynamic file is deleted, existing referenes are invalidated + ef2 = file_new(EF_OTP_SLOT2); } if (ef1_data) { file_put_data(ef2, tmp, sizeof(tmp));