mirror of
https://github.com/RfidResearchGroup/proxmark3.git
synced 2025-02-27 01:25:41 +08:00
textual and cleanup
This commit is contained in:
parent
97dced62f4
commit
aa05e2eeae
1 changed files with 9 additions and 11 deletions
|
@ -166,7 +166,7 @@ static void asn1_tag_dump_str_time(const struct tlv *tlv, const struct asn1_tag
|
||||||
break;
|
break;
|
||||||
|
|
||||||
// time zone
|
// time zone
|
||||||
PrintAndLogEx(NORMAL, " zone: %.*s" NOLF, len - startidx - 10, tlv->value + startidx + 10);
|
PrintAndLogEx(NORMAL, " zone: UTC %.*s" NOLF, len - startidx - 10, tlv->value + startidx + 10);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
PrintAndLogEx(NORMAL, "'");
|
PrintAndLogEx(NORMAL, "'");
|
||||||
|
@ -177,7 +177,7 @@ static void asn1_tag_dump_str_time(const struct tlv *tlv, const struct asn1_tag
|
||||||
}
|
}
|
||||||
|
|
||||||
static void asn1_tag_dump_string(const struct tlv *tlv, const struct asn1_tag *tag, int level) {
|
static void asn1_tag_dump_string(const struct tlv *tlv, const struct asn1_tag *tag, int level) {
|
||||||
PrintAndLogEx(NORMAL, " value: '" _GREEN_("%.*s") "' hex: '%s'", tlv->len, tlv->value, sprint_hex(tlv->value, tlv->len));
|
PrintAndLogEx(NORMAL, " value: '" _GREEN_("%.*s") "' hex: '%s'", (int)tlv->len, tlv->value, sprint_hex(tlv->value, tlv->len));
|
||||||
}
|
}
|
||||||
|
|
||||||
static void asn1_tag_dump_bitstring(const struct tlv *tlv, const struct asn1_tag *tag, int level) {
|
static void asn1_tag_dump_bitstring(const struct tlv *tlv, const struct asn1_tag *tag, int level) {
|
||||||
|
@ -232,20 +232,17 @@ static void asn1_tag_dump_hex(const struct tlv *tlv, const struct asn1_tag *tag,
|
||||||
PrintAndLogEx(NORMAL, " value: '%s'", sprint_hex_inrow(tlv->value, tlv->len));
|
PrintAndLogEx(NORMAL, " value: '%s'", sprint_hex_inrow(tlv->value, tlv->len));
|
||||||
}
|
}
|
||||||
|
|
||||||
static void asn1_tag_dump_octet_string(const struct tlv *tlv, const struct asn1_tag *tag, int level, bool *needdump) {
|
static void asn1_tag_dump_octet_string(const struct tlv *tlv, const struct asn1_tag *tag, int level) {
|
||||||
*needdump = false;
|
/*
|
||||||
for (size_t i = 0; i < tlv->len; i++)
|
for (size_t i = 0; i < tlv->len; i++) {
|
||||||
if (!isspace(tlv->value[i]) && !isprint(tlv->value[i])) {
|
if (!isspace(tlv->value[i]) && !isprint(tlv->value[i])) {
|
||||||
*needdump = true;
|
*needdump = true;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
if (*needdump) {
|
*/
|
||||||
PrintAndLogEx(NORMAL, "");
|
|
||||||
} else {
|
|
||||||
PrintAndLogEx(NORMAL, " " NOLF);
|
PrintAndLogEx(NORMAL, " " NOLF);
|
||||||
asn1_tag_dump_string(tlv, tag, level);
|
asn1_tag_dump_string(tlv, tag, level);
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void asn1_tag_dump_boolean(const struct tlv *tlv, const struct asn1_tag *tag, int level) {
|
static void asn1_tag_dump_boolean(const struct tlv *tlv, const struct asn1_tag *tag, int level) {
|
||||||
|
@ -399,7 +396,8 @@ bool asn1_tag_dump(const struct tlv *tlv, int level, bool *candump) {
|
||||||
*candump = false;
|
*candump = false;
|
||||||
break;
|
break;
|
||||||
case ASN1_TAG_OCTET_STRING:
|
case ASN1_TAG_OCTET_STRING:
|
||||||
asn1_tag_dump_octet_string(tlv, tag, level, candump);
|
asn1_tag_dump_octet_string(tlv, tag, level);
|
||||||
|
*candump = false;
|
||||||
break;
|
break;
|
||||||
case ASN1_TAG_BOOLEAN:
|
case ASN1_TAG_BOOLEAN:
|
||||||
asn1_tag_dump_boolean(tlv, tag, level);
|
asn1_tag_dump_boolean(tlv, tag, level);
|
||||||
|
|
Loading…
Reference in a new issue