Thu, 22 Jan 2015 13:21:57 +0100
Incorporate requested changes from Mozilla in review:
https://bugzilla.mozilla.org/show_bug.cgi?id=1123480#c6
michael@0 | 1 | /* This Source Code Form is subject to the terms of the Mozilla Public |
michael@0 | 2 | * License, v. 2.0. If a copy of the MPL was not distributed with this |
michael@0 | 3 | * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ |
michael@0 | 4 | |
michael@0 | 5 | #ifndef DEVM_H |
michael@0 | 6 | #define DEVM_H |
michael@0 | 7 | |
michael@0 | 8 | #ifndef BASE_H |
michael@0 | 9 | #include "base.h" |
michael@0 | 10 | #endif /* BASE_H */ |
michael@0 | 11 | |
michael@0 | 12 | #ifndef DEV_H |
michael@0 | 13 | #include "dev.h" |
michael@0 | 14 | #endif /* DEV_H */ |
michael@0 | 15 | |
michael@0 | 16 | #ifndef DEVTM_H |
michael@0 | 17 | #include "devtm.h" |
michael@0 | 18 | #endif /* DEVTM_H */ |
michael@0 | 19 | |
michael@0 | 20 | PR_BEGIN_EXTERN_C |
michael@0 | 21 | |
michael@0 | 22 | /* Shortcut to cryptoki API functions. */ |
michael@0 | 23 | #define CKAPI(epv) \ |
michael@0 | 24 | ((CK_FUNCTION_LIST_PTR)(epv)) |
michael@0 | 25 | |
michael@0 | 26 | NSS_EXTERN void |
michael@0 | 27 | nssDevice_AddRef |
michael@0 | 28 | ( |
michael@0 | 29 | struct nssDeviceBaseStr *device |
michael@0 | 30 | ); |
michael@0 | 31 | |
michael@0 | 32 | NSS_EXTERN PRBool |
michael@0 | 33 | nssDevice_Destroy |
michael@0 | 34 | ( |
michael@0 | 35 | struct nssDeviceBaseStr *device |
michael@0 | 36 | ); |
michael@0 | 37 | |
michael@0 | 38 | NSS_EXTERN PRBool |
michael@0 | 39 | nssModule_IsThreadSafe |
michael@0 | 40 | ( |
michael@0 | 41 | NSSModule *module |
michael@0 | 42 | ); |
michael@0 | 43 | |
michael@0 | 44 | NSS_EXTERN PRBool |
michael@0 | 45 | nssModule_IsInternal |
michael@0 | 46 | ( |
michael@0 | 47 | NSSModule *mod |
michael@0 | 48 | ); |
michael@0 | 49 | |
michael@0 | 50 | NSS_EXTERN PRBool |
michael@0 | 51 | nssModule_IsModuleDBOnly |
michael@0 | 52 | ( |
michael@0 | 53 | NSSModule *mod |
michael@0 | 54 | ); |
michael@0 | 55 | |
michael@0 | 56 | NSS_EXTERN void * |
michael@0 | 57 | nssModule_GetCryptokiEPV |
michael@0 | 58 | ( |
michael@0 | 59 | NSSModule *mod |
michael@0 | 60 | ); |
michael@0 | 61 | |
michael@0 | 62 | NSS_EXTERN NSSSlot * |
michael@0 | 63 | nssSlot_Create |
michael@0 | 64 | ( |
michael@0 | 65 | CK_SLOT_ID slotId, |
michael@0 | 66 | NSSModule *parent |
michael@0 | 67 | ); |
michael@0 | 68 | |
michael@0 | 69 | NSS_EXTERN void * |
michael@0 | 70 | nssSlot_GetCryptokiEPV |
michael@0 | 71 | ( |
michael@0 | 72 | NSSSlot *slot |
michael@0 | 73 | ); |
michael@0 | 74 | |
michael@0 | 75 | NSS_EXTERN NSSToken * |
michael@0 | 76 | nssToken_Create |
michael@0 | 77 | ( |
michael@0 | 78 | CK_SLOT_ID slotID, |
michael@0 | 79 | NSSSlot *peer |
michael@0 | 80 | ); |
michael@0 | 81 | |
michael@0 | 82 | NSS_EXTERN void * |
michael@0 | 83 | nssToken_GetCryptokiEPV |
michael@0 | 84 | ( |
michael@0 | 85 | NSSToken *token |
michael@0 | 86 | ); |
michael@0 | 87 | |
michael@0 | 88 | NSS_EXTERN nssSession * |
michael@0 | 89 | nssToken_GetDefaultSession |
michael@0 | 90 | ( |
michael@0 | 91 | NSSToken *token |
michael@0 | 92 | ); |
michael@0 | 93 | |
michael@0 | 94 | NSS_EXTERN PRBool |
michael@0 | 95 | nssToken_IsLoginRequired |
michael@0 | 96 | ( |
michael@0 | 97 | NSSToken *token |
michael@0 | 98 | ); |
michael@0 | 99 | |
michael@0 | 100 | NSS_EXTERN void |
michael@0 | 101 | nssToken_Remove |
michael@0 | 102 | ( |
michael@0 | 103 | NSSToken *token |
michael@0 | 104 | ); |
michael@0 | 105 | |
michael@0 | 106 | NSS_EXTERN nssCryptokiObject * |
michael@0 | 107 | nssCryptokiObject_Create |
michael@0 | 108 | ( |
michael@0 | 109 | NSSToken *t, |
michael@0 | 110 | nssSession *session, |
michael@0 | 111 | CK_OBJECT_HANDLE h |
michael@0 | 112 | ); |
michael@0 | 113 | |
michael@0 | 114 | NSS_EXTERN nssTokenObjectCache * |
michael@0 | 115 | nssTokenObjectCache_Create |
michael@0 | 116 | ( |
michael@0 | 117 | NSSToken *token, |
michael@0 | 118 | PRBool cacheCerts, |
michael@0 | 119 | PRBool cacheTrust, |
michael@0 | 120 | PRBool cacheCRLs |
michael@0 | 121 | ); |
michael@0 | 122 | |
michael@0 | 123 | NSS_EXTERN void |
michael@0 | 124 | nssTokenObjectCache_Destroy |
michael@0 | 125 | ( |
michael@0 | 126 | nssTokenObjectCache *cache |
michael@0 | 127 | ); |
michael@0 | 128 | |
michael@0 | 129 | NSS_EXTERN void |
michael@0 | 130 | nssTokenObjectCache_Clear |
michael@0 | 131 | ( |
michael@0 | 132 | nssTokenObjectCache *cache |
michael@0 | 133 | ); |
michael@0 | 134 | |
michael@0 | 135 | NSS_EXTERN PRBool |
michael@0 | 136 | nssTokenObjectCache_HaveObjectClass |
michael@0 | 137 | ( |
michael@0 | 138 | nssTokenObjectCache *cache, |
michael@0 | 139 | CK_OBJECT_CLASS objclass |
michael@0 | 140 | ); |
michael@0 | 141 | |
michael@0 | 142 | NSS_EXTERN nssCryptokiObject ** |
michael@0 | 143 | nssTokenObjectCache_FindObjectsByTemplate |
michael@0 | 144 | ( |
michael@0 | 145 | nssTokenObjectCache *cache, |
michael@0 | 146 | CK_OBJECT_CLASS objclass, |
michael@0 | 147 | CK_ATTRIBUTE_PTR otemplate, |
michael@0 | 148 | CK_ULONG otlen, |
michael@0 | 149 | PRUint32 maximumOpt, |
michael@0 | 150 | PRStatus *statusOpt |
michael@0 | 151 | ); |
michael@0 | 152 | |
michael@0 | 153 | NSS_EXTERN PRStatus |
michael@0 | 154 | nssTokenObjectCache_GetObjectAttributes |
michael@0 | 155 | ( |
michael@0 | 156 | nssTokenObjectCache *cache, |
michael@0 | 157 | NSSArena *arenaOpt, |
michael@0 | 158 | nssCryptokiObject *object, |
michael@0 | 159 | CK_OBJECT_CLASS objclass, |
michael@0 | 160 | CK_ATTRIBUTE_PTR atemplate, |
michael@0 | 161 | CK_ULONG atlen |
michael@0 | 162 | ); |
michael@0 | 163 | |
michael@0 | 164 | NSS_EXTERN PRStatus |
michael@0 | 165 | nssTokenObjectCache_ImportObject |
michael@0 | 166 | ( |
michael@0 | 167 | nssTokenObjectCache *cache, |
michael@0 | 168 | nssCryptokiObject *object, |
michael@0 | 169 | CK_OBJECT_CLASS objclass, |
michael@0 | 170 | CK_ATTRIBUTE_PTR ot, |
michael@0 | 171 | CK_ULONG otlen |
michael@0 | 172 | ); |
michael@0 | 173 | |
michael@0 | 174 | NSS_EXTERN void |
michael@0 | 175 | nssTokenObjectCache_RemoveObject |
michael@0 | 176 | ( |
michael@0 | 177 | nssTokenObjectCache *cache, |
michael@0 | 178 | nssCryptokiObject *object |
michael@0 | 179 | ); |
michael@0 | 180 | |
michael@0 | 181 | /* XXX allows peek back into token */ |
michael@0 | 182 | NSS_EXTERN PRStatus |
michael@0 | 183 | nssToken_GetCachedObjectAttributes |
michael@0 | 184 | ( |
michael@0 | 185 | NSSToken *token, |
michael@0 | 186 | NSSArena *arenaOpt, |
michael@0 | 187 | nssCryptokiObject *object, |
michael@0 | 188 | CK_OBJECT_CLASS objclass, |
michael@0 | 189 | CK_ATTRIBUTE_PTR atemplate, |
michael@0 | 190 | CK_ULONG atlen |
michael@0 | 191 | ); |
michael@0 | 192 | |
michael@0 | 193 | /* PKCS#11 stores strings in a fixed-length buffer padded with spaces. This |
michael@0 | 194 | * function gets the length of the actual string. |
michael@0 | 195 | */ |
michael@0 | 196 | NSS_EXTERN PRUint32 |
michael@0 | 197 | nssPKCS11String_Length |
michael@0 | 198 | ( |
michael@0 | 199 | CK_CHAR *pkcs11str, |
michael@0 | 200 | PRUint32 bufLen |
michael@0 | 201 | ); |
michael@0 | 202 | |
michael@0 | 203 | PR_END_EXTERN_C |
michael@0 | 204 | |
michael@0 | 205 | #endif /* DEV_H */ |