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 * The following handles the loading, unloading and management of | 5 * The following handles the loading, unloading and management of |
6 * various PCKS #11 modules | 6 * various PCKS #11 modules |
7 */ | 7 */ |
8 | 8 |
9 #include <ctype.h> | 9 #include <ctype.h> |
10 #include "pkcs11.h" | 10 #include "pkcs11.h" |
11 #include "seccomon.h" | 11 #include "seccomon.h" |
12 #include "secmod.h" | 12 #include "secmod.h" |
13 #include "secmodi.h" | 13 #include "secmodi.h" |
14 #include "secmodti.h" | 14 #include "secmodti.h" |
15 #include "pki3hack.h" | 15 #include "pki3hack.h" |
16 #include "secerr.h" | 16 #include "secerr.h" |
17 | 17 |
18 #include "utilpars.h" | 18 #include "utilpars.h" |
19 | 19 |
20 /* create a new module */ | 20 /* create a new module */ |
21 static SECMODModule * | 21 static SECMODModule * |
22 secmod_NewModule(void) | 22 secmod_NewModule(void) |
23 { | 23 { |
24 SECMODModule *newMod; | 24 SECMODModule *newMod; |
25 PRArenaPool *arena; | 25 PLArenaPool *arena; |
26 | 26 |
27 | 27 |
28 /* create an arena in which dllName and commonName can be | 28 /* create an arena in which dllName and commonName can be |
29 * allocated. | 29 * allocated. |
30 */ | 30 */ |
31 arena = PORT_NewArena(512); | 31 arena = PORT_NewArena(512); |
32 if (arena == NULL) { | 32 if (arena == NULL) { |
33 return NULL; | 33 return NULL; |
34 } | 34 } |
35 | 35 |
(...skipping 687 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
723 PORT_Free(escSpec); | 723 PORT_Free(escSpec); |
724 **next = '>'; | 724 **next = '>'; |
725 (*next)++; | 725 (*next)++; |
726 (*length)--; | 726 (*length)--; |
727 return SECSuccess; | 727 return SECSuccess; |
728 } | 728 } |
729 | 729 |
730 #define TOKEN_STRING " tokens=[" | 730 #define TOKEN_STRING " tokens=[" |
731 | 731 |
732 char * | 732 char * |
733 secmod_MkAppendTokensList(PRArenaPool *arena, char *oldParam, char *newToken, | 733 secmod_MkAppendTokensList(PLArenaPool *arena, char *oldParam, char *newToken, |
734 CK_SLOT_ID newID, char **children, CK_SLOT_ID *ids) | 734 CK_SLOT_ID newID, char **children, CK_SLOT_ID *ids) |
735 { | 735 { |
736 char *rawParam = NULL; /* oldParam with tokens stripped off */ | 736 char *rawParam = NULL; /* oldParam with tokens stripped off */ |
737 char *newParam = NULL; /* space for the return parameter */ | 737 char *newParam = NULL; /* space for the return parameter */ |
738 char *nextParam = NULL; /* current end of the new parameter */ | 738 char *nextParam = NULL; /* current end of the new parameter */ |
739 char **oldChildren = NULL; | 739 char **oldChildren = NULL; |
740 CK_SLOT_ID *oldIds = NULL; | 740 CK_SLOT_ID *oldIds = NULL; |
741 void *mark = NULL; /* mark the arena pool in case we need | 741 void *mark = NULL; /* mark the arena pool in case we need |
742 * to release it */ | 742 * to release it */ |
743 int length, i, tmpLen; | 743 int length, i, tmpLen; |
(...skipping 381 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1125 | 1125 |
1126 SECMOD_GetReadLock(moduleLock); | 1126 SECMOD_GetReadLock(moduleLock); |
1127 rv = STAN_RemoveModuleFromDefaultTrustDomain(mod); | 1127 rv = STAN_RemoveModuleFromDefaultTrustDomain(mod); |
1128 SECMOD_ReleaseReadLock(moduleLock); | 1128 SECMOD_ReleaseReadLock(moduleLock); |
1129 if (SECSuccess != rv) { | 1129 if (SECSuccess != rv) { |
1130 return SECFailure; | 1130 return SECFailure; |
1131 } | 1131 } |
1132 return SECMOD_DeleteModuleEx(NULL, mod, &atype, PR_FALSE); | 1132 return SECMOD_DeleteModuleEx(NULL, mod, &atype, PR_FALSE); |
1133 } | 1133 } |
1134 | 1134 |
OLD | NEW |