Add support to PIN POLICY URL via VendorConfig.
Signed-off-by: Pol Henarejos <pol.henarejos@cttc.es>
This commit is contained in:
@@ -35,6 +35,10 @@ int cbor_get_info() {
|
||||
#else
|
||||
lfields++;
|
||||
#endif
|
||||
file_t *ef_pin_policy = search_by_fid(EF_PIN_COMPLEXITY_POLICY, NULL, SPECIFY_EF);
|
||||
if (file_has_data(ef_pin_policy)) {
|
||||
lfields += 2;
|
||||
}
|
||||
CBOR_CHECK(cbor_encoder_create_map(&encoder, &mapEncoder, lfields));
|
||||
|
||||
CBOR_CHECK(cbor_encode_uint(&mapEncoder, 0x01));
|
||||
@@ -164,7 +168,7 @@ int cbor_get_info() {
|
||||
if (phy_data.vid != 0x1050) {
|
||||
#endif
|
||||
CBOR_CHECK(cbor_encode_uint(&mapEncoder, 0x15));
|
||||
uint8_t enabled_cmds = 3;
|
||||
uint8_t enabled_cmds = 4;
|
||||
#ifndef ENABLE_EMULATION
|
||||
enabled_cmds += 4;
|
||||
#endif
|
||||
@@ -172,6 +176,7 @@ int cbor_get_info() {
|
||||
CBOR_CHECK(cbor_encode_uint(&arrayEncoder, CTAP_CONFIG_AUT_ENABLE));
|
||||
CBOR_CHECK(cbor_encode_uint(&arrayEncoder, CTAP_CONFIG_AUT_DISABLE));
|
||||
CBOR_CHECK(cbor_encode_uint(&arrayEncoder, CTAP_CONFIG_EA_UPLOAD));
|
||||
CBOR_CHECK(cbor_encode_uint(&arrayEncoder, CTAP_CONFIG_PIN_POLICY));
|
||||
#ifndef ENABLE_EMULATION
|
||||
CBOR_CHECK(cbor_encode_uint(&arrayEncoder, CTAP_CONFIG_PHY_VIDPID));
|
||||
CBOR_CHECK(cbor_encode_uint(&arrayEncoder, CTAP_CONFIG_PHY_LED_BTNESS));
|
||||
@@ -181,6 +186,13 @@ int cbor_get_info() {
|
||||
CBOR_CHECK(cbor_encoder_close_container(&mapEncoder, &arrayEncoder));
|
||||
#ifndef ENABLE_EMULATION
|
||||
}
|
||||
if (file_has_data(ef_pin_policy)) {
|
||||
CBOR_CHECK(cbor_encode_uint(&mapEncoder, 0x1B));
|
||||
CBOR_CHECK(cbor_encode_boolean(&mapEncoder, true));
|
||||
CBOR_CHECK(cbor_encode_uint(&mapEncoder, 0x1C));
|
||||
CBOR_CHECK(cbor_encode_byte_string(&mapEncoder, file_get_data(ef_pin_policy) + 2, file_get_size(ef_pin_policy) - 2));
|
||||
}
|
||||
|
||||
#endif
|
||||
CBOR_CHECK(cbor_encoder_close_container(&encoder, &mapEncoder));
|
||||
err:
|
||||
|
||||
Reference in New Issue
Block a user