Skip to content

Commit

Permalink
Merge pull request #2143 from Antiklesys/master
Browse files Browse the repository at this point in the history
Modified hf iclass calcnewkey
  • Loading branch information
iceman1001 authored Oct 20, 2023
2 parents c4ff847 + 2790bc0 commit c8f5c54
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 3 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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...

## [unreleased][unreleased]
- Modified `hf iclass calcnewkey` - Added calculations for old key elite and new key non elite (@Antiklesys)
- Changed the CLI prompt to show tcp/udp if used (@iceman1001)
- Changed `hw ping` - now shows transfer time (@doegox)
- Added `hf mf encodehid` - writes HID legacy credential to a empty MFC (@iceman1001)
Expand Down
6 changes: 6 additions & 0 deletions client/src/cmdhficlass.c
Original file line number Diff line number Diff line change
Expand Up @@ -3215,6 +3215,7 @@ static int CmdHFiClassCalcNewKey(const char *Cmd) {
arg_str0(NULL, "csn", "<hex>", "Specify a Card Serial Number (CSN) to diversify the key (if omitted will attempt to read a CSN)"),
arg_lit0(NULL, "elite", "Elite computations applied to new key"),
arg_lit0(NULL, "elite2", "Elite computations applied to both old and new key"),
arg_lit0(NULL, "oldelite", "Elite computations applied only to old key"),
arg_param_end
};
CLIExecWithReturn(ctx, Cmd, argtable, false);
Expand Down Expand Up @@ -3307,6 +3308,11 @@ static int CmdHFiClassCalcNewKey(const char *Cmd) {
old_elite = true;
}

if (arg_get_lit(ctx, 8)) {
elite = false;
old_elite = true;
}

CLIParserFree(ctx);

uint8_t xor_div_key[8] = {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
Expand Down
6 changes: 3 additions & 3 deletions doc/commands.json
Original file line number Diff line number Diff line change
Expand Up @@ -2986,10 +2986,10 @@
"--new <hex> Specify key as 8 hex bytes",
"--nki <dec> New key index to select key from memory 'hf iclass managekeys'",
"--csn <hex> Specify a Card Serial Number (CSN) to diversify the key (if omitted will attempt to read a CSN)",
"--elite Elite computations applied to new key",
"--elite2 Elite computations applied to both old and new key"
"--elite2 Elite computations applied to both old and new key",
"--oldelite Elite computations applied only to old key"
],
"usage": "hf iclass calcnewkey [-h] [--old <hex>] [--oki <dec>] [--new <hex>] [--nki <dec>] [--csn <hex>] [--elite] [--elite2]"
"usage": "hf iclass calcnewkey [-h] [--old <hex>] [--oki <dec>] [--new <hex>] [--nki <dec>] [--csn <hex>] [--elite] [--elite2] [--oldelite]"
},
"hf iclass chk": {
"command": "hf iclass chk",
Expand Down

0 comments on commit c8f5c54

Please sign in to comment.