OLD | NEW |
1 /* This Source Code Form is subject to the terms of the Mozilla Public | 1 /* This Source Code Form is subject to the terms of the Mozilla Public |
2 * License, v. 2.0. If a copy of the MPL was not distributed with this | 2 * License, v. 2.0. If a copy of the MPL was not distributed with this |
3 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ | 3 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ |
4 | 4 |
5 #ifndef DEVT_H | 5 #ifndef DEVT_H |
6 #define DEVT_H | 6 #define DEVT_H |
7 | 7 |
8 /* | 8 /* |
9 * devt.h | 9 * devt.h |
10 * | 10 * |
(...skipping 16 matching lines...) Expand all Loading... |
27 #include "baset.h" | 27 #include "baset.h" |
28 #endif /* BASET_H */ | 28 #endif /* BASET_H */ |
29 | 29 |
30 #include "secmodt.h" | 30 #include "secmodt.h" |
31 | 31 |
32 PR_BEGIN_EXTERN_C | 32 PR_BEGIN_EXTERN_C |
33 | 33 |
34 typedef struct nssSessionStr nssSession; | 34 typedef struct nssSessionStr nssSession; |
35 | 35 |
36 /* XXX until NSSTokenStr is moved */ | 36 /* XXX until NSSTokenStr is moved */ |
37 struct nssDeviceBaseStr | 37 struct nssDeviceBaseStr { |
38 { | 38 NSSArena *arena; |
39 NSSArena *arena; | 39 PZLock *lock; |
40 PZLock *lock; | 40 PRInt32 refCount; |
41 PRInt32 refCount; | 41 NSSUTF8 *name; |
42 NSSUTF8 *name; | 42 PRUint32 flags; |
43 PRUint32 flags; | |
44 }; | 43 }; |
45 | 44 |
46 typedef struct nssTokenObjectCacheStr nssTokenObjectCache; | 45 typedef struct nssTokenObjectCacheStr nssTokenObjectCache; |
47 | 46 |
48 /* XXX until devobject.c goes away */ | 47 /* XXX until devobject.c goes away */ |
49 struct NSSTokenStr | 48 struct NSSTokenStr { |
50 { | |
51 struct nssDeviceBaseStr base; | 49 struct nssDeviceBaseStr base; |
52 NSSSlot *slot; /* Parent (or peer, if you will) */ | 50 NSSSlot *slot; /* Parent (or peer, if you will) */ |
53 CK_FLAGS ckFlags; /* from CK_TOKEN_INFO.flags */ | 51 CK_FLAGS ckFlags; /* from CK_TOKEN_INFO.flags */ |
54 PRUint32 flags; | 52 PRUint32 flags; |
55 void *epv; | 53 void *epv; |
56 nssSession *defaultSession; | 54 nssSession *defaultSession; |
57 NSSTrustDomain *trustDomain; | 55 NSSTrustDomain *trustDomain; |
58 PRIntervalTime lastTime; | 56 PRIntervalTime lastTime; |
59 nssTokenObjectCache *cache; | 57 nssTokenObjectCache *cache; |
60 PK11SlotInfo *pk11slot; | 58 PK11SlotInfo *pk11slot; |
61 }; | 59 }; |
62 | 60 |
63 typedef enum { | 61 typedef enum { |
64 nssSlotAskPasswordTimes_FirstTime = 0, | 62 nssSlotAskPasswordTimes_FirstTime = 0, |
65 nssSlotAskPasswordTimes_EveryTime = 1, | 63 nssSlotAskPasswordTimes_EveryTime = 1, |
66 nssSlotAskPasswordTimes_Timeout = 2 | 64 nssSlotAskPasswordTimes_Timeout = 2 |
67 } | 65 } nssSlotAskPasswordTimes; |
68 nssSlotAskPasswordTimes; | |
69 | 66 |
70 struct nssSlotAuthInfoStr | 67 struct nssSlotAuthInfoStr { |
71 { | 68 PRTime lastLogin; |
72 PRTime lastLogin; | 69 nssSlotAskPasswordTimes askTimes; |
73 nssSlotAskPasswordTimes askTimes; | 70 PRIntervalTime askPasswordTimeout; |
74 PRIntervalTime askPasswordTimeout; | |
75 }; | 71 }; |
76 | 72 |
77 struct NSSSlotStr | 73 struct NSSSlotStr { |
78 { | 74 struct nssDeviceBaseStr base; |
79 struct nssDeviceBaseStr base; | 75 NSSModule *module; /* Parent */ |
80 NSSModule *module; /* Parent */ | 76 NSSToken *token; /* Peer */ |
81 NSSToken *token; /* Peer */ | 77 CK_SLOT_ID slotID; |
82 CK_SLOT_ID slotID; | 78 CK_FLAGS ckFlags; /* from CK_SLOT_INFO.flags */ |
83 CK_FLAGS ckFlags; /* from CK_SLOT_INFO.flags */ | 79 struct nssSlotAuthInfoStr authInfo; |
84 struct nssSlotAuthInfoStr authInfo; | 80 PRIntervalTime lastTokenPing; |
85 PRIntervalTime lastTokenPing; | 81 PZLock *lock; |
86 PZLock *lock; | 82 void *epv; |
87 void *epv; | 83 PK11SlotInfo *pk11slot; |
88 PK11SlotInfo *pk11slot; | |
89 }; | 84 }; |
90 | 85 |
91 struct nssSessionStr | 86 struct nssSessionStr { |
92 { | 87 PZLock *lock; |
93 PZLock *lock; | 88 CK_SESSION_HANDLE handle; |
94 CK_SESSION_HANDLE handle; | 89 NSSSlot *slot; |
95 NSSSlot *slot; | 90 PRBool isRW; |
96 PRBool isRW; | 91 PRBool ownLock; |
97 PRBool ownLock; | |
98 }; | 92 }; |
99 | 93 |
100 typedef enum { | 94 typedef enum { |
101 NSSCertificateType_Unknown = 0, | 95 NSSCertificateType_Unknown = 0, |
102 NSSCertificateType_PKIX = 1 | 96 NSSCertificateType_PKIX = 1 |
103 } NSSCertificateType; | 97 } NSSCertificateType; |
104 | 98 |
105 typedef enum { | 99 typedef enum { |
106 nssTrustLevel_Unknown = 0, | 100 nssTrustLevel_Unknown = 0, |
107 nssTrustLevel_NotTrusted = 1, | 101 nssTrustLevel_NotTrusted = 1, |
108 nssTrustLevel_Trusted = 2, | 102 nssTrustLevel_Trusted = 2, |
109 nssTrustLevel_TrustedDelegator = 3, | 103 nssTrustLevel_TrustedDelegator = 3, |
110 nssTrustLevel_MustVerify = 4, | 104 nssTrustLevel_MustVerify = 4, |
111 nssTrustLevel_ValidDelegator = 5 | 105 nssTrustLevel_ValidDelegator = 5 |
112 } nssTrustLevel; | 106 } nssTrustLevel; |
113 | 107 |
114 typedef struct nssCryptokiInstanceStr nssCryptokiInstance; | 108 typedef struct nssCryptokiInstanceStr nssCryptokiInstance; |
115 | 109 |
116 struct nssCryptokiInstanceStr | 110 struct nssCryptokiInstanceStr { |
117 { | |
118 CK_OBJECT_HANDLE handle; | 111 CK_OBJECT_HANDLE handle; |
119 NSSToken *token; | 112 NSSToken *token; |
120 PRBool isTokenObject; | 113 PRBool isTokenObject; |
121 NSSUTF8 *label; | 114 NSSUTF8 *label; |
122 }; | 115 }; |
123 | 116 |
124 typedef struct nssCryptokiInstanceStr nssCryptokiObject; | 117 typedef struct nssCryptokiInstanceStr nssCryptokiObject; |
125 | 118 |
126 typedef struct nssTokenCertSearchStr nssTokenCertSearch; | 119 typedef struct nssTokenCertSearchStr nssTokenCertSearch; |
127 | 120 |
128 typedef enum { | 121 typedef enum { |
129 nssTokenSearchType_AllObjects = 0, | 122 nssTokenSearchType_AllObjects = 0, |
130 nssTokenSearchType_SessionOnly = 1, | 123 nssTokenSearchType_SessionOnly = 1, |
131 nssTokenSearchType_TokenOnly = 2, | 124 nssTokenSearchType_TokenOnly = 2, |
132 nssTokenSearchType_TokenForced = 3 | 125 nssTokenSearchType_TokenForced = 3 |
133 } nssTokenSearchType; | 126 } nssTokenSearchType; |
134 | 127 |
135 struct nssTokenCertSearchStr | 128 struct nssTokenCertSearchStr { |
136 { | |
137 nssTokenSearchType searchType; | 129 nssTokenSearchType searchType; |
138 PRStatus (* callback)(NSSCertificate *c, void *arg); | 130 PRStatus (*callback)(NSSCertificate *c, void *arg); |
139 void *cbarg; | 131 void *cbarg; |
140 nssList *cached; | 132 nssList *cached; |
141 /* TODO: add a cache query callback if the list would be large | 133 /* TODO: add a cache query callback if the list would be large |
142 * (traversal) | 134 * (traversal) |
143 */ | 135 */ |
144 }; | 136 }; |
145 | 137 |
146 struct nssSlotListStr; | 138 struct nssSlotListStr; |
147 typedef struct nssSlotListStr nssSlotList; | 139 typedef struct nssSlotListStr nssSlotList; |
148 | 140 |
149 struct NSSAlgorithmAndParametersStr | 141 struct NSSAlgorithmAndParametersStr { |
150 { | |
151 CK_MECHANISM mechanism; | 142 CK_MECHANISM mechanism; |
152 }; | 143 }; |
153 | 144 |
154 PR_END_EXTERN_C | 145 PR_END_EXTERN_C |
155 | 146 |
156 #endif /* DEVT_H */ | 147 #endif /* DEVT_H */ |
OLD | NEW |