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 * Initialize the PCKS 11 subsystem | 5 * Initialize the PCKS 11 subsystem |
6 */ | 6 */ |
7 #include "seccomon.h" | 7 #include "seccomon.h" |
8 #include "secmod.h" | 8 #include "secmod.h" |
9 #include "nssilock.h" | 9 #include "nssilock.h" |
10 #include "secmodi.h" | 10 #include "secmodi.h" |
11 #include "secmodti.h" | 11 #include "secmodti.h" |
12 #include "pk11func.h" | 12 #include "pk11func.h" |
13 #include "pki3hack.h" | 13 #include "pki3hack.h" |
14 #include "secerr.h" | 14 #include "secerr.h" |
15 #include "dev.h" | 15 #include "dev.h" |
16 #include "utilpars.h" | 16 #include "utilpars.h" |
17 | 17 |
18 /* these are for displaying error messages */ | 18 /* these are for displaying error messages */ |
19 | 19 |
20 static SECMODModuleList *modules = NULL; | 20 static SECMODModuleList *modules = NULL; |
21 static SECMODModuleList *modulesDB = NULL; | 21 static SECMODModuleList *modulesDB = NULL; |
22 static SECMODModuleList *modulesUnload = NULL; | 22 static SECMODModuleList *modulesUnload = NULL; |
23 static SECMODModule *internalModule = NULL; | 23 static SECMODModule *internalModule = NULL; |
24 static SECMODModule *defaultDBModule = NULL; | 24 static SECMODModule *defaultDBModule = NULL; |
25 static SECMODModule *pendingModule = NULL; | 25 static SECMODModule *pendingModule = NULL; |
26 static SECMODListLock *moduleLock = NULL; | 26 static SECMODListLock *moduleLock = NULL; |
27 | 27 |
28 int secmod_PrivateModuleCount = 0; | 28 int secmod_PrivateModuleCount = 0; |
29 | 29 |
30 extern PK11DefaultArrayEntry PK11_DefaultArray[]; | 30 extern const PK11DefaultArrayEntry PK11_DefaultArray[]; |
31 extern int num_pk11_default_mechanisms; | 31 extern const int num_pk11_default_mechanisms; |
32 | 32 |
33 | 33 |
34 void | 34 void |
35 SECMOD_Init() | 35 SECMOD_Init() |
36 { | 36 { |
37 /* don't initialize twice */ | 37 /* don't initialize twice */ |
38 if (moduleLock) return; | 38 if (moduleLock) return; |
39 | 39 |
40 moduleLock = SECMOD_NewListLock(); | 40 moduleLock = SECMOD_NewListLock(); |
41 PK11_InitSlotLists(); | 41 PK11_InitSlotLists(); |
(...skipping 1534 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1576 * on multiple failures, we are only returning the lastError. The caller | 1576 * on multiple failures, we are only returning the lastError. The caller |
1577 * can determine which slots are bad by calling PK11_IsDisabled(). | 1577 * can determine which slots are bad by calling PK11_IsDisabled(). |
1578 */ | 1578 */ |
1579 if (rrv != SECSuccess) { | 1579 if (rrv != SECSuccess) { |
1580 /* restore the last error code */ | 1580 /* restore the last error code */ |
1581 PORT_SetError(lastError); | 1581 PORT_SetError(lastError); |
1582 } | 1582 } |
1583 | 1583 |
1584 return rrv; | 1584 return rrv; |
1585 } | 1585 } |
OLD | NEW |