OLD | NEW |
1 /* ***** BEGIN LICENSE BLOCK ***** | 1 /* ***** BEGIN LICENSE BLOCK ***** |
2 * Version: MPL 1.1/GPL 2.0/LGPL 2.1 | 2 * Version: MPL 1.1/GPL 2.0/LGPL 2.1 |
3 * | 3 * |
4 * The contents of this file are subject to the Mozilla Public License Version | 4 * The contents of this file are subject to the Mozilla Public License Version |
5 * 1.1 (the "License"); you may not use this file except in compliance with | 5 * 1.1 (the "License"); you may not use this file except in compliance with |
6 * the License. You may obtain a copy of the License at | 6 * the License. You may obtain a copy of the License at |
7 * http://www.mozilla.org/MPL/ | 7 * http://www.mozilla.org/MPL/ |
8 * | 8 * |
9 * Software distributed under the License is distributed on an "AS IS" basis, | 9 * Software distributed under the License is distributed on an "AS IS" basis, |
10 * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License | 10 * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License |
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
132 * initialize. | 132 * initialize. |
133 */ | 133 */ |
134 static SECStatus | 134 static SECStatus |
135 secmod_handleReload(SECMODModule *oldModule, SECMODModule *newModule) | 135 secmod_handleReload(SECMODModule *oldModule, SECMODModule *newModule) |
136 { | 136 { |
137 PK11SlotInfo *slot; | 137 PK11SlotInfo *slot; |
138 char *modulespec; | 138 char *modulespec; |
139 char *newModuleSpec; | 139 char *newModuleSpec; |
140 char **children; | 140 char **children; |
141 CK_SLOT_ID *ids; | 141 CK_SLOT_ID *ids; |
142 SECStatus rv; | 142 SECMODConfigList *conflist = NULL; |
143 SECMODConfigList *conflist; | 143 SECStatus rv = SECFailure; |
144 int count = 0; | 144 int count = 0; |
145 | 145 |
146 /* first look for tokens= key words from the module spec */ | 146 /* first look for tokens= key words from the module spec */ |
147 modulespec = newModule->libraryParams; | 147 modulespec = newModule->libraryParams; |
148 newModuleSpec = secmod_ParseModuleSpecForTokens(PR_TRUE, | 148 newModuleSpec = secmod_ParseModuleSpecForTokens(PR_TRUE, |
149 newModule->isFIPS, modulespec, &children, &ids); | 149 newModule->isFIPS, modulespec, &children, &ids); |
150 if (!newModuleSpec) { | 150 if (!newModuleSpec) { |
151 return SECFailure; | 151 return SECFailure; |
152 } | 152 } |
153 | 153 |
154 /* | 154 /* |
(...skipping 262 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
417 } | 417 } |
418 #else | 418 #else |
419 /* | 419 /* |
420 * Loads softoken as a dynamic library, | 420 * Loads softoken as a dynamic library, |
421 * even though the rest of NSS assumes this as the "internal" module. | 421 * even though the rest of NSS assumes this as the "internal" module. |
422 */ | 422 */ |
423 if (!softokenLib && | 423 if (!softokenLib && |
424 PR_SUCCESS != PR_CallOnce(&loadSoftokenOnce, &softoken_LoadDSO)) | 424 PR_SUCCESS != PR_CallOnce(&loadSoftokenOnce, &softoken_LoadDSO)) |
425 return SECFailure; | 425 return SECFailure; |
426 | 426 |
427 PR_AtomicIncrement(&softokenLoadCount); | 427 PR_ATOMIC_INCREMENT(&softokenLoadCount); |
428 | 428 |
429 if (mod->isFIPS) { | 429 if (mod->isFIPS) { |
430 entry = (CK_C_GetFunctionList) | 430 entry = (CK_C_GetFunctionList) |
431 PR_FindSymbol(softokenLib, "FC_GetFunctionList"); | 431 PR_FindSymbol(softokenLib, "FC_GetFunctionList"); |
432 } else { | 432 } else { |
433 entry = (CK_C_GetFunctionList) | 433 entry = (CK_C_GetFunctionList) |
434 PR_FindSymbol(softokenLib, "NSC_GetFunctionList"); | 434 PR_FindSymbol(softokenLib, "NSC_GetFunctionList"); |
435 } | 435 } |
436 | 436 |
437 if (!entry) | 437 if (!entry) |
(...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
605 } | 605 } |
606 } | 606 } |
607 mod->moduleID = 0; | 607 mod->moduleID = 0; |
608 mod->loaded = PR_FALSE; | 608 mod->loaded = PR_FALSE; |
609 | 609 |
610 /* do we want the semantics to allow unloading the internal library? | 610 /* do we want the semantics to allow unloading the internal library? |
611 * if not, we should change this to SECFailure and move it above the | 611 * if not, we should change this to SECFailure and move it above the |
612 * mod->loaded = PR_FALSE; */ | 612 * mod->loaded = PR_FALSE; */ |
613 if (mod->internal) { | 613 if (mod->internal) { |
614 #if 0 /* STATIC LIBRARIES */ | 614 #if 0 /* STATIC LIBRARIES */ |
615 if (0 == PR_AtomicDecrement(&softokenLoadCount)) { | 615 if (0 == PR_ATOMIC_DECREMENT(&softokenLoadCount)) { |
616 if (softokenLib) { | 616 if (softokenLib) { |
617 disableUnload = PR_GetEnv("NSS_DISABLE_UNLOAD"); | 617 disableUnload = PR_GetEnv("NSS_DISABLE_UNLOAD"); |
618 if (!disableUnload) { | 618 if (!disableUnload) { |
619 PRStatus status = PR_UnloadLibrary(softokenLib); | 619 PRStatus status = PR_UnloadLibrary(softokenLib); |
620 PORT_Assert(PR_SUCCESS == status); | 620 PORT_Assert(PR_SUCCESS == status); |
621 } | 621 } |
622 softokenLib = NULL; | 622 softokenLib = NULL; |
623 } | 623 } |
624 loadSoftokenOnce = pristineCallOnce; | 624 loadSoftokenOnce = pristineCallOnce; |
625 } | 625 } |
(...skipping 16 matching lines...) Expand all Loading... |
642 | 642 |
643 void | 643 void |
644 nss_DumpModuleLog(void) | 644 nss_DumpModuleLog(void) |
645 { | 645 { |
646 #ifdef DEBUG_MODULE | 646 #ifdef DEBUG_MODULE |
647 if (modToDBG) { | 647 if (modToDBG) { |
648 print_final_statistics(); | 648 print_final_statistics(); |
649 } | 649 } |
650 #endif | 650 #endif |
651 } | 651 } |
OLD | NEW |