NSS sources building testing

  • Revision slug: NSS_Sources_Building_Testing
  • Revision title: NSS Sources Building Testing
  • Revision id: 301427
  • Created:
  • Creator: Kaie
  • Is current revision? No
  • Comment

Revision Content

Getting the sourcecode of Network Security Services (NSS), how to build it, and how to run its test suite.

Getting Sourcecode, and a overview

The easiest way is to download archives of NSS releases from Mozilla's FTP server. Find the directory that contains the highest version number. Because NSS depends on the base library NSPR, you should download the archive that combines both NSS and NSPR.

For historical reasons, the directory hierarchy starts with the mozilla prefix. The NSPR base library is located in directory mozilla/nsprpub. All of the following directories are elements of the NSS sources:

  • mozilla/dbm
  • mozilla/security/dbm
  • mozilla/security/coreconf
  • mozilla/security/nss

Directory coreconf contains knowledge for cross platform building.  The dbm directories contain an implementation of the classic database format used by NSS. The majority of NSS is located contained in the subdirectory, with the following ones or particular interest:

  • mozilla/security/lib
    Contains all the library code that are used to create the runtime libraries used by applications
  • mozilla/security/cmd
    Contains a set of various tool programs that are built using NSS. Several tools are general purpose and can be used to inspect and manipulate the storage files that software using the NSS library creates and modifies. Other tools are only used for testing purposes. However, all these tools are good examples how to write software that makes use of the NSS library.
  • mozilla/security/test
    This directory contains the NSS test suite, that is routinely used to ensure that changes to NSS don't introduce regressions.

Some words regarding the difference between internal NSS code and exported interfaces. Software that would like to use the NSS library must use only the exported interfaces. These can be found by looking at the files with the .def file extension, inside the nss/lib directory hierarchy. Any C function that isn't contained in .def files is strictly for private use within NSS, and applications and test tools are not allowed to call them. For any functions that are listed in the .def files, NSS promises that the binary function interface (ABI) will remain stable.

Building NSS

The build process is driven by Makefiles from console windows. Because of the cross platform portability requirements, the build might behave different from what you are used to. In particular, NSS doesn't use configure scripts. You may set environment variables to define which build variation you want.

 

Run the NSS test suite

 

Revision Source

<p>Getting the sourcecode of <a href="https://developer.mozilla.org/en-US/docs/NSS" title="/en-US/docs/NSS">Network Security Services (NSS)</a>, how to build it, and how to run its test suite.</p>
<h2 id="Getting_Sourcecode.2C_and_a_overview">Getting Sourcecode, and a overview</h2>
<p>The easiest way is to download archives of NSS releases from <a href="ftp://ftp.mozilla.org/pub/mozilla.org/security/nss/releases/" title="ftp://ftp.mozilla.org/pub/mozilla.org/security/nss/releases/">Mozilla's FTP server</a>. Find the directory that contains the highest version number. Because NSS depends on the base library NSPR, you should download the archive that combines both NSS and NSPR.</p>
<p>For historical reasons, the directory hierarchy starts with the mozilla prefix. The NSPR base library is located in directory mozilla/nsprpub. All of the following directories are elements of the NSS sources:</p>
<ul>
  <li>mozilla/dbm</li>
  <li>mozilla/security/dbm</li>
  <li>mozilla/security/coreconf</li>
  <li>mozilla/security/nss</li>
</ul>
<p>Directory coreconf contains knowledge for cross platform building.&nbsp; The dbm directories contain an implementation of the classic database format used by NSS. The majority of NSS is located contained in the subdirectory, with the following ones or particular interest:</p>
<ul>
  <li>mozilla/security/lib<br />
    Contains all the library code that are used to create the runtime libraries used by applications</li>
  <li>mozilla/security/cmd<br />
    Contains a set of various tool programs that are built using NSS. Several tools are general purpose and can be used to inspect and manipulate the storage files that software using the NSS library creates and modifies. Other tools are only used for testing purposes. However, all these tools are good examples how to write software that makes use of the NSS library.</li>
  <li>mozilla/security/test<br />
    This directory contains the NSS test suite, that is routinely used to ensure that changes to NSS don't introduce regressions.</li>
</ul>
<p>Some words regarding the difference between internal NSS code and exported interfaces. Software that would like to use the NSS library must use only the exported interfaces. These can be found by looking at the files with the .def file extension, inside the nss/lib directory hierarchy. Any C function that isn't contained in .def files is strictly for private use within NSS, and applications and test tools are not allowed to call them. For any functions that are listed in the .def files, NSS promises that the binary function interface (ABI) will remain stable.</p>
<h2 id="Build_NSS">Building NSS</h2>
<p>The build process is driven by Makefiles from console windows. Because of the cross platform portability requirements, the build might behave different from what you are used to. In particular, NSS doesn't use configure scripts. You may set environment variables to define which build variation you want.</p>
<p>&nbsp;</p>
<h2 id="Run_the_NSS_test_suite">Run the NSS test suite</h2>
<p>&nbsp;</p>
Revert to this revision