accept a hex string for community id
This commit is contained in:
@@ -287,6 +287,8 @@ main (int argc, char **argv)
|
|||||||
size_t privkey_len = 0;
|
size_t privkey_len = 0;
|
||||||
unsigned char auxiliary_data[0xff];
|
unsigned char auxiliary_data[0xff];
|
||||||
size_t auxiliary_data_len = 0;
|
size_t auxiliary_data_len = 0;
|
||||||
|
unsigned char community_id[0xf];
|
||||||
|
size_t community_id_len = 0;
|
||||||
|
|
||||||
sc_context_t *ctx = NULL;
|
sc_context_t *ctx = NULL;
|
||||||
sc_card_t *card = NULL;
|
sc_card_t *card = NULL;
|
||||||
@@ -605,10 +607,15 @@ main (int argc, char **argv)
|
|||||||
goto err;
|
goto err;
|
||||||
}
|
}
|
||||||
if (cmdline.verify_community_given) {
|
if (cmdline.verify_community_given) {
|
||||||
|
community_id_len = sizeof community_id;
|
||||||
|
if (sc_hex_to_bin(cmdline.verify_community_arg, community_id,
|
||||||
|
&community_id_len) < 0) {
|
||||||
|
fprintf(stderr, "Could not parse community ID.\n");
|
||||||
|
exit(2);
|
||||||
|
}
|
||||||
r = add_to_ASN1_AUXILIARY_DATA(&templates,
|
r = add_to_ASN1_AUXILIARY_DATA(&templates,
|
||||||
NID_id_CommunityID,
|
NID_id_CommunityID,
|
||||||
(unsigned char *) cmdline.verify_community_arg,
|
community_id, community_id_len);
|
||||||
strlen(cmdline.verify_community_arg));
|
|
||||||
if (r < 0)
|
if (r < 0)
|
||||||
goto err;
|
goto err;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -69,7 +69,7 @@ option "chat" -
|
|||||||
typestr="HEX_STRING"
|
typestr="HEX_STRING"
|
||||||
optional
|
optional
|
||||||
option "auxiliary-data" A
|
option "auxiliary-data" A
|
||||||
"Terminal's auxiliary data (default is determined by age verification and community id verification)."
|
"Terminal's auxiliary data (default is determined by verification of validity, age and community ID)."
|
||||||
string
|
string
|
||||||
typestr="HEX_STRING"
|
typestr="HEX_STRING"
|
||||||
optional
|
optional
|
||||||
@@ -189,7 +189,7 @@ option "write-dg21" -
|
|||||||
|
|
||||||
section "Verification of validity, age and community ID"
|
section "Verification of validity, age and community ID"
|
||||||
option "verify-validity" -
|
option "verify-validity" -
|
||||||
"Verify the chip's validity with a reference date"
|
"Verify chip's validity with a reference date"
|
||||||
string
|
string
|
||||||
typestr="YYYYMMDD"
|
typestr="YYYYMMDD"
|
||||||
optional
|
optional
|
||||||
@@ -201,6 +201,7 @@ option "older-than" -
|
|||||||
option "verify-community" -
|
option "verify-community" -
|
||||||
"Verify community ID with a reference ID"
|
"Verify community ID with a reference ID"
|
||||||
string
|
string
|
||||||
|
typestr="HEX_STRING"
|
||||||
optional
|
optional
|
||||||
|
|
||||||
section "Special options, not always useful"
|
section "Special options, not always useful"
|
||||||
|
|||||||
Reference in New Issue
Block a user