Merge pull request #1552 from joswr1ght/master

Add --no-auth support for hf mfdes createapp
This commit is contained in:
Philippe Teuwen 2022-01-05 17:52:44 +01:00 committed by GitHub
commit fc53665e5c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 13 additions and 10 deletions

View file

@ -3,6 +3,7 @@ All notable changes to this project will be documented in this file.
This project uses the changelog in accordance with [keepchangelog](http://keepachangelog.com/). Please use this to write notable changes, which is not the same as git commit log... This project uses the changelog in accordance with [keepchangelog](http://keepachangelog.com/). Please use this to write notable changes, which is not the same as git commit log...
## [unreleased][unreleased] ## [unreleased][unreleased]
- Added support for MIFARE DESFire application creation without authentication (@joswr1ght)
- Changed drastically Hitag S ARM code to remove state machines and ease way to build new commands (@doegox) - Changed drastically Hitag S ARM code to remove state machines and ease way to build new commands (@doegox)
- Fixed Hitag S crypto mode with key or NrAr, fixed `lf hitag cc`, fixed pwd dump in hitagS dump with LKP (@doegox) - Fixed Hitag S crypto mode with key or NrAr, fixed `lf hitag cc`, fixed pwd dump in hitagS dump with LKP (@doegox)
- Changed `trace list -h` - textual change (@iceman1001) - Changed `trace list -h` - textual change (@iceman1001)

View file

@ -2348,6 +2348,7 @@ static int CmdHF14ADesCreateApp(const char *Cmd) {
arg_str0(NULL, "ks2", "<key settings HEX>", "Key settings 2 (HEX 1 byte). default 0x0e"), 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_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_int0(NULL, "numkeys", "<number of keys>", "Keys count. 0x00..0x0e. default 0x0e"),
arg_lit0(NULL, "no-auth", "execute without authentication"),
arg_param_end arg_param_end
}; };
CLIExecWithReturn(ctx, Cmd, argtable, false); CLIExecWithReturn(ctx, Cmd, argtable, false);
@ -2399,6 +2400,7 @@ static int CmdHF14ADesCreateApp(const char *Cmd) {
} }
int keycount = arg_get_int_def(ctx, 18, 0x0e); int keycount = arg_get_int_def(ctx, 18, 0x0e);
bool noauth = arg_get_lit(ctx, 19);
SetAPDULogging(APDULogging); SetAPDULogging(APDULogging);
CLIParserFree(ctx); CLIParserFree(ctx);
@ -2423,7 +2425,7 @@ static int CmdHF14ADesCreateApp(const char *Cmd) {
return PM3_EINVARG; return PM3_EINVARG;
} }
res = DesfireSelectAndAuthenticate(&dctx, securechann, 0x000000, verbose); res = DesfireSelectAndAuthenticateEx(&dctx, securechann, 0x000000, noauth, verbose);
if (res != PM3_SUCCESS) { if (res != PM3_SUCCESS) {
DropField(); DropField();
return res; return res;