1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
|
/*
* Licensed Materials - Property of IBM
*
* trousers - An open source TCG Software Stack
*
* (C) Copyright International Business Machines Corp. 2004-2007
*
*/
#ifndef _OBJ_H_
#define _OBJ_H_
#include "threads.h"
/* definitions */
/* When TRUE, the object has PCRs associated with it */
#define TSS_OBJ_FLAG_PCRS 0x00000001
/* When TRUE, the object has a usage auth secret associated with it */
#define TSS_OBJ_FLAG_USAGEAUTH 0x00000002
/* When TRUE, the object has a migration auth secret associated with it */
#define TSS_OBJ_FLAG_MIGAUTH 0x00000004
/* When TRUE, the object has previously been registered in USER PS */
#define TSS_OBJ_FLAG_USER_PS 0x00000008
/* When TRUE, the object has previously been registered in SYSTEM PS */
#define TSS_OBJ_FLAG_SYSTEM_PS 0x00000010
/* When TRUE, the key has been created and cannot be altered */
#define TSS_OBJ_FLAG_KEY_SET 0x00000020
/* structures */
struct tsp_object {
UINT32 handle;
UINT32 tspContext;
TSS_FLAG flags;
void *data;
struct tsp_object *next;
};
struct obj_list {
struct tsp_object *head;
MUTEX_DECLARE(lock);
};
/* prototypes */
TSS_RESULT obj_getTpmObject(UINT32, TSS_HOBJECT *);
TSS_HOBJECT obj_GetPolicyOfObject(UINT32, UINT32);
void __tspi_obj_list_init();
TSS_HOBJECT obj_get_next_handle();
TSS_RESULT obj_list_add(struct obj_list *, UINT32, TSS_FLAG, void *, TSS_HOBJECT *);
TSS_RESULT obj_list_remove(struct obj_list *, void (*)(void *), TSS_HOBJECT, TSS_HCONTEXT);
void obj_list_put(struct obj_list *);
struct tsp_object *obj_list_get_obj(struct obj_list *, UINT32);
struct tsp_object *obj_list_get_tspcontext(struct obj_list *, UINT32);
void obj_list_close(struct obj_list *, void (*)(void *), TSS_HCONTEXT);
void obj_connectContext(TSS_HCONTEXT, TCS_CONTEXT_HANDLE);
void obj_close_context(TSS_HCONTEXT);
void obj_lists_remove_policy_refs(TSS_HPOLICY, TSS_HCONTEXT);
/* prototypes for functions that may traverse more than one list */
TSS_RESULT obj_tcskey_get_pubkeyhash(TCS_KEY_HANDLE, BYTE *);
#include "obj_tpm.h"
#include "obj_context.h"
#include "obj_hash.h"
#include "obj_pcrs.h"
#include "obj_policy.h"
#include "obj_rsakey.h"
#include "obj_encdata.h"
#include "obj_daacred.h"
#include "obj_daaarakey.h"
#include "obj_daaissuerkey.h"
#include "obj_nv.h"
#include "obj_delfamily.h"
#include "obj_migdata.h"
TPM_LIST_DECLARE_EXTERN;
CONTEXT_LIST_DECLARE_EXTERN;
HASH_LIST_DECLARE_EXTERN;
PCRS_LIST_DECLARE_EXTERN;
POLICY_LIST_DECLARE_EXTERN;
RSAKEY_LIST_DECLARE_EXTERN;
ENCDATA_LIST_DECLARE_EXTERN;
DAACRED_LIST_DECLARE_EXTERN;
DAAARAKEY_LIST_DECLARE_EXTERN;
DAAISSUERKEY_LIST_DECLARE_EXTERN;
NVSTORE_LIST_DECLARE_EXTERN;
DELFAMILY_LIST_DECLARE_EXTERN;
MIGDATA_LIST_DECLARE_EXTERN;
#endif
|