libopensc: add 'crts' array to 'struct sc_acl_entry' ...
For some cards the acl bytes, retrived from 'select' response, can reference a SE (and not directly PIN). In such case, to proceed an authentication for the card operation the information about the SE's CRTs is needed. git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5066 c6295689-39f2-0310-b995-f0e70906c6a9
This commit is contained in:
parent
8f2c96863a
commit
f304fed517
|
@ -395,13 +395,13 @@ const sc_acl_entry_t * sc_file_get_acl_entry(const sc_file_t *file,
|
||||||
{
|
{
|
||||||
sc_acl_entry_t *p;
|
sc_acl_entry_t *p;
|
||||||
static const sc_acl_entry_t e_never = {
|
static const sc_acl_entry_t e_never = {
|
||||||
SC_AC_NEVER, SC_AC_KEY_REF_NONE, NULL
|
SC_AC_NEVER, SC_AC_KEY_REF_NONE, {}, NULL
|
||||||
};
|
};
|
||||||
static const sc_acl_entry_t e_none = {
|
static const sc_acl_entry_t e_none = {
|
||||||
SC_AC_NONE, SC_AC_KEY_REF_NONE, NULL
|
SC_AC_NONE, SC_AC_KEY_REF_NONE, {}, NULL
|
||||||
};
|
};
|
||||||
static const sc_acl_entry_t e_unknown = {
|
static const sc_acl_entry_t e_unknown = {
|
||||||
SC_AC_UNKNOWN, SC_AC_KEY_REF_NONE, NULL
|
SC_AC_UNKNOWN, SC_AC_KEY_REF_NONE, {}, NULL
|
||||||
};
|
};
|
||||||
|
|
||||||
assert(file != NULL);
|
assert(file != NULL);
|
||||||
|
|
|
@ -39,8 +39,8 @@ typedef unsigned char u8;
|
||||||
#define SC_MAX_OBJECT_ID_OCTETS 16
|
#define SC_MAX_OBJECT_ID_OCTETS 16
|
||||||
#define SC_MAX_PATH_SIZE 16
|
#define SC_MAX_PATH_SIZE 16
|
||||||
#define SC_MAX_PATH_STRING_SIZE (SC_MAX_PATH_SIZE * 2 + 1)
|
#define SC_MAX_PATH_STRING_SIZE (SC_MAX_PATH_SIZE * 2 + 1)
|
||||||
|
|
||||||
#define SC_MAX_SDO_ACLS 8
|
#define SC_MAX_SDO_ACLS 8
|
||||||
|
#define SC_MAX_CRTS_IN_SE 12
|
||||||
|
|
||||||
/* When changing this value, pay attention to the initialization of the ASN1
|
/* When changing this value, pay attention to the initialization of the ASN1
|
||||||
* static variables that use this macro, like, for example,
|
* static variables that use this macro, like, for example,
|
||||||
|
@ -97,6 +97,13 @@ typedef struct sc_path {
|
||||||
struct sc_aid aid;
|
struct sc_aid aid;
|
||||||
} sc_path_t;
|
} sc_path_t;
|
||||||
|
|
||||||
|
/* Control reference template */
|
||||||
|
struct sc_crt {
|
||||||
|
unsigned tag;
|
||||||
|
unsigned usage; /* Usage Qualifier Byte */
|
||||||
|
unsigned algo; /* Algorithm ID */
|
||||||
|
unsigned refs[8]; /* Security Object References */
|
||||||
|
};
|
||||||
|
|
||||||
/* Access Control flags */
|
/* Access Control flags */
|
||||||
#define SC_AC_NONE 0x00000000
|
#define SC_AC_NONE 0x00000000
|
||||||
|
@ -149,10 +156,13 @@ typedef struct sc_path {
|
||||||
|
|
||||||
#define SC_AC_KEY_REF_NONE 0xFFFFFFFF
|
#define SC_AC_KEY_REF_NONE 0xFFFFFFFF
|
||||||
|
|
||||||
|
|
||||||
typedef struct sc_acl_entry {
|
typedef struct sc_acl_entry {
|
||||||
unsigned int method; /* See SC_AC_* */
|
unsigned int method; /* See SC_AC_* */
|
||||||
unsigned int key_ref; /* SC_AC_KEY_REF_NONE or an integer */
|
unsigned int key_ref; /* SC_AC_KEY_REF_NONE or an integer */
|
||||||
|
|
||||||
|
struct sc_crt crts[SC_MAX_CRTS_IN_SE];
|
||||||
|
|
||||||
struct sc_acl_entry *next;
|
struct sc_acl_entry *next;
|
||||||
} sc_acl_entry_t;
|
} sc_acl_entry_t;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue