- added sc_print_path

git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@1400 c6295689-39f2-0310-b995-f0e70906c6a9
This commit is contained in:
okir 2003-08-29 12:55:30 +00:00
parent 8fcab2199b
commit dc42cd3fa7
2 changed files with 15 additions and 0 deletions

View File

@ -804,6 +804,7 @@ int sc_file_set_type_attr(struct sc_file *file, const u8 *type_attr,
size_t type_attr_len);
void sc_format_path(const char *path_in, struct sc_path *path_out);
const char *sc_print_path(const sc_path_t *path_in);
int sc_append_path(struct sc_path *dest, const struct sc_path *src);
int sc_append_path_id(struct sc_path *dest, const u8 *id, size_t idlen);
int sc_hex_to_bin(const char *in, u8 *out, size_t *outlen);

View File

@ -192,6 +192,20 @@ int sc_append_path_id(struct sc_path *dest, const u8 *id, size_t idlen)
return 0;
}
const char *sc_print_path(const sc_path_t *path)
{
static char buffer[64];
size_t n, len;
buffer[0] = '\0';
if ((len = path->len) >= sizeof(buffer)/2)
len = sizeof(buffer)/2;
for (n = 0; n < len; n++)
sprintf(buffer + 2*n, "%02x", path->value[n]);
return buffer;
}
int sc_file_add_acl_entry(struct sc_file *file, unsigned int operation,
unsigned int method, unsigned long key_ref)
{