libopensc pkcs15: path is optional for PinAttributes of PinObject
- for 'global' PINs path in not encoded into the AODF; - when selecting pin_reference, start from value defined in profile. git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3946 c6295689-39f2-0310-b995-f0e70906c6a9
This commit is contained in:
parent
33228c7cbc
commit
7f0abe80bb
|
@ -159,7 +159,7 @@ int sc_pkcs15_encode_aodf_entry(sc_context_t *ctx,
|
|||
sc_format_asn1_entry(asn1_pin_attr + 5, &pin->reference, NULL, 1);
|
||||
/* FIXME: check if pad_char present */
|
||||
sc_format_asn1_entry(asn1_pin_attr + 6, &pin->pad_char, &padchar_len, 1);
|
||||
sc_format_asn1_entry(asn1_pin_attr + 8, &pin->path, NULL, 1);
|
||||
sc_format_asn1_entry(asn1_pin_attr + 8, &pin->path, NULL, pin->path.len ? 1 : 0);
|
||||
|
||||
sc_format_asn1_entry(asn1_com_ao_attr + 0, &pin->auth_id, NULL, 1);
|
||||
|
||||
|
|
|
@ -641,8 +641,11 @@ sc_pkcs15init_add_app(sc_card_t *card, struct sc_profile *profile,
|
|||
r = sc_pkcs15init_qualify_pin(card, "SO PIN", args->so_pin_len, &pin_info);
|
||||
SC_TEST_RET(ctx, r, "Failed to qulify SO PIN");
|
||||
|
||||
/* Path encoded only for local SO PIN */
|
||||
if (pin_info.flags & SC_PKCS15_PIN_FLAG_LOCAL)
|
||||
pin_info.path = df->path;
|
||||
|
||||
/* Select the PIN reference */
|
||||
pin_info.path = df->path;
|
||||
if (profile->ops->select_pin_reference) {
|
||||
r = profile->ops->select_pin_reference(profile,
|
||||
card, &pin_info);
|
||||
|
@ -1054,8 +1057,11 @@ sc_pkcs15init_create_pin(sc_pkcs15_card_t *p15card, sc_profile_t *profile,
|
|||
return r;
|
||||
}
|
||||
|
||||
pin_info->path = df->path;
|
||||
pin_info->reference = 0;
|
||||
/* Path encoded only for local PINs */
|
||||
if (pin_info.flags & SC_PKCS15_PIN_FLAG_LOCAL)
|
||||
pin_info->path = df->path;
|
||||
|
||||
/* pin_info->reference = 0; */
|
||||
|
||||
/* Loop until we come up with an acceptable pin reference */
|
||||
while (1) {
|
||||
|
|
Loading…
Reference in New Issue