Skip to content

Commit eab6953

Browse files
committed
text and style
1 parent 77624fe commit eab6953

File tree

4 files changed

+41
-26
lines changed

4 files changed

+41
-26
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ All notable changes to this project will be documented in this file.
33
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...
44

55
## [unreleased][unreleased]
6+
- Added support for Ultralight AES secure messaing in `hf 14a raw` (@iceman1001)
7+
- Added support for Ultralight AES secure messaging in `hf mfu info/rdbl/wrbl/dump/ndefread/wipe/setkey` (@iceman1001)
68
- Added support for Ultralight AES auth in `hf mfu info/rdbl/wrbl/dump/ndefread/wipe/setkey` (@doegox)
79
- Added Ultralight AES basic DataProtKey emulation support (@doegox)
810
- Changed `mem info` and how the signature handling is done (@iceman1001)

armsrc/cmac_calc.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,8 @@ static ulaes_key_t g_secure_session = {
2929
.use_schann = false,
3030
};
3131

32-
// init clears all
33-
void init_secure_session(void) {
32+
// init clears all
33+
void init_secure_session(void) {
3434
g_secure_session.counter = 0;
3535
g_secure_session.use_schann = false;
3636
memset(g_secure_session.cmac_sk1, 0, sizeof(g_secure_session.cmac_sk1));
@@ -75,7 +75,7 @@ static void generate_subkeys(mbedtls_aes_context *ctx, uint8_t *K1, uint8_t *K2)
7575

7676
// Step 2: K1 = L << 1 (with conditional XOR with 0x87)
7777
left_shift_128(L, K1);
78-
if (L[0] & 0x80) {
78+
if (L[0] & 0x80) {
7979
// If MSB is 1
8080
K1[15] ^= 0x87;
8181
}

armsrc/mifareutil.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -575,7 +575,7 @@ int mifare_ultra_aes_auth(uint8_t keyno, uint8_t *keybytes, bool schann) {
575575
rb[6], rb[7], rb[8], rb[9], rb[10], rb[11], rb[12], rb[13], rb[14], rb[15],
576576
ra[8], ra[9], ra[10], ra[11], ra[12], ra[13], ra[14], ra[15]
577577
};
578-
578+
579579
// session key is the CMAC of session_vec using the KEY
580580
ulaes_cmac(key, sizeof(key), session_vec, sizeof(session_vec), sobj->sessionkey);
581581
return 1;

doc/commands.json

Lines changed: 35 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1344,9 +1344,10 @@
13441344
"-w, --wait <us> Wait in microseconds between select and command",
13451345
"--topaz Use Topaz protocol to send command",
13461346
"--crypto1 Use crypto1 session",
1347+
"--schann use secure channel. Must have key",
13471348
"<hex> Raw bytes to send"
13481349
],
1349-
"usage": "hf 14a raw [-hack3rsv] [-t <ms>] [-b <dec>] [-w <us>] [--topaz] [--crypto1] <hex> [<hex>]..."
1350+
"usage": "hf 14a raw [-hack3rsv] [-t <ms>] [-b <dec>] [-w <us>] [--topaz] [--crypto1] [--schann] <hex> [<hex>]..."
13501351
},
13511352
"hf 14a reader": {
13521353
"command": "hf 14a reader",
@@ -7155,17 +7156,19 @@
71557156
"description": "Tests AES key on Mifare Ultralight AES tags. If no key is specified, null key will be tried. Key index 0... DataProtKey (default) Key index 1... UIDRetrKey Key index 2... OriginalityKey",
71567157
"notes": [
71577158
"hf mfu aesauth",
7158-
"hf mfu aesauth --key <16 hex bytes> --idx <0..2>"
7159+
"hf mfu aesauth --key <16 hex bytes> --idx <0..2>",
7160+
"hf mfu aesauth --key <16 hex bytes> --idx <0..2> --schann"
71597161
],
71607162
"offline": false,
71617163
"options": [
71627164
"-h, --help This help",
71637165
"--key <hex> AES key (16 hex bytes)",
71647166
"-i, --idx <0..2> Key index (def: 0)",
71657167
"-l Swap entered key's endianness",
7166-
"-k Keep field on (only if a key is provided)"
7168+
"-k Keep field on (only if a key is provided)",
7169+
"--schann use secure channel. Must have key"
71677170
],
7168-
"usage": "hf mfu aesauth [-hlk] [--key <hex>] [-i <0..2>]"
7171+
"usage": "hf mfu aesauth [-hlk] [--key <hex>] [-i <0..2>] [--schann]"
71697172
},
71707173
"hf mfu amiibo": {
71717174
"command": "hf mfu amiibo",
@@ -7220,9 +7223,10 @@
72207223
"-p, --page <dec> Manually set start page number to start from",
72217224
"-q, --qty <dec> Manually set number of pages to dump",
72227225
"--ns no save to file",
7223-
"-z, --dense dense dump output style"
7226+
"-z, --dense dense dump output style",
7227+
"--schann use secure channel. Must have key"
72247228
],
7225-
"usage": "hf mfu dump [-hlz] [-f <fn>] [-k <hex>] [-p <dec>] [-q <dec>] [--ns]"
7229+
"usage": "hf mfu dump [-hlz] [-f <fn>] [-k <hex>] [-p <dec>] [-q <dec>] [--ns] [--schann]"
72267230
},
72277231
"hf mfu eload": {
72287232
"command": "hf mfu eload",
@@ -7321,9 +7325,10 @@
73217325
"-h, --help This help",
73227326
"-k, --key <hex> Authentication key (UL-C 16 bytes, EV1/NTAG 4 bytes)",
73237327
"-l Swap entered key's endianness",
7324-
"--force override `hw dbg` settings"
7328+
"--force override `hw dbg` settings",
7329+
"--schann use secure channel. Must have key"
73257330
],
7326-
"usage": "hf mfu info [-hl] [-k <hex>] [--force]"
7331+
"usage": "hf mfu info [-hl] [-k <hex>] [--force] [--schann]"
73277332
},
73287333
"hf mfu keygen": {
73297334
"command": "hf mfu keygen",
@@ -7354,9 +7359,10 @@
73547359
"-h, --help This help",
73557360
"-l Swap entered key's endianness",
73567361
"-f, --file <fn> Save raw NDEF to file",
7357-
"-v, --verbose Verbose output"
7362+
"-v, --verbose Verbose output",
7363+
"--schann use secure channel. Must have key"
73587364
],
7359-
"usage": "hf mfu ndefread [-hlv] [-k Replace default key for NDEF] [-f <fn>]"
7365+
"usage": "hf mfu ndefread [-hlv] [-k Replace default key for NDEF] [-f <fn>] [--schann]"
73607366
},
73617367
"hf mfu otptear": {
73627368
"command": "hf mfu otptear",
@@ -7404,17 +7410,19 @@
74047410
"notes": [
74057411
"hf mfu rdbl -b 0",
74067412
"hf mfu rdbl -b 0 -k AABBCCDD",
7407-
"hf mfu rdbl -b 0 --key 00112233445566778899AABBCCDDEEFF"
7413+
"hf mfu rdbl -b 0 --key 00112233445566778899AABBCCDDEEFF",
7414+
"hf mfu rdbl -b 0 --key 00112233445566778899AABBCCDDEEFF --schann"
74087415
],
74097416
"offline": false,
74107417
"options": [
74117418
"-h, --help This help",
74127419
"-k, --key <hex> Authentication key (UL-C/UL-AES 16 bytes, EV1/NTAG 4 bytes)",
74137420
"-l Swap entered key's endianness",
74147421
"-b, --block <dec> Block number to read",
7415-
"--force Force operation even if address is out of range"
7422+
"--force Force operation even if address is out of range",
7423+
"--schann use secure channel. Must have key"
74167424
],
7417-
"usage": "hf mfu rdbl [-hl] [-k <hex>] -b <dec> [--force]"
7425+
"usage": "hf mfu rdbl [-hl] [-k <hex>] -b <dec> [--force] [--schann]"
74187426
},
74197427
"hf mfu restore": {
74207428
"command": "hf mfu restore",
@@ -7528,23 +7536,26 @@
75287536
"description": "Wipe card to zeros. It will ignore block0,1,2,3 you will need to call it with password in order to wipe the config and sett default pwd/pack Abort by pressing a key New password.... FFFFFFFF New 3-DES key... 49454D4B41455242214E4143554F5946 New AES keys... 00000000000000000000000000000000",
75297537
"notes": [
75307538
"hf mfu wipe",
7531-
"hf mfu wipe -k 49454D4B41455242214E4143554F5946"
7539+
"hf mfu wipe -k 49454D4B41455242214E4143554F5946",
7540+
"hf mfu wipe -k 49454D4B41455242214E4143554F5946 --schann"
75327541
],
75337542
"offline": false,
75347543
"options": [
75357544
"-h, --help This help",
75367545
"-k, --key <hex> Key for authentication (UL-C 16 bytes, EV1/NTAG 4 bytes)",
7537-
"-l Swap entered key's endianness"
7546+
"-l Swap entered key's endianness",
7547+
"--schann use secure channel. Must have key"
75387548
],
7539-
"usage": "hf mfu wipe [-hl] [-k <hex>]"
7549+
"usage": "hf mfu wipe [-hl] [-k <hex>] [--schann]"
75407550
},
75417551
"hf mfu wrbl": {
75427552
"command": "hf mfu wrbl",
75437553
"description": "Write a block. It autodetects card type.",
75447554
"notes": [
75457555
"hf mfu wrbl -b 0 -d 01234567",
75467556
"hf mfu wrbl -b 0 -d 01234567 -k AABBCCDD",
7547-
"hf mfu wrbl -b 0 -d 01234567 -k 00112233445566778899AABBCCDDEEFF"
7557+
"hf mfu wrbl -b 0 -d 01234567 -k 00112233445566778899AABBCCDDEEFF",
7558+
"hf mfu wrbl -b 0 -d 01234567 -k 00112233445566778899AABBCCDDEEFF --schann"
75487559
],
75497560
"offline": false,
75507561
"options": [
@@ -7553,9 +7564,10 @@
75537564
"-l Swap entered key's endianness",
75547565
"-b, --block <dec> Block number to write",
75557566
"-d, --data <hex> Block data (4 or 16 hex bytes, 16 hex bytes will do a compatibility write)",
7556-
"--force Force operation even if address is out of range"
7567+
"--force Force operation even if address is out of range",
7568+
"--schann use secure channel. Must have key"
75577569
],
7558-
"usage": "hf mfu wrbl [-hl] [-k <hex>] -b <dec> -d <hex> [--force]"
7570+
"usage": "hf mfu wrbl [-hl] [-k <hex>] -b <dec> -d <hex> [--force] [--schann]"
75597571
},
75607572
"hf ntag424 auth": {
75617573
"command": "hf ntag424 auth",
@@ -12745,9 +12757,10 @@
1274512757
"-h, --help This help",
1274612758
"-l Swap entered key's endianness",
1274712759
"-f, --file <fn> Save raw NDEF to file",
12748-
"-v, --verbose Verbose output"
12760+
"-v, --verbose Verbose output",
12761+
"--schann use secure channel. Must have key"
1274912762
],
12750-
"usage": "hf mfu ndefread [-hlv] [-k Replace default key for NDEF] [-f <fn>]"
12763+
"usage": "hf mfu ndefread [-hlv] [-k Replace default key for NDEF] [-f <fn>] [--schann]"
1275112764
},
1275212765
"nfc type1 read": {
1275312766
"command": "nfc type1 read",
@@ -13670,6 +13683,6 @@
1367013683
"metadata": {
1367113684
"commands_extracted": 784,
1367213685
"extracted_by": "PM3Help2JSON v1.00",
13673-
"extracted_on": "2025-10-14T07:50:15"
13686+
"extracted_on": "2025-10-17T11:36:43"
1367413687
}
1367513688
}

0 commit comments

Comments
 (0)