On 2009-11-08 10:32 PDT, Marc Kaeser wrote: > Hello Robert, > > where can I get in touch with the NSS people you told me about?
Here in this mailing list (or newsgroup, depending on how you read it). > I'm facing following problem right now, maybe you can help me: > > in /security/nss/lib/pk11wrap/pk11util.c there is the function > SECMODModule * > SECMOD_GetInternalModule(void) > { > return internalModule; > } > > at line 134. > > I now know what a SECMODModuleStr is, but can't find where "internalModule" > is associated to such a struct. mxr is your friend. http://mxr.mozilla.org/security/ident?i=internalModule or http://mxr.mozilla.org/security/search?string=internalModule&case=on > If I understand the structure correctly, I usually have a module of type > SECMODModule (struct SECMODModuleStr) that holds flags, references to > several other structures, and a reference-array to all PK11SlotInfo-Objects > of that module, and themselves hold flags and references to > PK11Symkey-Objects. The PK11Symkey-Objects include infos about the keys they > describe, and a SECItem, the key itself. > > Now, in nsSDR, PK11GetInternalKeySlot(); adds a refcount > (PK11ReferenceSlot()) to one of its slots ([0] or [1]), and returns slots[0] > (or a ref to it) of the SECMODModule "InternalModule" if FIPS (still not > exactly sure how FIPS mode works), slots[1] if not FIPS. Right. > But where do that InternalModule and its slots come from? I haven't been > able to find out for the moment. Maybe after some initialization or > something? During NSS initialization, NSS reads in the configuration information for the PKCS#11 modules and builds a list of known modules. One of the modules has typically been configured as the "internal" module. When it is added to the list, NSS remembers that as the "internalModule". See http://bonsai.mozilla.org/cvsblame.cgi?file=mozilla/security/nss/lib/pk11wrap/pk11util.c&rev=1.57&mark=173-174#170 > > Thks a lot for a little explanation ^^ > > Marc -- dev-tech-crypto mailing list dev-tech-crypto@lists.mozilla.org https://lists.mozilla.org/listinfo/dev-tech-crypto