From 1f3086a028307a8c79ed24f280576cd4ab92adbf Mon Sep 17 00:00:00 2001 From: merlokk <807634+merlokk@users.noreply.github.com> Date: Mon, 26 Nov 2018 18:39:31 +0200 Subject: [PATCH] added json save --- client/cmdhffido.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/client/cmdhffido.c b/client/cmdhffido.c index 9ad988135..e32d5d9ed 100644 --- a/client/cmdhffido.c +++ b/client/cmdhffido.c @@ -901,6 +901,15 @@ int CmdHFFido2MakeCredential(const char *cmd) { // parse returned cbor MakeCredentionalParseRes(root, &buf[1], len - 1, verbose, showCBOR, showDERTLV); + if (root) { + res = json_dump_file(root, fname, JSON_INDENT(2)); + if (res) { + PrintAndLog("ERROR: can't save the file: %s", fname); + return 200; + } + PrintAndLog("File `%s` saved.", fname); + } + json_decref(root); return 0;