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:
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:
Contains all the library code that are used to create the runtime libraries used by applications
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.
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.
Run the NSS test suite