From 73eff944841320c7c46f5fce1ff1c3e6da0bb216 Mon Sep 17 00:00:00 2001 From: d0k3 Date: Mon, 26 Dec 2016 16:01:57 +0100 Subject: [PATCH] Prevent slot0x??key?.bin file locks .. actually close the file after key is found --- source/crypto/keydb.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/source/crypto/keydb.c b/source/crypto/keydb.c index f8be615..1479e1f 100644 --- a/source/crypto/keydb.c +++ b/source/crypto/keydb.c @@ -202,10 +202,8 @@ u32 LoadKeyFromFile(u8* key, u32 keyslot, char type, char* id) snprintf(path, 64, "%s/slot0x%02lXKey%s.bin", base[i], keyslot, (id) ? id : (type == 'X') ? "X" : (type == 'Y') ? "Y" : ""); if (f_open(&fp, path, FA_READ | FA_OPEN_EXISTING) != FR_OK) continue; - if ((f_read(&fp, key, 16, &btr) == FR_OK) && (btr == 16)) { + if ((f_read(&fp, key, 16, &btr) == FR_OK) && (btr == 16)) found = true; - break; - } f_close(&fp); } }