aboutsummaryrefslogtreecommitdiff
path: root/libstb/secvar/secvar.h
diff options
context:
space:
mode:
Diffstat (limited to 'libstb/secvar/secvar.h')
-rw-r--r--libstb/secvar/secvar.h24
1 files changed, 9 insertions, 15 deletions
diff --git a/libstb/secvar/secvar.h b/libstb/secvar/secvar.h
index b141b70..fe66021 100644
--- a/libstb/secvar/secvar.h
+++ b/libstb/secvar/secvar.h
@@ -16,24 +16,18 @@ enum {
};
-struct secvar_node {
- struct list_node link;
- struct secvar *var;
- uint64_t flags; // Flag for how *var should be stored
- uint64_t size; // How much space was allocated for data
-};
-
#define SECVAR_FLAG_VOLATILE 0x1 // Instructs storage driver to ignore variable on writes
#define SECVAR_FLAG_SECURE_STORAGE 0x2 // Hint for storage driver to select storage location
struct secvar {
+ struct list_node link;
uint64_t key_len;
uint64_t data_size;
- char key[SECVAR_MAX_KEY_LEN];
- char data[0];
+ uint64_t flags;
+ char *key;
+ char *data;
};
-
extern struct list_head variable_bank;
extern struct list_head update_bank;
extern int secvar_enabled;
@@ -44,13 +38,13 @@ extern struct secvar_backend_driver secvar_backend;
// Helper functions
void clear_bank_list(struct list_head *bank);
int copy_bank_list(struct list_head *dst, struct list_head *src);
-struct secvar_node *alloc_secvar(uint64_t size);
-struct secvar_node *new_secvar(const char *key, uint64_t key_len,
+struct secvar *alloc_secvar(uint64_t key_len, uint64_t data_size);
+struct secvar *new_secvar(const char *key, uint64_t key_len,
const char *data, uint64_t data_size,
uint64_t flags);
-int realloc_secvar(struct secvar_node *node, uint64_t size);
-void dealloc_secvar(struct secvar_node *node);
-struct secvar_node *find_secvar(const char *key, uint64_t key_len, struct list_head *bank);
+int realloc_secvar(struct secvar *node, uint64_t size);
+void dealloc_secvar(struct secvar *node);
+struct secvar *find_secvar(const char *key, uint64_t key_len, struct list_head *bank);
int is_key_empty(const char *key, uint64_t key_len);
int list_length(struct list_head *bank);