use const, add yet another ACL

git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3114 c6295689-39f2-0310-b995-f0e70906c6a9
This commit is contained in:
nils 2007-01-20 12:46:40 +00:00
parent 8cdd0810c7
commit 1b4472ca9f
5 changed files with 6 additions and 4 deletions

View File

@ -103,6 +103,7 @@ extern "C" {
#define SC_AC_OP_INVALIDATE 5
#define SC_AC_OP_LIST_FILES 6
#define SC_AC_OP_CRYPTO 7
#define SC_AC_OP_DELETE_SELF 8
/* If you add more OPs here, make sure you increase
* SC_MAX_AC_OPS in types.h */
@ -1027,7 +1028,7 @@ int sc_file_set_type_attr(sc_file_t *file, const u8 *type_attr,
* @param count number of bytes
* @return SC_SUCCESS on success and an error code otherwise
*/
int sc_path_set(sc_path_t *path, int type, unsigned char *id, size_t id_len,
int sc_path_set(sc_path_t *path, int type, const u8 *id, size_t id_len,
int index, int count);
void sc_format_path(const char *path_in, sc_path_t *path_out);

View File

@ -232,7 +232,7 @@ int sc_wait_for_event(sc_reader_t *readers[], int slot_id[], size_t nslots,
SC_FUNC_RETURN(ctx, 1, r);
}
int sc_path_set(sc_path_t *path, int type, unsigned char *id, size_t id_len,
int sc_path_set(sc_path_t *path, int type, const u8 *id, size_t id_len,
int idx, int count)
{
if (path == NULL || id == NULL || id_len == 0 || id_len > SC_MAX_PATH_SIZE)

View File

@ -65,7 +65,7 @@ typedef struct sc_acl_entry {
struct sc_acl_entry *next;
} sc_acl_entry_t;
#define SC_MAX_AC_OPS 8
#define SC_MAX_AC_OPS 9
typedef struct sc_file {
struct sc_path path;

View File

@ -95,6 +95,7 @@ static struct map fileOpNames[] = {
{ "SELECT", SC_AC_OP_SELECT },
{ "LOCK", SC_AC_OP_LOCK },
{ "DELETE", SC_AC_OP_DELETE },
{ "DELETE_SELF",SC_AC_OP_DELETE_SELF },
{ "CREATE", SC_AC_OP_CREATE },
{ "REHABILITATE",SC_AC_OP_REHABILITATE },
{ "INVALIDATE", SC_AC_OP_INVALIDATE },

View File

@ -441,7 +441,7 @@ static int do_info(int argc, char **argv)
if (file->type == SC_FILE_TYPE_DF) {
const char *ops[] = {
"SELECT", "LOCK", "DELETE", "CREATE", "REHABILITATE",
"INVALIDATE", "LIST FILES"
"INVALIDATE", "LIST FILES", "CRYPTO", "DELETE SELF"
};
if (file->namelen) {
printf("%-15s", "DF name:");