Skip to content

Commit 8df7a49

Browse files
committed
1 parent d2c0b17 commit 8df7a49

File tree

2 files changed

+23
-1
lines changed

2 files changed

+23
-1
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ 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 identification of NDEF/Open print tag record (@iceman1001)
67
- Added support for Bruce dump files [.rfid] (@iceman1001)
78
- Added script `read_t-union.py` (@klks)
89
- Added better ECP configuration aliases (@kormax)

client/src/nfc/ndef.c

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,8 @@
4242
#define NDEF_BLUEAPPL_LE "application/vnd.bluetooth.le.oob"
4343
#define NDEF_BLUEAPPL_SECURE_LE "application/vnd.bluetooth.secure.le.oob"
4444

45+
#define NDEF_OPENPRINT_TAG "application/vnd.openprinttag"
46+
4547
#define NDEF_ANDROID_PROVISION "application/com.android.managedprovisioning"
4648
#define NDEF_IMAGE "image/"
4749

@@ -828,6 +830,19 @@ static int ndefDecodeMime_wifi_p2p(NDEFHeader_t *ndef) {
828830
return PM3_SUCCESS;
829831
}
830832

833+
static int ndefDecodeMime_openprint_tag(NDEFHeader_t *ndef) {
834+
if (ndef->PayloadLen == 0) {
835+
PrintAndLogEx(INFO, "no payload");
836+
return PM3_SUCCESS;
837+
}
838+
839+
PrintAndLogEx(INFO, _CYAN_("NDEF Open Print Tag Record"));
840+
PrintAndLogEx(INFO, "Type............ " _YELLOW_("%.*s"), (int)ndef->TypeLen, ndef->Type);
841+
PrintAndLogEx(INFO, "to be implemented, feel free to contribute!");
842+
return PM3_SUCCESS;
843+
}
844+
845+
831846
static int ndefDecodeMime_vcard(NDEFHeader_t *ndef) {
832847
if (ndef->PayloadLen == 0) {
833848
PrintAndLogEx(INFO, "no payload");
@@ -1090,20 +1105,23 @@ static int ndefDecodePayload(NDEFHeader_t *ndef, bool verbose) {
10901105
if (str_startswith(begin, NDEF_WIFIAPPL_WSC)) {
10911106
ndefDecodeMime_wifi_wsc(ndef);
10921107
}
1108+
10931109
if (str_startswith(begin, NDEF_WIFIAPPL_P2P)) {
10941110
ndefDecodeMime_wifi_p2p(ndef);
10951111
}
1112+
10961113
if (str_startswith(begin, NDEF_VCARDTEXT) || str_startswith(begin, NDEF_XVCARDTEXT)) {
10971114
ndefDecodeMime_vcard(ndef);
10981115
}
10991116

1100-
11011117
if (str_startswith(begin, NDEF_BLUEAPPL_EP)) {
11021118
ndefDecodeMime_bt(ndef);
11031119
}
1120+
11041121
if (str_startswith(begin, NDEF_BLUEAPPL_SECURE_LE)) {
11051122
ndefDecodeMime_bt_secure_le_oob(ndef);
11061123
}
1124+
11071125
if (str_startswith(begin, NDEF_BLUEAPPL_LE)) {
11081126
ndefDecodeMime_bt_le_oob(ndef);
11091127
}
@@ -1120,6 +1138,9 @@ static int ndefDecodePayload(NDEFHeader_t *ndef, bool verbose) {
11201138
ndefDecodeMime_image(ndef);
11211139
}
11221140

1141+
if (str_startswith(begin, NDEF_OPENPRINT_TAG)) {
1142+
ndefDecodeMime_openprint_tag(ndef);
1143+
}
11231144
free(begin);
11241145
begin = NULL;
11251146
break;

0 commit comments

Comments
 (0)