From 326232de90bad55040b6c8d01b37704ca0da45db Mon Sep 17 00:00:00 2001 From: Viktor Tarasov Date: Sun, 24 Feb 2013 19:29:53 +0100 Subject: [PATCH] libopensc: introduce 'encoded-content' to the sc_file data it's the hold place for the file's initial encoded content. For some cards such data can be included into the file creation command. --- src/libopensc/sc.c | 2 ++ src/libopensc/types.h | 11 +++++++---- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/src/libopensc/sc.c b/src/libopensc/sc.c index 070468ba..590bcd5a 100644 --- a/src/libopensc/sc.c +++ b/src/libopensc/sc.c @@ -518,6 +518,8 @@ void sc_file_free(sc_file_t *file) free(file->prop_attr); if (file->type_attr) free(file->type_attr); + if (file->encoded_content) + free(file->encoded_content); free(file); } diff --git a/src/libopensc/types.h b/src/libopensc/types.h index 79fee1de..9adec68d 100644 --- a/src/libopensc/types.h +++ b/src/libopensc/types.h @@ -218,7 +218,7 @@ typedef struct sc_acl_entry { (at least for SetCOS 4.4 */ typedef struct sc_file { struct sc_path path; - u8 name[16]; /* DF name */ + unsigned char name[16]; /* DF name */ size_t namelen; /* length of DF name */ unsigned int type, ef_structure, status; /* See constant values defined above */ @@ -230,13 +230,16 @@ typedef struct sc_file { int record_length; /* In case of fixed-length or cyclic EF */ int record_count; /* Valid, if not transparent EF or DF */ - u8 *sec_attr; + unsigned char *sec_attr; /* security data in proprietary format. tag '86' */ size_t sec_attr_len; - u8 *prop_attr; + unsigned char *prop_attr; /* */ size_t prop_attr_len; - u8 *type_attr; + unsigned char *type_attr; size_t type_attr_len; + unsigned char *encoded_content; /* file's content encoded to be used in the file creation command */ + size_t encoded_content_len; /* size of file's encoded content in bytes */ + unsigned int magic; } sc_file_t;