From 2e5b1025bc3cdfdd6f1fb0531505d6f3fa3d4aca Mon Sep 17 00:00:00 2001 From: HariomKesh Date: Fri, 13 Jul 2018 05:51:32 +0530 Subject: [PATCH] LoadKey Overwrite always returns status as (00,00) (#45) --- Cx/NfcCxSC.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Cx/NfcCxSC.cpp b/Cx/NfcCxSC.cpp index 2b2a389..f67056d 100644 --- a/Cx/NfcCxSC.cpp +++ b/Cx/NfcCxSC.cpp @@ -2674,7 +2674,9 @@ Return Value: // If present OverWrite the Keys else Validate KeyTable Size and Write the Keys if ((dwKeyIndex = ((LoadKey*)ScInterface->StorageCardKey)->ExtractKeyIndex(KeyNumber)) != (DWORD)-1) { TRACE_LINE(LEVEL_INFO, "OverWrite the Keys in the Available Index\n"); - ((LoadKey*)ScInterface->StorageCardKey)->OverWriteKeys(dwKeyIndex, KeyNumber, pCommandApdu->DataIn, MAX_BUFFERSIZE); + if (((LoadKey*)ScInterface->StorageCardKey)->OverWriteKeys(dwKeyIndex, KeyNumber, pCommandApdu->DataIn, MAX_BUFFERSIZE)){ + RtlCopyMemory(Sw1Sw2, APDU_STATUS_SUCCESS, DEFAULT_APDU_STATUS_SIZE); + } } else { if(((LoadKey*)ScInterface->StorageCardKey)->KeyTableFull()) {