- fixed asn1_encode_path - include length value if given
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@740 c6295689-39f2-0310-b995-f0e70906c6a9
This commit is contained in:
parent
98e0f2d720
commit
6df8dbbed3
|
@ -701,12 +701,14 @@ static int asn1_encode_path(struct sc_context *ctx, const struct sc_path *path,
|
|||
u8 **buf, size_t *bufsize, int depth)
|
||||
{
|
||||
int r;
|
||||
struct sc_asn1_entry asn1_path[3];
|
||||
struct sc_asn1_entry asn1_path[4];
|
||||
|
||||
sc_copy_asn1_entry(c_asn1_path, asn1_path);
|
||||
sc_format_asn1_entry(asn1_path + 0, (void *) &path->value, (void *) &path->len, 1);
|
||||
if (path->index)
|
||||
sc_format_asn1_entry(asn1_path + 1, (void *) &path->index, NULL, 1);
|
||||
if (path->count > 0)
|
||||
sc_format_asn1_entry(asn1_path + 2, (void *) &path->count, NULL, 1);
|
||||
r = asn1_encode(ctx, asn1_path, buf, bufsize, depth + 1);
|
||||
return r;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue