save auth results to defaults

This commit is contained in:
merlokk committed 2021-07-29 19:43:48 +03:00
1 parent 32990d44ec
commit 3d6bca37ae
1 file changed
+10 -1
+10 -1
View File
@@ -3250,7 +3250,16 @@ static int CmdHF14ADesAuth(const char *Cmd) {
DesfirePrintContext(&dctx);
if (save) {
// TODO
defaultKeyNum = dctx.keyNum;
defaultAlgoId = dctx.keyType;
memcpy(defaultKey, dctx.key, DESFIRE_MAX_KEY_SIZE);
defaultKdfAlgo = dctx.kdfAlgo;
defaultKdfInputLen = dctx.kdfInputLen;
memcpy(defaultKdfInput, dctx.kdfInput, sizeof(dctx.kdfInput));
defaultSecureChannel = securechann;
defaultCommSet = dctx.cmdSet;
defaultCommMode = dctx.commMode;
PrintAndLogEx(SUCCESS, "Context saved to defaults " _GREEN_("succesfully") ". You can check them by command " _YELLOW_("hf mfdes default"));
}