From 44ca760e1c402dfa1b7eb2258e11c3e1e688f4b0 Mon Sep 17 00:00:00 2001 From: Pol Henarejos Date: Wed, 29 Jan 2025 17:09:20 +0100 Subject: [PATCH] Added phy_save() and phy_load() to save and load PHY. Signed-off-by: Pol Henarejos --- src/rescue.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/rescue.c b/src/rescue.c index c90b264..b965a1a 100644 --- a/src/rescue.c +++ b/src/rescue.c @@ -70,11 +70,12 @@ int cmd_write() { #ifndef ENABLE_EMULATION int ret = phy_unserialize_data(apdu.data, apdu.nc, &phy_data); if (ret == PICOKEY_OK) { - file_put_data(ef_phy, apdu.data, apdu.nc); + if (phy_save() != PICOKEY_OK) { + return SW_EXEC_ERROR(); + } } #endif } - low_flash_available(); return SW_OK(); }