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

Side by Side Diff: patches/nss-static.patch

Issue 13898013: Update NSS to NSS_3_15_BETA2. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/deps/third_party/nss/
Patch Set: Update NSS versions and tag in README.chromium 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
OLDNEW
1 Index: mozilla/security/nss/lib/certhigh/certvfy.c 1 diff -r 3f0105dfc733 lib/certhigh/certvfy.c
2 =================================================================== 2 --- a/lib/certhigh/certvfy.c» Mon Apr 22 14:22:48 2013 +0200
3 RCS file: /cvsroot/mozilla/security/nss/lib/certhigh/certvfy.c,v 3 +++ b/lib/certhigh/certvfy.c» Mon Apr 22 14:33:38 2013 -0700
4 retrieving revision 1.77
5 diff -p -u -8 -r1.77 certvfy.c
6 --- mozilla/security/nss/lib/certhigh/certvfy.c»25 Apr 2012 14:49:27 -0000» 1.77
7 +++ mozilla/security/nss/lib/certhigh/certvfy.c»22 Sep 2012 15:22:26 -0000
8 @@ -8,27 +8,70 @@ 4 @@ -8,27 +8,70 @@
9 #include "secoid.h" 5 #include "secoid.h"
10 #include "sslerr.h" 6 #include "sslerr.h"
11 #include "genname.h" 7 #include "genname.h"
12 #include "keyhi.h" 8 #include "keyhi.h"
13 #include "cert.h" 9 #include "cert.h"
14 #include "certdb.h" 10 #include "certdb.h"
15 #include "certi.h" 11 #include "certi.h"
16 #include "cryptohi.h" 12 #include "cryptohi.h"
17 +#ifndef NSS_DISABLE_LIBPKIX 13 +#ifndef NSS_DISABLE_LIBPKIX
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
69 +#endif /* NSS_DISABLE_LIBPKIX */ 65 +#endif /* NSS_DISABLE_LIBPKIX */
70 + 66 +
71 /* 67 /*
72 * Check the validity times of a certificate 68 * Check the validity times of a certificate
73 */ 69 */
74 SECStatus 70 SECStatus
75 CERT_CertTimesValid(CERTCertificate *c) 71 CERT_CertTimesValid(CERTCertificate *c)
76 { 72 {
77 SECCertTimeValidity valid = CERT_CheckCertValidTimes(c, PR_Now(), PR_TRUE); 73 SECCertTimeValidity valid = CERT_CheckCertValidTimes(c, PR_Now(), PR_TRUE);
78 return (valid == secCertTimeValid) ? SECSuccess : SECFailure; 74 return (valid == secCertTimeValid) ? SECSuccess : SECFailure;
79 Index: mozilla/security/nss/lib/ckfw/nssck.api 75 diff -r 3f0105dfc733 lib/ckfw/nssck.api
80 =================================================================== 76 --- a/lib/ckfw/nssck.api» Mon Apr 22 14:22:48 2013 +0200
81 RCS file: /cvsroot/mozilla/security/nss/lib/ckfw/nssck.api,v 77 +++ b/lib/ckfw/nssck.api» Mon Apr 22 14:33:38 2013 -0700
82 retrieving revision 1.8 78 @@ -1751,17 +1751,17 @@
83 diff -p -u -8 -r1.8 nssck.api
84 --- mozilla/security/nss/lib/ckfw/nssck.api» 25 Apr 2012 14:49:28 -0000» 1.8
85 +++ mozilla/security/nss/lib/ckfw/nssck.api» 22 Sep 2012 15:22:28 -0000
86 @@ -1751,17 +1751,17 @@ C_WaitForSlotEvent
87 CK_SLOT_ID_PTR pSlot, 79 CK_SLOT_ID_PTR pSlot,
88 CK_VOID_PTR pRserved 80 CK_VOID_PTR pRserved
89 ) 81 )
90 { 82 {
91 return __ADJOIN(MODULE_NAME,C_WaitForSlotEvent)(flags, pSlot, pRserved); 83 return __ADJOIN(MODULE_NAME,C_WaitForSlotEvent)(flags, pSlot, pRserved);
92 } 84 }
93 #endif /* DECLARE_STRICT_CRYPTOKI_NAMES */ 85 #endif /* DECLARE_STRICT_CRYPTOKI_NAMES */
94 86
95 -static CK_RV CK_ENTRY 87 -static CK_RV CK_ENTRY
96 +CK_RV CK_ENTRY 88 +CK_RV CK_ENTRY
97 __ADJOIN(MODULE_NAME,C_GetFunctionList) 89 __ADJOIN(MODULE_NAME,C_GetFunctionList)
98 ( 90 (
99 CK_FUNCTION_LIST_PTR_PTR ppFunctionList 91 CK_FUNCTION_LIST_PTR_PTR ppFunctionList
100 ); 92 );
101 93
102 static CK_FUNCTION_LIST FunctionList = { 94 static CK_FUNCTION_LIST FunctionList = {
103 { 2, 1 }, 95 { 2, 1 },
104 __ADJOIN(MODULE_NAME,C_Initialize), 96 __ADJOIN(MODULE_NAME,C_Initialize),
105 @@ -1829,30 +1829,32 @@ __ADJOIN(MODULE_NAME,C_UnwrapKey), 97 @@ -1829,30 +1829,32 @@
106 __ADJOIN(MODULE_NAME,C_DeriveKey), 98 __ADJOIN(MODULE_NAME,C_DeriveKey),
107 __ADJOIN(MODULE_NAME,C_SeedRandom), 99 __ADJOIN(MODULE_NAME,C_SeedRandom),
108 __ADJOIN(MODULE_NAME,C_GenerateRandom), 100 __ADJOIN(MODULE_NAME,C_GenerateRandom),
109 __ADJOIN(MODULE_NAME,C_GetFunctionStatus), 101 __ADJOIN(MODULE_NAME,C_GetFunctionStatus),
110 __ADJOIN(MODULE_NAME,C_CancelFunction), 102 __ADJOIN(MODULE_NAME,C_CancelFunction),
111 __ADJOIN(MODULE_NAME,C_WaitForSlotEvent) 103 __ADJOIN(MODULE_NAME,C_WaitForSlotEvent)
112 }; 104 };
113 105
114 -static CK_RV CK_ENTRY 106 -static CK_RV CK_ENTRY
115 +CK_RV CK_ENTRY 107 +CK_RV CK_ENTRY
(...skipping 13 matching lines...) Expand all
129 ( 121 (
130 CK_FUNCTION_LIST_PTR_PTR ppFunctionList 122 CK_FUNCTION_LIST_PTR_PTR ppFunctionList
131 ) 123 )
132 { 124 {
133 return __ADJOIN(MODULE_NAME,C_GetFunctionList)(ppFunctionList); 125 return __ADJOIN(MODULE_NAME,C_GetFunctionList)(ppFunctionList);
134 } 126 }
135 +#endif 127 +#endif
136 128
137 #undef __ADJOIN 129 #undef __ADJOIN
138 130
139 Index: mozilla/security/nss/lib/freebl/rsa.c 131 diff -r 3f0105dfc733 lib/freebl/rsa.c
140 =================================================================== 132 --- a/lib/freebl/rsa.c» Mon Apr 22 14:22:48 2013 +0200
141 RCS file: /cvsroot/mozilla/security/nss/lib/freebl/rsa.c,v 133 +++ b/lib/freebl/rsa.c» Mon Apr 22 14:33:38 2013 -0700
142 retrieving revision 1.44 134 @@ -1556,16 +1556,23 @@
143 diff -p -u -8 -r1.44 rsa.c
144 --- mozilla/security/nss/lib/freebl/rsa.c» 25 Apr 2012 14:49:43 -0000» 1.44
145 +++ mozilla/security/nss/lib/freebl/rsa.c» 22 Sep 2012 15:22:28 -0000
146 @@ -1556,16 +1556,23 @@ void RSA_Cleanup(void)
147 * free_bl may have allocated along the way. Currently only RSA does this, 135 * free_bl may have allocated along the way. Currently only RSA does this,
148 * so I've put it here for now. 136 * so I've put it here for now.
149 */ 137 */
150 void BL_Cleanup(void) 138 void BL_Cleanup(void)
151 { 139 {
152 RSA_Cleanup(); 140 RSA_Cleanup();
153 } 141 }
154 142
155 +#ifdef NSS_STATIC 143 +#ifdef NSS_STATIC
156 +void 144 +void
157 +BL_Unload(void) 145 +BL_Unload(void)
158 +{ 146 +{
159 +} 147 +}
160 +#endif 148 +#endif
161 + 149 +
162 PRBool bl_parentForkedAfterC_Initialize; 150 PRBool bl_parentForkedAfterC_Initialize;
163 151
164 /* 152 /*
165 * Set fork flag so it can be tested in SKIP_AFTER_FORK on relevant platforms. 153 * Set fork flag so it can be tested in SKIP_AFTER_FORK on relevant platforms.
166 */ 154 */
167 void BL_SetForkState(PRBool forked) 155 void BL_SetForkState(PRBool forked)
168 { 156 {
169 bl_parentForkedAfterC_Initialize = forked; 157 bl_parentForkedAfterC_Initialize = forked;
170 Index: mozilla/security/nss/lib/freebl/shvfy.c 158 diff -r 3f0105dfc733 lib/freebl/shvfy.c
171 =================================================================== 159 --- a/lib/freebl/shvfy.c» Mon Apr 22 14:22:48 2013 +0200
172 RCS file: /cvsroot/mozilla/security/nss/lib/freebl/shvfy.c,v 160 +++ b/lib/freebl/shvfy.c» Mon Apr 22 14:33:38 2013 -0700
173 retrieving revision 1.18 161 @@ -269,39 +269,55 @@
174 diff -p -u -8 -r1.18 shvfy.c
175 --- mozilla/security/nss/lib/freebl/shvfy.c» 22 Sep 2012 15:18:19 -0000» 1.18
176 +++ mozilla/security/nss/lib/freebl/shvfy.c» 22 Sep 2012 15:22:29 -0000
177 @@ -269,39 +269,55 @@ readItem(PRFileDesc *fd, SECItem *item)
178 PORT_Free(item->data); 162 PORT_Free(item->data);
179 item->data = NULL; 163 item->data = NULL;
180 item->len = 0; 164 item->len = 0;
181 return SECFailure; 165 return SECFailure;
182 } 166 }
183 return SECSuccess; 167 return SECSuccess;
184 } 168 }
185 169
186 +/* 170 +/*
187 + * Define PSEUDO_FIPS if you can't do FIPS software integrity test (e.g., 171 + * Define PSEUDO_FIPS if you can't do FIPS software integrity test (e.g.,
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
223 + return PR_TRUE; /* a lie, hence *pseudo* FIPS */ 207 + return PR_TRUE; /* a lie, hence *pseudo* FIPS */
224 +#else 208 +#else
225 char *checkName = NULL; 209 char *checkName = NULL;
226 PRFileDesc *checkFD = NULL; 210 PRFileDesc *checkFD = NULL;
227 PRFileDesc *shFD = NULL; 211 PRFileDesc *shFD = NULL;
228 void *hashcx = NULL; 212 void *hashcx = NULL;
229 const SECHashObject *hashObj = NULL; 213 const SECHashObject *hashObj = NULL;
230 SECItem signature = { 0, NULL, 0 }; 214 SECItem signature = { 0, NULL, 0 };
231 SECItem hash; 215 SECItem hash;
232 int bytesRead, offset; 216 int bytesRead, offset;
233 @@ -488,16 +504,17 @@ loser: 217 @@ -488,16 +504,17 @@
234 if (key.params.base.data != NULL) { 218 if (key.params.base.data != NULL) {
235 PORT_Free(key.params.base.data); 219 PORT_Free(key.params.base.data);
236 } 220 }
237 if (key.publicValue.data != NULL) { 221 if (key.publicValue.data != NULL) {
238 PORT_Free(key.publicValue.data); 222 PORT_Free(key.publicValue.data);
239 } 223 }
240 224
241 return result; 225 return result;
242 +#endif /* PSEUDO_FIPS */ 226 +#endif /* PSEUDO_FIPS */
243 } 227 }
244 228
245 PRBool 229 PRBool
246 BLAPI_VerifySelf(const char *name) 230 BLAPI_VerifySelf(const char *name)
247 { 231 {
248 if (name == NULL) { 232 if (name == NULL) {
249 /* 233 /*
250 * If name is NULL, freebl is statically linked into softoken. 234 * If name is NULL, freebl is statically linked into softoken.
251 Index: mozilla/security/nss/lib/nss/nssinit.c 235 diff -r 3f0105dfc733 lib/nss/nssinit.c
252 =================================================================== 236 --- a/lib/nss/nssinit.c»Mon Apr 22 14:22:48 2013 +0200
253 RCS file: /cvsroot/mozilla/security/nss/lib/nss/nssinit.c,v 237 +++ b/lib/nss/nssinit.c»Mon Apr 22 14:33:38 2013 -0700
254 retrieving revision 1.118 238 @@ -16,19 +16,21 @@
255 diff -p -u -8 -r1.118 nssinit.c
256 --- mozilla/security/nss/lib/nss/nssinit.c» 21 Sep 2012 21:58:44 -0000» 1.118
257 +++ mozilla/security/nss/lib/nss/nssinit.c» 22 Sep 2012 15:22:31 -0000
258 @@ -18,19 +18,21 @@
259 #include "key.h" 239 #include "key.h"
260 #include "secmod.h" 240 #include "secmod.h"
261 #include "secoid.h" 241 #include "secoid.h"
262 #include "nss.h" 242 #include "nss.h"
263 #include "pk11func.h" 243 #include "pk11func.h"
264 #include "secerr.h" 244 #include "secerr.h"
265 #include "nssbase.h" 245 #include "nssbase.h"
266 #include "nssutil.h" 246 #include "nssutil.h"
267 +#ifndef NSS_DISABLE_LIBPKIX 247 +#ifndef NSS_DISABLE_LIBPKIX
268 #include "pkixt.h" 248 #include "pkixt.h"
269 #include "pkix.h" 249 #include "pkix.h"
270 #include "pkix_tools.h" 250 #include "pkix_tools.h"
271 +#endif /* NSS_DISABLE_LIBPKIX */ 251 +#endif /* NSS_DISABLE_LIBPKIX */
272 252
273 #include "pki3hack.h" 253 #include "pki3hack.h"
274 #include "certi.h" 254 #include "certi.h"
275 #include "secmodi.h" 255 #include "secmodi.h"
276 #include "ocspti.h" 256 #include "ocspti.h"
277 #include "ocspi.h" 257 #include "ocspi.h"
278 #include "utilpars.h" 258 #include "utilpars.h"
279 259
280 @@ -528,18 +530,20 @@ nss_Init(const char *configdir, const ch 260 @@ -526,18 +528,20 @@
281 NSSInitParameters *initParams, 261 NSSInitParameters *initParams,
282 PRBool readOnly, PRBool noCertDB, 262 PRBool readOnly, PRBool noCertDB,
283 PRBool noModDB, PRBool forceOpen, PRBool noRootInit, 263 PRBool noModDB, PRBool forceOpen, PRBool noRootInit,
284 PRBool optimizeSpace, PRBool noSingleThreadedModules, 264 PRBool optimizeSpace, PRBool noSingleThreadedModules,
285 PRBool allowAlreadyInitializedModules, 265 PRBool allowAlreadyInitializedModules,
286 PRBool dontFinalizeModules) 266 PRBool dontFinalizeModules)
287 { 267 {
288 SECStatus rv = SECFailure; 268 SECStatus rv = SECFailure;
289 +#ifndef NSS_DISABLE_LIBPKIX 269 +#ifndef NSS_DISABLE_LIBPKIX
290 PKIX_UInt32 actualMinorVersion = 0; 270 PKIX_UInt32 actualMinorVersion = 0;
291 PKIX_Error *pkixError = NULL; 271 PKIX_Error *pkixError = NULL;
292 +#endif 272 +#endif
293 PRBool isReallyInitted; 273 PRBool isReallyInitted;
294 char *configStrings = NULL; 274 char *configStrings = NULL;
295 char *configName = NULL; 275 char *configName = NULL;
296 PRBool passwordRequired = PR_FALSE; 276 PRBool passwordRequired = PR_FALSE;
297 277
298 /* if we are trying to init with a traditional NSS_Init call, maintain 278 /* if we are trying to init with a traditional NSS_Init call, maintain
299 * the traditional idempotent behavior. */ 279 * the traditional idempotent behavior. */
300 if (!initContextPtr && nssIsInitted) { 280 if (!initContextPtr && nssIsInitted) {
301 @@ -680,28 +684,30 @@ nss_Init(const char *configdir, const ch 281 @@ -681,28 +685,30 @@
302 nss_FindExternalRoot(dbpath, secmodName); 282 nss_FindExternalRoot(dbpath, secmodName);
303 } 283 }
304 } 284 }
305 } 285 }
306 286
307 pk11sdr_Init(); 287 pk11sdr_Init();
308 cert_CreateSubjectKeyIDHashTable(); 288 cert_CreateSubjectKeyIDHashTable();
309 289
310 +#ifndef NSS_DISABLE_LIBPKIX 290 +#ifndef NSS_DISABLE_LIBPKIX
311 pkixError = PKIX_Initialize 291 pkixError = PKIX_Initialize
(...skipping 10 matching lines...) Expand all
322 } 302 }
323 +#endif /* NSS_DISABLE_LIBPKIX */ 303 +#endif /* NSS_DISABLE_LIBPKIX */
324 304
325 305
326 } 306 }
327 307
328 /* 308 /*
329 * Now mark the appropriate init state. If initContextPtr was passed 309 * Now mark the appropriate init state. If initContextPtr was passed
330 * in, then return the new context pointer and add it to the 310 * in, then return the new context pointer and add it to the
331 * nssInitContextList. Otherwise set the global nss_isInitted flag 311 * nssInitContextList. Otherwise set the global nss_isInitted flag
332 @@ -1065,17 +1071,19 @@ nss_Shutdown(void) 312 @@ -1077,17 +1083,19 @@
333 313
334 rv = nss_ShutdownShutdownList(); 314 rv = nss_ShutdownShutdownList();
335 if (rv != SECSuccess) { 315 if (rv != SECSuccess) {
336 shutdownRV = SECFailure; 316 shutdownRV = SECFailure;
337 } 317 }
338 cert_DestroyLocks(); 318 cert_DestroyLocks();
339 ShutdownCRLCache(); 319 ShutdownCRLCache();
340 OCSP_ShutdownGlobal(); 320 OCSP_ShutdownGlobal();
341 +#ifndef NSS_DISABLE_LIBPKIX 321 +#ifndef NSS_DISABLE_LIBPKIX
342 PKIX_Shutdown(plContext); 322 PKIX_Shutdown(plContext);
343 +#endif 323 +#endif
344 SECOID_Shutdown(); 324 SECOID_Shutdown();
345 status = STAN_Shutdown(); 325 status = STAN_Shutdown();
346 cert_DestroySubjectKeyIDHashTable(); 326 cert_DestroySubjectKeyIDHashTable();
347 pk11_SetInternalKeySlot(NULL); 327 pk11_SetInternalKeySlot(NULL);
348 rv = SECMOD_Shutdown(); 328 rv = SECMOD_Shutdown();
349 if (rv != SECSuccess) { 329 if (rv != SECSuccess) {
350 shutdownRV = SECFailure; 330 shutdownRV = SECFailure;
351 } 331 }
352 Index: mozilla/security/nss/lib/pk11wrap/pk11load.c 332 diff -r 3f0105dfc733 lib/pk11wrap/pk11load.c
353 =================================================================== 333 --- a/lib/pk11wrap/pk11load.c» Mon Apr 22 14:22:48 2013 +0200
354 RCS file: /cvsroot/mozilla/security/nss/lib/pk11wrap/pk11load.c,v 334 +++ b/lib/pk11wrap/pk11load.c» Mon Apr 22 14:33:38 2013 -0700
355 retrieving revision 1.36 335 @@ -313,46 +313,55 @@
356 diff -p -u -8 -r1.36 pk11load.c
357 --- mozilla/security/nss/lib/pk11wrap/pk11load.c» 26 Jun 2012 22:27:30 -00 00» 1.36
358 +++ mozilla/security/nss/lib/pk11wrap/pk11load.c» 22 Sep 2012 15:22:31 -00 00
359 @@ -313,46 +313,55 @@ SECMOD_SetRootCerts(PK11SlotInfo *slot,
360 mod->slotInfo = psi_list; 336 mod->slotInfo = psi_list;
361 mod->slotInfoCount++; 337 mod->slotInfoCount++;
362 338
363 } 339 }
364 psi->hasRootCerts = 1; 340 psi->hasRootCerts = 1;
365 } 341 }
366 } 342 }
367 343
368 +#ifdef NSS_STATIC 344 +#ifdef NSS_STATIC
369 +extern CK_RV NSC_GetFunctionList(CK_FUNCTION_LIST_PTR *pFunctionList); 345 +extern CK_RV NSC_GetFunctionList(CK_FUNCTION_LIST_PTR *pFunctionList);
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
405 } 381 }
406 +#endif /* !NSS_STATIC */ 382 +#endif /* !NSS_STATIC */
407 383
408 /* 384 /*
409 * load a new module into our address space and initialize it. 385 * load a new module into our address space and initialize it.
410 */ 386 */
411 SECStatus 387 SECStatus
412 secmod_LoadPKCS11Module(SECMODModule *mod, SECMODModule **oldModule) { 388 secmod_LoadPKCS11Module(SECMODModule *mod, SECMODModule **oldModule) {
413 PRLibrary *library = NULL; 389 PRLibrary *library = NULL;
414 CK_C_GetFunctionList entry = NULL; 390 CK_C_GetFunctionList entry = NULL;
415 @@ -361,16 +370,26 @@ secmod_LoadPKCS11Module(SECMODModule *mo 391 @@ -361,16 +370,26 @@
416 SECStatus rv; 392 SECStatus rv;
417 PRBool alreadyLoaded = PR_FALSE; 393 PRBool alreadyLoaded = PR_FALSE;
418 char *disableUnload = NULL; 394 char *disableUnload = NULL;
419 395
420 if (mod->loaded) return SECSuccess; 396 if (mod->loaded) return SECSuccess;
421 397
422 /* intenal modules get loaded from their internal list */ 398 /* intenal modules get loaded from their internal list */
423 if (mod->internal && (mod->dllName == NULL)) { 399 if (mod->internal && (mod->dllName == NULL)) {
424 +#ifdef NSS_STATIC 400 +#ifdef NSS_STATIC
425 + if (mod->isFIPS) { 401 + if (mod->isFIPS) {
426 + entry = FC_GetFunctionList; 402 + entry = FC_GetFunctionList;
427 + } else { 403 + } else {
428 + entry = NSC_GetFunctionList; 404 + entry = NSC_GetFunctionList;
429 + } 405 + }
430 + if (mod->isModuleDB) { 406 + if (mod->isModuleDB) {
431 + mod->moduleDBFunc = NSC_ModuleDBFunc; 407 + mod->moduleDBFunc = NSC_ModuleDBFunc;
432 + } 408 + }
433 +#else 409 +#else
434 /* 410 /*
435 * Loads softoken as a dynamic library, 411 * Loads softoken as a dynamic library,
436 * even though the rest of NSS assumes this as the "internal" module. 412 * even though the rest of NSS assumes this as the "internal" module.
437 */ 413 */
438 if (!softokenLib && 414 if (!softokenLib &&
439 PR_SUCCESS != PR_CallOnce(&loadSoftokenOnce, &softoken_LoadDSO)) 415 PR_SUCCESS != PR_CallOnce(&loadSoftokenOnce, &softoken_LoadDSO))
440 return SECFailure; 416 return SECFailure;
441 417
442 @@ -386,26 +405,36 @@ secmod_LoadPKCS11Module(SECMODModule *mo 418 @@ -386,26 +405,36 @@
443 419
444 if (!entry) 420 if (!entry)
445 return SECFailure; 421 return SECFailure;
446 422
447 if (mod->isModuleDB) { 423 if (mod->isModuleDB) {
448 mod->moduleDBFunc = (CK_C_GetFunctionList) 424 mod->moduleDBFunc = (CK_C_GetFunctionList)
449 PR_FindSymbol(softokenLib, "NSC_ModuleDBFunc"); 425 PR_FindSymbol(softokenLib, "NSC_ModuleDBFunc");
450 } 426 }
451 +#endif 427 +#endif
452 428
(...skipping 16 matching lines...) Expand all
469 + } 445 + }
470 +#endif 446 +#endif
471 447
472 /* load the library. If this succeeds, then we have to remember to 448 /* load the library. If this succeeds, then we have to remember to
473 * unload the library if anything goes wrong from here on out... 449 * unload the library if anything goes wrong from here on out...
474 */ 450 */
475 library = PR_LoadLibrary(mod->dllName); 451 library = PR_LoadLibrary(mod->dllName);
476 mod->library = (void *)library; 452 mod->library = (void *)library;
477 453
478 if (library == NULL) { 454 if (library == NULL) {
479 @@ -418,16 +447,19 @@ secmod_LoadPKCS11Module(SECMODModule *mo 455 @@ -418,16 +447,19 @@
480 if (!mod->moduleDBOnly) { 456 if (!mod->moduleDBOnly) {
481 entry = (CK_C_GetFunctionList) 457 entry = (CK_C_GetFunctionList)
482 PR_FindSymbol(library, "C_GetFunctionList"); 458 PR_FindSymbol(library, "C_GetFunctionList");
483 } 459 }
484 if (mod->isModuleDB) { 460 if (mod->isModuleDB) {
485 mod->moduleDBFunc = (void *) 461 mod->moduleDBFunc = (void *)
486 PR_FindSymbol(library, "NSS_ReturnModuleSpecData"); 462 PR_FindSymbol(library, "NSS_ReturnModuleSpecData");
487 } 463 }
488 +#if defined(NSS_STATIC) && !defined(NSS_DISABLE_ROOT_CERTS) 464 +#if defined(NSS_STATIC) && !defined(NSS_DISABLE_ROOT_CERTS)
489 +library_loaded: 465 +library_loaded:
490 +#endif 466 +#endif
491 if (mod->moduleDBFunc == NULL) mod->isModuleDB = PR_FALSE; 467 if (mod->moduleDBFunc == NULL) mod->isModuleDB = PR_FALSE;
492 if (entry == NULL) { 468 if (entry == NULL) {
493 if (mod->isModuleDB) { 469 if (mod->isModuleDB) {
494 mod->loaded = PR_TRUE; 470 mod->loaded = PR_TRUE;
495 mod->moduleDBOnly = PR_TRUE; 471 mod->moduleDBOnly = PR_TRUE;
496 return SECSuccess; 472 return SECSuccess;
497 } 473 }
498 PR_UnloadLibrary(library); 474 PR_UnloadLibrary(library);
499 @@ -557,33 +589,40 @@ SECMOD_UnloadModule(SECMODModule *mod) { 475 @@ -557,33 +589,40 @@
500 } 476 }
501 mod->moduleID = 0; 477 mod->moduleID = 0;
502 mod->loaded = PR_FALSE; 478 mod->loaded = PR_FALSE;
503 479
504 /* do we want the semantics to allow unloading the internal library? 480 /* do we want the semantics to allow unloading the internal library?
505 * if not, we should change this to SECFailure and move it above the 481 * if not, we should change this to SECFailure and move it above the
506 * mod->loaded = PR_FALSE; */ 482 * mod->loaded = PR_FALSE; */
507 if (mod->internal && (mod->dllName == NULL)) { 483 if (mod->internal && (mod->dllName == NULL)) {
508 +#ifndef NSS_STATIC 484 +#ifndef NSS_STATIC
509 if (0 == PR_ATOMIC_DECREMENT(&softokenLoadCount)) { 485 if (0 == PR_ATOMIC_DECREMENT(&softokenLoadCount)) {
(...skipping 20 matching lines...) Expand all
530 + } 506 + }
531 +#endif 507 +#endif
532 return SECFailure; 508 return SECFailure;
533 } 509 }
534 510
535 disableUnload = PR_GetEnv("NSS_DISABLE_UNLOAD"); 511 disableUnload = PR_GetEnv("NSS_DISABLE_UNLOAD");
536 if (!disableUnload) { 512 if (!disableUnload) {
537 PR_UnloadLibrary(library); 513 PR_UnloadLibrary(library);
538 } 514 }
539 return SECSuccess; 515 return SECSuccess;
540 Index: mozilla/security/nss/lib/softoken/lgglue.c 516 diff -r 3f0105dfc733 lib/softoken/lgglue.c
541 =================================================================== 517 --- a/lib/softoken/lgglue.c» Mon Apr 22 14:22:48 2013 +0200
542 RCS file: /cvsroot/mozilla/security/nss/lib/softoken/lgglue.c,v 518 +++ b/lib/softoken/lgglue.c» Mon Apr 22 14:33:38 2013 -0700
543 retrieving revision 1.14
544 diff -p -u -8 -r1.14 lgglue.c
545 --- mozilla/security/nss/lib/softoken/lgglue.c» 25 Apr 2012 14:50:10 -0000» 1.14
546 +++ mozilla/security/nss/lib/softoken/lgglue.c» 22 Sep 2012 15:22:32 -0000
547 @@ -18,16 +18,17 @@ 519 @@ -18,16 +18,17 @@
548 520
549 static LGOpenFunc legacy_glue_open = NULL; 521 static LGOpenFunc legacy_glue_open = NULL;
550 static LGReadSecmodFunc legacy_glue_readSecmod = NULL; 522 static LGReadSecmodFunc legacy_glue_readSecmod = NULL;
551 static LGReleaseSecmodFunc legacy_glue_releaseSecmod = NULL; 523 static LGReleaseSecmodFunc legacy_glue_releaseSecmod = NULL;
552 static LGDeleteSecmodFunc legacy_glue_deleteSecmod = NULL; 524 static LGDeleteSecmodFunc legacy_glue_deleteSecmod = NULL;
553 static LGAddSecmodFunc legacy_glue_addSecmod = NULL; 525 static LGAddSecmodFunc legacy_glue_addSecmod = NULL;
554 static LGShutdownFunc legacy_glue_shutdown = NULL; 526 static LGShutdownFunc legacy_glue_shutdown = NULL;
555 527
556 +#ifndef NSS_STATIC 528 +#ifndef NSS_STATIC
557 /* 529 /*
558 * The following 3 functions duplicate the work done by bl_LoadLibrary. 530 * The following 3 functions duplicate the work done by bl_LoadLibrary.
559 * We should make bl_LoadLibrary a global and replace the call to 531 * We should make bl_LoadLibrary a global and replace the call to
560 * sftkdb_LoadLibrary(const char *libname) with it. 532 * sftkdb_LoadLibrary(const char *libname) with it.
561 */ 533 */
562 #ifdef XP_UNIX 534 #ifdef XP_UNIX
563 #include <unistd.h> 535 #include <unistd.h>
564 #define LG_MAX_LINKS 20 536 #define LG_MAX_LINKS 20
565 @@ -155,16 +156,17 @@ done: 537 @@ -155,16 +156,17 @@
566 PRLibSpec libSpec; 538 PRLibSpec libSpec;
567 libSpec.type = PR_LibSpec_Pathname; 539 libSpec.type = PR_LibSpec_Pathname;
568 libSpec.value.pathname = libname; 540 libSpec.value.pathname = libname;
569 lib = PR_LoadLibraryWithFlags(libSpec, PR_LD_NOW | PR_LD_LOCAL); 541 lib = PR_LoadLibraryWithFlags(libSpec, PR_LD_NOW | PR_LD_LOCAL);
570 } 542 }
571 543
572 return lib; 544 return lib;
573 } 545 }
574 +#endif /* STATIC LIBRARIES */ 546 +#endif /* STATIC LIBRARIES */
575 547
576 /* 548 /*
577 * stub files for legacy db's to be able to encrypt and decrypt 549 * stub files for legacy db's to be able to encrypt and decrypt
578 * various keys and attributes. 550 * various keys and attributes.
579 */ 551 */
580 static SECStatus 552 static SECStatus
581 sftkdb_encrypt_stub(PRArenaPool *arena, SDB *sdb, SECItem *plainText, 553 sftkdb_encrypt_stub(PRArenaPool *arena, SDB *sdb, SECItem *plainText,
582 SECItem **cipherText) 554 SECItem **cipherText)
583 @@ -267,16 +269,31 @@ sftkdbLoad_Legacy(PRBool isFIPS) 555 @@ -267,16 +269,31 @@
584 * get cleared in shutdown */ 556 * get cleared in shutdown */
585 return SECFailure; 557 return SECFailure;
586 } 558 }
587 legacy_glue_libCheckSucceeded = PR_TRUE; 559 legacy_glue_libCheckSucceeded = PR_TRUE;
588 } 560 }
589 return SECSuccess; 561 return SECSuccess;
590 } 562 }
591 563
592 +#ifdef NSS_STATIC 564 +#ifdef NSS_STATIC
593 +#ifdef NSS_DISABLE_DBM 565 +#ifdef NSS_DISABLE_DBM
(...skipping 11 matching lines...) Expand all
605 +#endif 577 +#endif
606 +#else 578 +#else
607 lib = sftkdb_LoadLibrary(LEGACY_LIB_NAME); 579 lib = sftkdb_LoadLibrary(LEGACY_LIB_NAME);
608 if (lib == NULL) { 580 if (lib == NULL) {
609 return SECFailure; 581 return SECFailure;
610 } 582 }
611 583
612 legacy_glue_open = (LGOpenFunc)PR_FindFunctionSymbol(lib, "legacy_Open"); 584 legacy_glue_open = (LGOpenFunc)PR_FindFunctionSymbol(lib, "legacy_Open");
613 legacy_glue_readSecmod = (LGReadSecmodFunc) PR_FindFunctionSymbol(lib, 585 legacy_glue_readSecmod = (LGReadSecmodFunc) PR_FindFunctionSymbol(lib,
614 "legacy_ReadSecmodDB"); 586 "legacy_ReadSecmodDB");
615 @@ -292,21 +309,24 @@ sftkdbLoad_Legacy(PRBool isFIPS) 587 @@ -292,21 +309,24 @@
616 "legacy_SetCryptFunctions"); 588 "legacy_SetCryptFunctions");
617 589
618 if (!legacy_glue_open || !legacy_glue_readSecmod || 590 if (!legacy_glue_open || !legacy_glue_readSecmod ||
619 !legacy_glue_releaseSecmod || !legacy_glue_deleteSecmod || 591 !legacy_glue_releaseSecmod || !legacy_glue_deleteSecmod ||
620 !legacy_glue_addSecmod || !setCryptFunction) { 592 !legacy_glue_addSecmod || !setCryptFunction) {
621 PR_UnloadLibrary(lib); 593 PR_UnloadLibrary(lib);
622 return SECFailure; 594 return SECFailure;
623 } 595 }
624 +#endif /* NSS_STATIC */ 596 +#endif /* NSS_STATIC */
625 597
626 /* verify the loaded library if we are in FIPS mode */ 598 /* verify the loaded library if we are in FIPS mode */
627 if (isFIPS) { 599 if (isFIPS) {
628 if (!BLAPI_SHVerify(LEGACY_LIB_NAME,(PRFuncPtr)legacy_glue_open)) { 600 if (!BLAPI_SHVerify(LEGACY_LIB_NAME,(PRFuncPtr)legacy_glue_open)) {
629 +#ifndef NSS_STATIC 601 +#ifndef NSS_STATIC
630 PR_UnloadLibrary(lib); 602 PR_UnloadLibrary(lib);
631 +#endif 603 +#endif
632 return SECFailure; 604 return SECFailure;
633 } 605 }
634 legacy_glue_libCheckSucceeded = PR_TRUE; 606 legacy_glue_libCheckSucceeded = PR_TRUE;
635 } 607 }
636 608
637 setCryptFunction(sftkdb_encrypt_stub,sftkdb_decrypt_stub); 609 setCryptFunction(sftkdb_encrypt_stub,sftkdb_decrypt_stub);
638 legacy_glue_lib = lib; 610 legacy_glue_lib = lib;
639 return SECSuccess; 611 return SECSuccess;
640 @@ -413,20 +433,22 @@ sftkdbCall_Shutdown(void) 612 @@ -413,20 +433,22 @@
641 return CKR_OK; 613 return CKR_OK;
642 } 614 }
643 if (legacy_glue_shutdown) { 615 if (legacy_glue_shutdown) {
644 #ifdef NO_FORK_CHECK 616 #ifdef NO_FORK_CHECK
645 PRBool parentForkedAfterC_Initialize = PR_FALSE; 617 PRBool parentForkedAfterC_Initialize = PR_FALSE;
646 #endif 618 #endif
647 crv = (*legacy_glue_shutdown)(parentForkedAfterC_Initialize); 619 crv = (*legacy_glue_shutdown)(parentForkedAfterC_Initialize);
648 } 620 }
649 +#ifndef NSS_STATIC 621 +#ifndef NSS_STATIC
650 disableUnload = PR_GetEnv("NSS_DISABLE_UNLOAD"); 622 disableUnload = PR_GetEnv("NSS_DISABLE_UNLOAD");
651 if (!disableUnload) { 623 if (!disableUnload) {
652 PR_UnloadLibrary(legacy_glue_lib); 624 PR_UnloadLibrary(legacy_glue_lib);
653 } 625 }
654 +#endif 626 +#endif
655 legacy_glue_lib = NULL; 627 legacy_glue_lib = NULL;
656 legacy_glue_open = NULL; 628 legacy_glue_open = NULL;
657 legacy_glue_readSecmod = NULL; 629 legacy_glue_readSecmod = NULL;
658 legacy_glue_releaseSecmod = NULL; 630 legacy_glue_releaseSecmod = NULL;
659 legacy_glue_deleteSecmod = NULL; 631 legacy_glue_deleteSecmod = NULL;
660 legacy_glue_addSecmod = NULL; 632 legacy_glue_addSecmod = NULL;
661 legacy_glue_libCheckFailed = PR_FALSE; 633 legacy_glue_libCheckFailed = PR_FALSE;
662 legacy_glue_libCheckSucceeded = PR_FALSE; 634 legacy_glue_libCheckSucceeded = PR_FALSE;
663 Index: mozilla/security/nss/lib/softoken/lgglue.h 635 diff -r 3f0105dfc733 lib/softoken/lgglue.h
664 =================================================================== 636 --- a/lib/softoken/lgglue.h» Mon Apr 22 14:22:48 2013 +0200
665 RCS file: /cvsroot/mozilla/security/nss/lib/softoken/lgglue.h,v 637 +++ b/lib/softoken/lgglue.h» Mon Apr 22 14:33:38 2013 -0700
666 retrieving revision 1.5 638 @@ -33,16 +33,35 @@
667 diff -p -u -8 -r1.5 lgglue.h
668 --- mozilla/security/nss/lib/softoken/lgglue.h» 25 Apr 2012 14:50:10 -0000» 1.5
669 +++ mozilla/security/nss/lib/softoken/lgglue.h» 22 Sep 2012 15:22:32 -0000
670 @@ -33,16 +33,35 @@ typedef SECStatus (*LGDeleteSecmodFunc)(
671 const char *dbname, char *params, PRBool rw); 639 const char *dbname, char *params, PRBool rw);
672 typedef SECStatus (*LGAddSecmodFunc)(const char *appName, 640 typedef SECStatus (*LGAddSecmodFunc)(const char *appName,
673 const char *filename, 641 const char *filename,
674 const char *dbname, char *params, PRBool rw); 642 const char *dbname, char *params, PRBool rw);
675 typedef SECStatus (*LGShutdownFunc)(PRBool forked); 643 typedef SECStatus (*LGShutdownFunc)(PRBool forked);
676 typedef void (*LGSetForkStateFunc)(PRBool); 644 typedef void (*LGSetForkStateFunc)(PRBool);
677 typedef void (*LGSetCryptFunc)(LGEncryptFunc, LGDecryptFunc); 645 typedef void (*LGSetCryptFunc)(LGEncryptFunc, LGDecryptFunc);
678 646
679 +extern CK_RV legacy_Open(const char *dir, const char *certPrefix, 647 +extern CK_RV legacy_Open(const char *dir, const char *certPrefix,
680 + const char *keyPrefix, 648 + const char *keyPrefix,
(...skipping 15 matching lines...) Expand all
696 +extern void legacy_SetCryptFunctions(LGEncryptFunc, LGDecryptFunc); 664 +extern void legacy_SetCryptFunctions(LGEncryptFunc, LGDecryptFunc);
697 + 665 +
698 /* 666 /*
699 * Softoken Glue Functions 667 * Softoken Glue Functions
700 */ 668 */
701 CK_RV sftkdbCall_open(const char *dir, const char *certPrefix, 669 CK_RV sftkdbCall_open(const char *dir, const char *certPrefix,
702 const char *keyPrefix, 670 const char *keyPrefix,
703 int certVersion, int keyVersion, int flags, PRBool isFIPS, 671 int certVersion, int keyVersion, int flags, PRBool isFIPS,
704 SDB **certDB, SDB **keyDB); 672 SDB **certDB, SDB **keyDB);
705 char ** sftkdbCall_ReadSecmodDB(const char *appName, const char *filename, 673 char ** sftkdbCall_ReadSecmodDB(const char *appName, const char *filename,
706 Index: mozilla/security/nss/lib/util/secport.h 674 diff -r 3f0105dfc733 lib/util/secport.h
707 =================================================================== 675 --- a/lib/util/secport.h» Mon Apr 22 14:22:48 2013 +0200
708 RCS file: /cvsroot/mozilla/security/nss/lib/util/secport.h,v 676 +++ b/lib/util/secport.h» Mon Apr 22 14:33:38 2013 -0700
709 retrieving revision 1.28 677 @@ -207,16 +207,17 @@
710 diff -p -u -8 -r1.28 secport.h
711 --- mozilla/security/nss/lib/util/secport.h» 25 Apr 2012 14:50:16 -0000» 1.28
712 +++ mozilla/security/nss/lib/util/secport.h» 22 Sep 2012 15:22:32 -0000
713 @@ -216,16 +216,17 @@ sec_port_iso88591_utf8_conversion_functi
714 unsigned int maxOutBufLen, 678 unsigned int maxOutBufLen,
715 unsigned int *outBufLen 679 unsigned int *outBufLen
716 ); 680 );
717 681
718 extern int NSS_PutEnv(const char * envVarName, const char * envValue); 682 extern int NSS_PutEnv(const char * envVarName, const char * envValue);
719 683
720 extern int NSS_SecureMemcmp(const void *a, const void *b, size_t n); 684 extern int NSS_SecureMemcmp(const void *a, const void *b, size_t n);
721 685
722 +#ifndef NSS_STATIC 686 +#ifndef NSS_STATIC
723 /* 687 /*
724 * Load a shared library called "newShLibName" in the same directory as 688 * Load a shared library called "newShLibName" in the same directory as
725 * a shared library that is already loaded, called existingShLibName. 689 * a shared library that is already loaded, called existingShLibName.
726 * A pointer to a static function in that shared library, 690 * A pointer to a static function in that shared library,
727 * staticShLibFunc, is required. 691 * staticShLibFunc, is required.
728 * 692 *
729 * existingShLibName: 693 * existingShLibName:
730 * The file name of the shared library that shall be used as the 694 * The file name of the shared library that shall be used as the
731 @@ -250,12 +251,13 @@ extern int NSS_SecureMemcmp(const void * 695 @@ -241,12 +242,13 @@
732 * 696 *
733 * If the new shared library is not found in the same location as the reference 697 * If the new shared library is not found in the same location as the reference
734 * library, it will then be loaded from the normal system library path. 698 * library, it will then be loaded from the normal system library path.
735 */ 699 */
736 PRLibrary * 700 PRLibrary *
737 PORT_LoadLibraryFromOrigin(const char* existingShLibName, 701 PORT_LoadLibraryFromOrigin(const char* existingShLibName,
738 PRFuncPtr staticShLibFunc, 702 PRFuncPtr staticShLibFunc,
739 const char *newShLibName); 703 const char *newShLibName);
740 +#endif /* NSS_STATIC */ 704 +#endif /* NSS_STATIC */
741 705
742 SEC_END_PROTOS 706 SEC_END_PROTOS
743 707
744 #endif /* _SECPORT_H_ */ 708 #endif /* _SECPORT_H_ */
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698