Add --no-auth support for hf mfdes createapp

This commit is contained in:
Joshua Wright 2022-01-04 15:55:26 -05:00
parent 224e2f68b2
commit 859b55933d

View file

@ -2348,12 +2348,14 @@ static int CmdHF14ADesCreateApp(const char *Cmd) {
arg_str0(NULL, "ks2", "<key settings HEX>", "Key settings 2 (HEX 1 byte). default 0x0e"),
arg_str0(NULL, "dstalgo", "<DES/2TDEA/3TDEA/AES>", "Application key crypt algo: DES, 2TDEA, 3TDEA, AES. default DES"),
arg_int0(NULL, "numkeys", "<number of keys>", "Keys count. 0x00..0x0e. default 0x0e"),
arg_lit0(NULL, "no-auth", "execute without authentication"),
arg_param_end
};
CLIExecWithReturn(ctx, Cmd, argtable, false);
bool APDULogging = arg_get_lit(ctx, 1);
bool verbose = arg_get_lit(ctx, 2);
bool noauth = arg_get_lit(ctx, 19);
DesfireContext_t dctx;
int securechann = defaultSecureChannel;
@ -2423,7 +2425,7 @@ static int CmdHF14ADesCreateApp(const char *Cmd) {
return PM3_EINVARG;
}
res = DesfireSelectAndAuthenticate(&dctx, securechann, 0x000000, verbose);
res = DesfireSelectAndAuthenticateEx(&dctx, securechann, 0x000000, noauth, verbose);
if (res != PM3_SUCCESS) {
DropField();
return res;