| OLD | NEW |
| 1 /* | 1 /* |
| 2 * NSS utility functions | 2 * NSS utility functions |
| 3 * | 3 * |
| 4 * ***** BEGIN LICENSE BLOCK ***** | 4 * ***** BEGIN LICENSE BLOCK ***** |
| 5 * Version: MPL 1.1/GPL 2.0/LGPL 2.1 | 5 * Version: MPL 1.1/GPL 2.0/LGPL 2.1 |
| 6 * | 6 * |
| 7 * The contents of this file are subject to the Mozilla Public License Version | 7 * The contents of this file are subject to the Mozilla Public License Version |
| 8 * 1.1 (the "License"); you may not use this file except in compliance with | 8 * 1.1 (the "License"); you may not use this file except in compliance with |
| 9 * the License. You may obtain a copy of the License at | 9 * the License. You may obtain a copy of the License at |
| 10 * http://www.mozilla.org/MPL/ | 10 * http://www.mozilla.org/MPL/ |
| (...skipping 18 matching lines...) Expand all Loading... |
| 29 * in which case the provisions of the GPL or the LGPL are applicable instead | 29 * in which case the provisions of the GPL or the LGPL are applicable instead |
| 30 * of those above. If you wish to allow use of your version of this file only | 30 * of those above. If you wish to allow use of your version of this file only |
| 31 * under the terms of either the GPL or the LGPL, and not to allow others to | 31 * under the terms of either the GPL or the LGPL, and not to allow others to |
| 32 * use your version of this file under the terms of the MPL, indicate your | 32 * use your version of this file under the terms of the MPL, indicate your |
| 33 * decision by deleting the provisions above and replace them with the notice | 33 * decision by deleting the provisions above and replace them with the notice |
| 34 * and other provisions required by the GPL or the LGPL. If you do not delete | 34 * and other provisions required by the GPL or the LGPL. If you do not delete |
| 35 * the provisions above, a recipient may use your version of this file under | 35 * the provisions above, a recipient may use your version of this file under |
| 36 * the terms of any one of the MPL, the GPL or the LGPL. | 36 * the terms of any one of the MPL, the GPL or the LGPL. |
| 37 * | 37 * |
| 38 * ***** END LICENSE BLOCK ***** */ | 38 * ***** END LICENSE BLOCK ***** */ |
| 39 /* $Id: nssinit.c,v 1.105 2010/01/22 02:10:54 wtc%google.com Exp $ */ | 39 /* $Id: nssinit.c,v 1.106 2010/04/03 20:06:00 nelson%bolyard.com Exp $ */ |
| 40 | 40 |
| 41 #include <ctype.h> | 41 #include <ctype.h> |
| 42 #include <string.h> | 42 #include <string.h> |
| 43 #include "seccomon.h" | 43 #include "seccomon.h" |
| 44 #include "prinit.h" | 44 #include "prinit.h" |
| 45 #include "prprf.h" | 45 #include "prprf.h" |
| 46 #include "prmem.h" | 46 #include "prmem.h" |
| 47 #include "cert.h" | 47 #include "cert.h" |
| 48 #include "key.h" | 48 #include "key.h" |
| 49 #include "secmod.h" | 49 #include "secmod.h" |
| (...skipping 528 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 578 if (noSingleThreadedModules || allowAlreadyInitializedModules || | 578 if (noSingleThreadedModules || allowAlreadyInitializedModules || |
| 579 dontFinalizeModules) { | 579 dontFinalizeModules) { |
| 580 pk11_setGlobalOptions(noSingleThreadedModules, | 580 pk11_setGlobalOptions(noSingleThreadedModules, |
| 581 allowAlreadyInitializedModules, | 581 allowAlreadyInitializedModules, |
| 582 dontFinalizeModules); | 582 dontFinalizeModules); |
| 583 } | 583 } |
| 584 | 584 |
| 585 if (initContextPtr) { | 585 if (initContextPtr) { |
| 586 *initContextPtr = PORT_ZNew(NSSInitContext); | 586 *initContextPtr = PORT_ZNew(NSSInitContext); |
| 587 if (*initContextPtr == NULL) { | 587 if (*initContextPtr == NULL) { |
| 588 » return SECFailure; | 588 » goto loser; |
| 589 } | 589 } |
| 590 /* | 590 /* |
| 591 * For traditional NSS_Init, we used the PK11_Configure() call to set | 591 * For traditional NSS_Init, we used the PK11_Configure() call to set |
| 592 * globals. with InitContext, we pass those strings in as parameters. | 592 * globals. with InitContext, we pass those strings in as parameters. |
| 593 * | 593 * |
| 594 * This allows old NSS_Init calls to work as before, while at the same | 594 * This allows old NSS_Init calls to work as before, while at the same |
| 595 * time new calls and old calls will not interfere with each other. | 595 * time new calls and old calls will not interfere with each other. |
| 596 */ | 596 */ |
| 597 if (initParams) { | 597 if (initParams) { |
| 598 if (initParams->length < sizeof(NSSInitParameters)) { | 598 if (initParams->length < sizeof(NSSInitParameters)) { |
| 599 PORT_SetError(SEC_ERROR_INVALID_ARGS); | 599 PORT_SetError(SEC_ERROR_INVALID_ARGS); |
| 600 » » return SECFailure; | 600 » » goto loser; |
| 601 } | 601 } |
| 602 configStrings = nss_MkConfigString(initParams->manufactureID, | 602 configStrings = nss_MkConfigString(initParams->manufactureID, |
| 603 initParams->libraryDescription, | 603 initParams->libraryDescription, |
| 604 initParams->cryptoTokenDescription, | 604 initParams->cryptoTokenDescription, |
| 605 initParams->dbTokenDescription, | 605 initParams->dbTokenDescription, |
| 606 initParams->cryptoSlotDescription, | 606 initParams->cryptoSlotDescription, |
| 607 initParams->dbSlotDescription, | 607 initParams->dbSlotDescription, |
| 608 initParams->FIPSSlotDescription, | 608 initParams->FIPSSlotDescription, |
| 609 initParams->FIPSTokenDescription, | 609 initParams->FIPSTokenDescription, |
| 610 initParams->minPWLen); | 610 initParams->minPWLen); |
| 611 if (configStrings == NULL) { | 611 if (configStrings == NULL) { |
| 612 PORT_SetError(SEC_ERROR_NO_MEMORY); | 612 PORT_SetError(SEC_ERROR_NO_MEMORY); |
| 613 » » return SECFailure; | 613 » » goto loser; |
| 614 } | 614 } |
| 615 configName = initParams->libraryDescription; | 615 configName = initParams->libraryDescription; |
| 616 passwordRequired = initParams->passwordRequired; | 616 passwordRequired = initParams->passwordRequired; |
| 617 } | 617 } |
| 618 } else { | 618 } else { |
| 619 configStrings = pk11_config_strings; | 619 configStrings = pk11_config_strings; |
| 620 configName = pk11_config_name; | 620 configName = pk11_config_name; |
| 621 passwordRequired = pk11_password_required; | 621 passwordRequired = pk11_password_required; |
| 622 } | 622 } |
| 623 | 623 |
| (...skipping 582 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1206 if (vmajor == NSS_VMAJOR && vminor == NSS_VMINOR && | 1206 if (vmajor == NSS_VMAJOR && vminor == NSS_VMINOR && |
| 1207 vpatch == NSS_VPATCH && vbuild > NSS_VBUILD) { | 1207 vpatch == NSS_VPATCH && vbuild > NSS_VBUILD) { |
| 1208 return PR_FALSE; | 1208 return PR_FALSE; |
| 1209 } | 1209 } |
| 1210 /* Check dependent libraries */ | 1210 /* Check dependent libraries */ |
| 1211 if (PR_VersionCheck(PR_VERSION) == PR_FALSE) { | 1211 if (PR_VersionCheck(PR_VERSION) == PR_FALSE) { |
| 1212 return PR_FALSE; | 1212 return PR_FALSE; |
| 1213 } | 1213 } |
| 1214 return PR_TRUE; | 1214 return PR_TRUE; |
| 1215 } | 1215 } |
| OLD | NEW |