106
edits
No edit summary |
(word smithing and seeking some clarifications) |
||
Line 6: | Line 6: | ||
NSS was designed as a library that a single application would use. The application would control how NSS was initialized and configured. | NSS was designed as a library that a single application would use. The application would control how NSS was initialized and configured. An application would initialize NSS early before any libraries that used NSS could run. NSS initialization is idempotent, so system libraries could initialize NSS successfully after the application had already initialized NSS. Then, whether called by the application or by system libraries, NSS would use the application's configuration for certificates and trust. If NSS wasn't initialized by the application before it was initialized by system libraries, NSS would use the configuration files specified by the system libraries. Libraries would typically detect the case where NSS was already initialized before they used it, and would remember that, and would not shut NSS down when they were shut down. | ||
There are | There are several problems with that design: | ||
# Like initialization, NSS shutdown is global over the entire application. | # Like initialization, NSS shutdown is global over the entire application, and is forceful. Consequently, if the library shuts down NSS without the application's knowledge, and the application makes subsequent calls to NSS functions, those calls would experience errors or even crashes. Libraries can reduce this risk by checking to see if NSS is already initialized when they start, and if it was, then do not attempt to shut down NSS later when they are finished. However, this approach still has problems in cases where the library has initialized NSS before the application. | ||
# In the same way if the application shuts NSS down without the library knowing, they library | # In the same way, if the application shuts NSS down without the library knowing, they library may experience errors or crashes. | ||
# If the library needs different databases to do its functions | # If the library needs different databases to do its functions than those that the application opened, the library won't be able to access them. | ||
# If the library initializes NSS first, and it | # If the library initializes NSS first, and it chose different databases than the application wants, or it initializes the databases read-only but the application needs read-write access, the application won't be able to access the databases it desires in the desired fashion. | ||
# If the application or library have different lists of trusted CA's, the first list wins. | # If the application or library have different lists of trusted CA's, the first initializer's list wins. | ||
# Multiple libraries may be using NSS multiplying the | # Multiple libraries may be using NSS, multiplying the problems. | ||
How we initially | How we initially intended to solve these problems: | ||
We intended to go to a single user/machine configuration for most applications and libraries, where all applications open the same set of databases for a particular user and machine. This configuration would | We intended to go to a single user/machine configuration for most applications and libraries, where all applications open the same set of databases for a particular user and machine. This configuration would not in any any one application's specific directory of application configuration files, but would be part of the system. One problem with this approach is that not all NSS applications run on systems which will have a 'system configured' NSS. In addition, there are still cases where the user may want to keep multiple different configurations for testing (Mozilla profiles for example). Finally, some applications only need read-only access to the NSS configuration, but other applications (like Firefox, or Thunderbird) need read-write access. This means if a read/only application initializes first, then a read/write application will not be able to update the database. (what?? --[[User:Nelsonb|MisterTLS]] 21:48, 1 September 2009 (UTC) ) | ||
Restrictions on any future solution: | Restrictions on any future solution: | ||
Line 25: | Line 25: | ||
1) '''NSS must maintain binary compatibility.''' Applications should not become more broken as a result of linking with this new functionality. This means the existing shutdown should shutdown NSS in the same way that it has in the past. | 1) '''NSS must maintain binary compatibility.''' Applications should not become more broken as a result of linking with this new functionality. This means the existing shutdown should shutdown NSS in the same way that it has in the past. | ||
The existing shutdown will close down all NSS internal references to object and free up internal lists. It is possible that the application may still | The existing shutdown will close down all NSS internal references to object and free up internal lists. It is possible that the application may still hold references to NSS objects (such as slots, keys, or certs that NSS has returned to it) in its address space. NSS will shutdown all slots that do not have outstanding object references to them. If NSS cannot shutdown all slots, it will return an error. At this point NSS is 'shutdown', but it will not be able to initialized again until all those outstanding references are freed. | ||
Few applications depend on this behavior, but there are some, usually applications which have some sort of dynamic profile switching code. Even though these apps are few, they must still continue to work. | Few applications depend on this behavior, but there are some, usually applications which have some sort of dynamic profile switching code. Even though these apps are few, they must still continue to work. (Do you mean continue to fail? --[[User:Nelsonb|MisterTLS]] 21:48, 1 September 2009 (UTC) ) | ||
2) '''NSS still maintains a single 'trust domain' in which certificates are verified | 2) '''NSS still maintains a single 'trust domain' in which certificates are verified.''' In a single process, NSS has the ability to process certificates in the context of any one of several independent trust domains, but many of NSS's existing API functions do not allow a trust domain to be explicitly specified. | ||
Support for explicit trust domains has long been on the NSS developers' 'wish list' but has not been implemented because there has been little or no demand from products that use NSS. Many uses of explicit trust domains may be better handled by the use of certificate policies. The primary use case for explicit trust domains currently identified is in virtual hosting services that service multiple customers through a single process web server. | |||
== Proposal == | == Proposal == |
edits