Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(171)

Side by Side Diff: mozilla/security/nss/lib/pk11wrap/secmodi.h

Issue 14249009: Change the NSS and NSPR source tree to the new directory structure to be (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/deps/third_party/nss/
Patch Set: Created 7 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « mozilla/security/nss/lib/pk11wrap/secmod.h ('k') | mozilla/security/nss/lib/pk11wrap/secmodt.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
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
3 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
4 /*
5 * Internal header file included only by files in pkcs11 dir, or in
6 * pkcs11 specific client and server files.
7 */
8 #ifndef _SECMODI_H_
9 #define _SECMODI_H_ 1
10 #include "pkcs11.h"
11 #include "nssilock.h"
12 #include "secoidt.h"
13 #include "secdert.h"
14 #include "certt.h"
15 #include "secmodt.h"
16 #include "keyt.h"
17
18 SEC_BEGIN_PROTOS
19
20 /* proto-types */
21 extern SECStatus SECMOD_DeletePermDB(SECMODModule *module);
22 extern SECStatus SECMOD_AddPermDB(SECMODModule *module);
23 extern SECStatus SECMOD_Shutdown(void);
24 void nss_DumpModuleLog(void);
25
26 extern int secmod_PrivateModuleCount;
27
28 extern void SECMOD_Init(void);
29 SECStatus secmod_ModuleInit(SECMODModule *mod, SECMODModule **oldModule,
30 PRBool* alreadyLoaded);
31
32 /* list managment */
33 extern SECStatus SECMOD_AddModuleToList(SECMODModule *newModule);
34 extern SECStatus SECMOD_AddModuleToDBOnlyList(SECMODModule *newModule);
35 extern SECStatus SECMOD_AddModuleToUnloadList(SECMODModule *newModule);
36 extern void SECMOD_RemoveList(SECMODModuleList **,SECMODModuleList *);
37 extern void SECMOD_AddList(SECMODModuleList *,SECMODModuleList *,SECMODListLock *);
38 extern SECMODListLock *SECMOD_NewListLock(void);
39 extern void SECMOD_DestroyListLock(SECMODListLock *);
40 extern void SECMOD_GetWriteLock(SECMODListLock *);
41 extern void SECMOD_ReleaseWriteLock(SECMODListLock *);
42
43 /* Operate on modules by name */
44 extern SECMODModule *SECMOD_FindModuleByID(SECMODModuleID);
45 extern SECMODModule *secmod_FindModuleByFuncPtr(void *funcPtr);
46
47 /* database/memory management */
48 extern SECMODModuleList *SECMOD_NewModuleListElement(void);
49 extern SECMODModuleList *SECMOD_DestroyModuleListElement(SECMODModuleList *);
50 extern void SECMOD_DestroyModuleList(SECMODModuleList *);
51 extern SECStatus SECMOD_AddModule(SECMODModule *newModule);
52
53 extern unsigned long SECMOD_InternaltoPubMechFlags(unsigned long internalFlags);
54 extern unsigned long SECMOD_InternaltoPubCipherFlags(unsigned long internalFlags );
55
56 /* Library functions */
57 SECStatus secmod_LoadPKCS11Module(SECMODModule *, SECMODModule **oldModule);
58 SECStatus SECMOD_UnloadModule(SECMODModule *);
59 void SECMOD_SetInternalModule(SECMODModule *);
60 PRBool secmod_IsInternalKeySlot(SECMODModule *);
61 void secmod_SetInternalKeySlotFlag(SECMODModule *mod, PRBool val);
62
63
64 /* tools for checking if we are loading the same database twice */
65 typedef struct SECMODConfigListStr SECMODConfigList;
66 /* collect all the databases in a given spec */
67 SECMODConfigList *secmod_GetConfigList(PRBool isFIPS, char *spec, int *count);
68 /* see is a spec matches a database on the list */
69 PRBool secmod_MatchConfigList(char *spec,
70 SECMODConfigList *conflist, int count);
71 /* free our list of databases */
72 void secmod_FreeConfigList(SECMODConfigList *conflist, int count);
73
74 /* parsing parameters */
75 /* returned char * must be freed by caller with PORT_Free */
76 /* children and ids are null terminated arrays which must be freed with
77 * secmod_FreeChildren */
78 char *secmod_ParseModuleSpecForTokens(PRBool convert,
79 PRBool isFIPS,
80 char *moduleSpec,
81 char ***children,
82 CK_SLOT_ID **ids);
83 void secmod_FreeChildren(char **children, CK_SLOT_ID *ids);
84 char *secmod_MkAppendTokensList(PRArenaPool *arena, char *origModuleSpec,
85 char *newModuleSpec, CK_SLOT_ID newID,
86 char **children, CK_SLOT_ID *ids);
87
88
89 void SECMOD_SlotDestroyModule(SECMODModule *module, PRBool fromSlot);
90 CK_RV pk11_notify(CK_SESSION_HANDLE session, CK_NOTIFICATION event,
91 CK_VOID_PTR pdata);
92 void pk11_SignedToUnsigned(CK_ATTRIBUTE *attrib);
93 CK_OBJECT_HANDLE pk11_FindObjectByTemplate(PK11SlotInfo *slot,
94 CK_ATTRIBUTE *inTemplate,int tsize);
95 CK_OBJECT_HANDLE *pk11_FindObjectsByTemplate(PK11SlotInfo *slot,
96 CK_ATTRIBUTE *inTemplate,int tsize, int *objCount);
97 SECStatus PK11_UpdateSlotAttribute(PK11SlotInfo *slot,
98 PK11DefaultArrayEntry *entry, PRBool add);
99
100 #define PK11_GETTAB(x) ((CK_FUNCTION_LIST_PTR)((x)->functionList))
101 #define PK11_SETATTRS(x,id,v,l) (x)->type = (id); \
102 (x)->pValue=(v); (x)->ulValueLen = (l);
103 SECStatus PK11_CreateNewObject(PK11SlotInfo *slot, CK_SESSION_HANDLE session,
104 const CK_ATTRIBUTE *theTemplate, int count,
105 PRBool token, CK_OBJECT_HANDLE *objectID);
106
107 SECStatus pbe_PK11AlgidToParam(SECAlgorithmID *algid,SECItem *mech);
108 SECStatus PBE_PK11ParamToAlgid(SECOidTag algTag, SECItem *param,
109 PRArenaPool *arena, SECAlgorithmID *algId);
110
111 PK11SymKey *pk11_TokenKeyGenWithFlagsAndKeyType(PK11SlotInfo *slot,
112 CK_MECHANISM_TYPE type, SECItem *param, CK_KEY_TYPE keyType,
113 int keySize, SECItem *keyId, CK_FLAGS opFlags,
114 PK11AttrFlags attrFlags, void *wincx);
115
116 CK_MECHANISM_TYPE pk11_GetPBECryptoMechanism(SECAlgorithmID *algid,
117 SECItem **param, SECItem *pwd, PRBool faulty3DES);
118
119
120
121 extern void pk11sdr_Init(void);
122 extern void pk11sdr_Shutdown(void);
123
124 /*
125 * Private to pk11wrap.
126 */
127
128 PRBool pk11_LoginStillRequired(PK11SlotInfo *slot, void *wincx);
129 CK_SESSION_HANDLE pk11_GetNewSession(PK11SlotInfo *slot, PRBool *owner);
130 void pk11_CloseSession(PK11SlotInfo *slot, CK_SESSION_HANDLE sess, PRBool own);
131 PK11SymKey *pk11_ForceSlot(PK11SymKey *symKey, CK_MECHANISM_TYPE type,
132 CK_ATTRIBUTE_TYPE operation);
133 /* Convert key operation flags to PKCS #11 attributes. */
134 unsigned int pk11_OpFlagsToAttributes(CK_FLAGS flags,
135 CK_ATTRIBUTE *attrs, CK_BBOOL *ckTrue);
136 /* Check for bad (conflicting) attribute flags */
137 PRBool pk11_BadAttrFlags(PK11AttrFlags attrFlags);
138 /* Convert key attribute flags to PKCS #11 attributes. */
139 unsigned int pk11_AttrFlagsToAttributes(PK11AttrFlags attrFlags,
140 CK_ATTRIBUTE *attrs, CK_BBOOL *ckTrue, CK_BBOOL *ckFalse);
141 PRBool pk11_FindAttrInTemplate(CK_ATTRIBUTE *attr, unsigned int numAttrs,
142 CK_ATTRIBUTE_TYPE target);
143
144 CK_MECHANISM_TYPE pk11_mapWrapKeyType(KeyType keyType);
145 PK11SymKey *pk11_KeyExchange(PK11SlotInfo *slot, CK_MECHANISM_TYPE type,
146 CK_ATTRIBUTE_TYPE operation, CK_FLAGS flags, PRBool isPerm,
147 PK11SymKey *symKey);
148
149 PRBool pk11_HandleTrustObject(PK11SlotInfo *slot, CERTCertificate *cert,
150 CERTCertTrust *trust);
151 CK_OBJECT_HANDLE pk11_FindPubKeyByAnyCert(CERTCertificate *cert,
152 PK11SlotInfo **slot, void *wincx);
153 SECStatus pk11_AuthenticateUnfriendly(PK11SlotInfo *slot, PRBool loadCerts,
154 void *wincx);
155 int PK11_NumberObjectsFor(PK11SlotInfo *slot, CK_ATTRIBUTE *findTemplate,
156 int templateCount);
157 SECItem *pk11_GetLowLevelKeyFromHandle(PK11SlotInfo *slot,
158 CK_OBJECT_HANDLE handle);
159 SECStatus PK11_TraverseSlot(PK11SlotInfo *slot, void *arg);
160 CK_OBJECT_HANDLE pk11_FindPrivateKeyFromCertID(PK11SlotInfo *slot,
161 SECItem *keyID);
162 SECKEYPrivateKey *PK11_MakePrivKey(PK11SlotInfo *slot, KeyType keyType,
163 PRBool isTemp, CK_OBJECT_HANDLE privID, void *wincx);
164 CERTCertificate *PK11_MakeCertFromHandle(PK11SlotInfo *slot,
165 CK_OBJECT_HANDLE certID, CK_ATTRIBUTE *privateLabel);
166
167 SECItem *pk11_GenerateNewParamWithKeyLen(CK_MECHANISM_TYPE type, int keyLen);
168 SECItem *pk11_ParamFromIVWithLen(CK_MECHANISM_TYPE type,
169 SECItem *iv, int keyLen);
170
171 SEC_END_PROTOS
172
173 #endif
174
OLDNEW
« no previous file with comments | « mozilla/security/nss/lib/pk11wrap/secmod.h ('k') | mozilla/security/nss/lib/pk11wrap/secmodt.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698