| OLD | NEW |
| 1 /* | 1 /* |
| 2 * NSS utility functions | 2 * NSS utility functions |
| 3 * | 3 * |
| 4 * This Source Code Form is subject to the terms of the Mozilla Public | 4 * This Source Code Form is subject to the terms of the Mozilla Public |
| 5 * License, v. 2.0. If a copy of the MPL was not distributed with this | 5 * License, v. 2.0. If a copy of the MPL was not distributed with this |
| 6 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ | 6 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ |
| 7 /* $Id: nssinit.c,v 1.116 2012/04/25 14:50:04 gerv%gerv.net Exp $ */ | 7 /* $Id: nssinit.c,v 1.117 2012/06/26 22:27:30 rrelyea%redhat.com Exp $ */ |
| 8 | 8 |
| 9 #include <ctype.h> | 9 #include <ctype.h> |
| 10 #include <string.h> | 10 #include <string.h> |
| 11 #include "seccomon.h" | 11 #include "seccomon.h" |
| 12 #include "prerror.h" | 12 #include "prerror.h" |
| 13 #include "prinit.h" | 13 #include "prinit.h" |
| 14 #include "prprf.h" | 14 #include "prprf.h" |
| 15 #include "prmem.h" | 15 #include "prmem.h" |
| 16 #include "prtypes.h" | 16 #include "prtypes.h" |
| 17 #include "cert.h" | 17 #include "cert.h" |
| 18 #include "key.h" | 18 #include "key.h" |
| 19 #include "secmod.h" | 19 #include "secmod.h" |
| 20 #include "secoid.h" | 20 #include "secoid.h" |
| 21 #include "nss.h" | 21 #include "nss.h" |
| 22 #include "pk11func.h" | 22 #include "pk11func.h" |
| 23 #include "secerr.h" | 23 #include "secerr.h" |
| 24 #include "nssbase.h" | 24 #include "nssbase.h" |
| 25 #include "nssutil.h" | 25 #include "nssutil.h" |
| 26 #ifndef NSS_DISABLE_LIBPKIX | 26 #ifndef NSS_DISABLE_LIBPKIX |
| 27 #include "pkixt.h" | 27 #include "pkixt.h" |
| 28 #include "pkix.h" | 28 #include "pkix.h" |
| 29 #include "pkix_tools.h" | 29 #include "pkix_tools.h" |
| 30 #endif /* NSS_DISABLE_LIBPKIX */ | 30 #endif /* NSS_DISABLE_LIBPKIX */ |
| 31 | 31 |
| 32 #include "pki3hack.h" | 32 #include "pki3hack.h" |
| 33 #include "certi.h" | 33 #include "certi.h" |
| 34 #include "secmodi.h" | 34 #include "secmodi.h" |
| 35 #include "ocspti.h" | 35 #include "ocspti.h" |
| 36 #include "ocspi.h" | 36 #include "ocspi.h" |
| 37 #include "utilpars.h" |
| 37 | 38 |
| 38 /* | 39 /* |
| 39 * On Windows nss3.dll needs to export the symbol 'mktemp' to be | 40 * On Windows nss3.dll needs to export the symbol 'mktemp' to be |
| 40 * fully backward compatible with the nss3.dll in NSS 3.2.x and | 41 * fully backward compatible with the nss3.dll in NSS 3.2.x and |
| 41 * 3.3.x. This symbol was unintentionally exported and its | 42 * 3.3.x. This symbol was unintentionally exported and its |
| 42 * definition (in DBM) was moved from nss3.dll to softokn3.dll | 43 * definition (in DBM) was moved from nss3.dll to softokn3.dll |
| 43 * in NSS 3.4. See bug 142575. | 44 * in NSS 3.4. See bug 142575. |
| 44 */ | 45 */ |
| 45 #ifdef WIN32_NSS3_DLL_COMPAT | 46 #ifdef WIN32_NSS3_DLL_COMPAT |
| 46 #include <io.h> | 47 #include <io.h> |
| (...skipping 321 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 368 } | 369 } |
| 369 | 370 |
| 370 flags = nss_makeFlags(readOnly,noCertDB,noModDB,forceOpen, | 371 flags = nss_makeFlags(readOnly,noCertDB,noModDB,forceOpen, |
| 371 pwRequired, optimizeSpace); | 372 pwRequired, optimizeSpace); |
| 372 if (flags == NULL) return rv; | 373 if (flags == NULL) return rv; |
| 373 | 374 |
| 374 /* | 375 /* |
| 375 * configdir is double nested, and Windows uses the same character | 376 * configdir is double nested, and Windows uses the same character |
| 376 * for file seps as we use for escapes! (sigh). | 377 * for file seps as we use for escapes! (sigh). |
| 377 */ | 378 */ |
| 378 lconfigdir = secmod_DoubleEscape(configdir, '\'', '\"'); | 379 lconfigdir = NSSUTIL_DoubleEscape(configdir, '\'', '\"'); |
| 379 if (lconfigdir == NULL) { | 380 if (lconfigdir == NULL) { |
| 380 goto loser; | 381 goto loser; |
| 381 } | 382 } |
| 382 lcertPrefix = secmod_DoubleEscape(certPrefix, '\'', '\"'); | 383 lcertPrefix = NSSUTIL_DoubleEscape(certPrefix, '\'', '\"'); |
| 383 if (lcertPrefix == NULL) { | 384 if (lcertPrefix == NULL) { |
| 384 goto loser; | 385 goto loser; |
| 385 } | 386 } |
| 386 lkeyPrefix = secmod_DoubleEscape(keyPrefix, '\'', '\"'); | 387 lkeyPrefix = NSSUTIL_DoubleEscape(keyPrefix, '\'', '\"'); |
| 387 if (lkeyPrefix == NULL) { | 388 if (lkeyPrefix == NULL) { |
| 388 goto loser; | 389 goto loser; |
| 389 } | 390 } |
| 390 lsecmodName = secmod_DoubleEscape(secmodName, '\'', '\"'); | 391 lsecmodName = NSSUTIL_DoubleEscape(secmodName, '\'', '\"'); |
| 391 if (lsecmodName == NULL) { | 392 if (lsecmodName == NULL) { |
| 392 goto loser; | 393 goto loser; |
| 393 } | 394 } |
| 394 lupdateDir = secmod_DoubleEscape(updateDir, '\'', '\"'); | 395 lupdateDir = NSSUTIL_DoubleEscape(updateDir, '\'', '\"'); |
| 395 if (lupdateDir == NULL) { | 396 if (lupdateDir == NULL) { |
| 396 goto loser; | 397 goto loser; |
| 397 } | 398 } |
| 398 lupdCertPrefix = secmod_DoubleEscape(updCertPrefix, '\'', '\"'); | 399 lupdCertPrefix = NSSUTIL_DoubleEscape(updCertPrefix, '\'', '\"'); |
| 399 if (lupdCertPrefix == NULL) { | 400 if (lupdCertPrefix == NULL) { |
| 400 goto loser; | 401 goto loser; |
| 401 } | 402 } |
| 402 lupdKeyPrefix = secmod_DoubleEscape(updKeyPrefix, '\'', '\"'); | 403 lupdKeyPrefix = NSSUTIL_DoubleEscape(updKeyPrefix, '\'', '\"'); |
| 403 if (lupdKeyPrefix == NULL) { | 404 if (lupdKeyPrefix == NULL) { |
| 404 goto loser; | 405 goto loser; |
| 405 } | 406 } |
| 406 lupdateID = secmod_DoubleEscape(updateID, '\'', '\"'); | 407 lupdateID = NSSUTIL_DoubleEscape(updateID, '\'', '\"'); |
| 407 if (lupdateID == NULL) { | 408 if (lupdateID == NULL) { |
| 408 goto loser; | 409 goto loser; |
| 409 } | 410 } |
| 410 lupdateName = secmod_DoubleEscape(updateName, '\'', '\"'); | 411 lupdateName = NSSUTIL_DoubleEscape(updateName, '\'', '\"'); |
| 411 if (lupdateName == NULL) { | 412 if (lupdateName == NULL) { |
| 412 goto loser; | 413 goto loser; |
| 413 } | 414 } |
| 414 | 415 |
| 415 moduleSpec = PR_smprintf( | 416 moduleSpec = PR_smprintf( |
| 416 "name=\"%s\" parameters=\"configdir='%s' certPrefix='%s' keyPrefix='%s' " | 417 "name=\"%s\" parameters=\"configdir='%s' certPrefix='%s' keyPrefix='%s' " |
| 417 "secmod='%s' flags=%s updatedir='%s' updateCertPrefix='%s' " | 418 "secmod='%s' flags=%s updatedir='%s' updateCertPrefix='%s' " |
| 418 "updateKeyPrefix='%s' updateid='%s' updateTokenDescription='%s' %s\" " | 419 "updateKeyPrefix='%s' updateid='%s' updateTokenDescription='%s' %s\" " |
| 419 "NSS=\"flags=internal,moduleDB,moduleDBOnly,critical%s\"", | 420 "NSS=\"flags=internal,moduleDB,moduleDBOnly,critical%s\"", |
| 420 configName ? configName : NSS_DEFAULT_MOD_NAME, | 421 configName ? configName : NSS_DEFAULT_MOD_NAME, |
| (...skipping 858 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1279 return PR_FALSE; | 1280 return PR_FALSE; |
| 1280 } | 1281 } |
| 1281 return PR_TRUE; | 1282 return PR_TRUE; |
| 1282 } | 1283 } |
| 1283 | 1284 |
| 1284 const char * | 1285 const char * |
| 1285 NSS_GetVersion(void) | 1286 NSS_GetVersion(void) |
| 1286 { | 1287 { |
| 1287 return NSS_VERSION; | 1288 return NSS_VERSION; |
| 1288 } | 1289 } |
| OLD | NEW |