Closed Bug 201808 Opened 23 years ago Closed 23 years ago

Builtin root certs module does not load under gcc OS/2 build

Categories

(NSS :: Libraries, defect, P1)

x86
OS/2
defect

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: julien.pierre, Assigned: julien.pierre)

Details

Attachments

(3 files, 4 obsolete files)

I downloaded the new gcc OS/2 build of 1.4 alpha today. After creating a new profile, I visited some banking SSL servers. I was prompted to accept every single SSL server certificates. This did not happen in previous versions of Mozilla. The problem is that the root cert module nssckbi.dll won't load in this new build, even with a new secmod.db .
Priority: -- → P1
Target Milestone: --- → 3.8.1
This is probably because I lxlited all the DLLs so the CRC check is failing.
You definitely can't lxlite softokn3.dll . That will make the FIPS check fail. However, there is no check that I am aware of on the nssckbi.dll, which is the DLL that didn't load in this case.
We are not exporting C_GetFunctionsList when building under GCC. Need to make it create a DEF file for that purpose.
Attached patch patch (obsolete) — — Splinter Review
Overrode the rule for SHARED_LIBRARY to produce the DEF file. I first tried to override the MAPFILE rule in coreconf/rules.mk (so I wouldn't need to touch the SHARED_LIBRARY rule). In the builtins/Makefile, I created a new MAPFILE rule that didn't depend on another file and created the DEF file that I wanted. When I ran make, it would tell me that it was ignoring the MAPFILE rule in rules.mk, but then it would give me an error saying that it could couldn't find a file it depended on. Any ideas why I would get this error?
Comment on attachment 120632 [details] [diff] [review] patch Javier, why don't you just add a security/nss/lib/ckfw/builtins/nssckbi.def file to the source tree?
Attached patch patch v2 (obsolete) — — Splinter Review
Yes, that is better. For some reason, I assumed that adding a new MAPFILE would apply to all platforms. But I just defined MAPFILE only for OS/2 with GCC. New def file attached below.
Attachment #120632 - Attachment is obsolete: true
Attached file nssckbi.def (obsolete) —
Not quite sure what numbers to plug in for the release...
Attached patch patch v2.1 (obsolete) — — Splinter Review
Missed a step.
Attachment #120701 - Attachment is obsolete: true
Comment on attachment 120703 [details] nssckbi.def This file appears to be MPL/GPL (c) 2000 netscape. It's also brand new so i believe it should be (c) 2003. Is the rest of the license correct for this module? I'm not sure what the rules for new files are wrt trilicensing.
Comment on attachment 120703 [details] nssckbi.def Javier, Thank you for putting together this file. I'd like to suggest that you export all the symbols that should be exported, even though NSS only needs C_GetFunctionList. The list of all the C_ functions that should be exported can be found in this header file: http://lxr.mozilla.org/security/source/security/nss/lib/softoken/pkcs11f.h. As timeless pointed out, the copyright should be 2003.
Attachment #120703 - Flags: review-
Also, nssckbi.def should be used on *all* platforms, not just OS/2 GCC. This should simplify your patch. bob
Where do I get the correct license? I just copied it from ssl.def. I'll put together another patch.
wtc: If I just take the C_functions list straight from that file, I get link errors. I only seem to be able to resolve the list errors if I prepend "NSSCKFW" to every C_function other than C_GetFunctionList. Is this correct?
Javier, you are right. In nss/lib/ckfw/nssck.api, we only implement C_GetFunctionList and no other C_ functions: ===================================== /* This one is always present */ #if defined(WIN32) || defined(XP_OS2_VACPP) CK_RV _declspec(dllexport) #else CK_RV CK_ENTRY #endif C_GetFunctionList ( CK_FUNCTION_LIST_PTR_PTR ppFunctionList ) { return __ADJOIN(MODULE_NAME,C_GetFunctionList)(ppFunctionList); } ===================================== Perhaps another way to fix this bug is to simply change XP_OS2_VACPP to XP_OS2? Does gcc for OS/2 understand _declspec(dllexport) or __declspec(dllexport)? It might still be better to use a .def file to control the exported symbols. Bob, given that nssckbi.dll only implements C_GetFunctionList, do you think the nssckbi.def in attachment 120703 [details] is okay?
OK, If that's the case, we should only export C_GetFunctionList and write a separate bug about the fact that the rest of the entry points are not defined. That issue doesn't need to get resolved to OS/2 GCC to work, so it's not a high priority. wtc, I would rather not fix the issue with DLL Export because it's platform dependent. bob
Comment on attachment 120703 [details] nssckbi.def r=wtc. I will change it to say (C) 2003 when I check it in.
Attachment #120703 - Flags: review- → review+
Attached patch patch v2.2 — — Splinter Review
Javier, could you try this patch instead? This enables the use of the nssckbi.def on all platforms.
Attachment #120706 - Attachment is obsolete: true
Attached file nssckbi.def v1.1 —
I changed the copyright year to 2003, the symbol version to NSS_3.1 (because nssckbi.dll was added in NSS 3.1), and added the missing ; after C_GetFunctionList.
Attachment #120703 - Attachment is obsolete: true
Wan-Teh, Patches 120741 and 120765 worked for me with my gcc OS/2 build, and the nssckbi.dll module was able to load in the browser.
We don't need to use _declspec(dllexport) to export C_GetFunctionList now. nssckbi.def takes care of that.
I checked in all patches on the NSS TIP. I tested the new nssckbi.dll on Windows with Netscape 7. It works. Julien, could you check the patches into the NSS_3_8_BRANCH and NSS_CLIENT_TAG after we pass NSS Tinderbox QA? To change NSS_CLIENT_TAG you need to follow the tree status on the SeaMonkey tinderbox page.
Assignee: wtc → jpierre
Thanks for looking at the patches, Julien. Thanks for putting them together, wtc. So why do we want to export the other functions from the DLL, when C_GetFunctionList returns those same functions?
It's not necessary for NSS to work, because NSS only uses the function table pointer, but it makes nssckbi more compliant to the PKCS #11 spec. bob
Julien: Could you please check this in to the appropriate branches (see Comment #21). This patch does not seem to be on the trunk or in 1.4b. Thanks.
Checked in to NSS_3_8_BRANCH : Checking in ckapi.perl; /cvsroot/mozilla/security/nss/lib/ckfw/ckapi.perl,v <-- ckapi.perl new revision: 1.5.36.1; previous revision: 1.5 done Checking in nssck.api; /cvsroot/mozilla/security/nss/lib/ckfw/nssck.api,v <-- nssck.api new revision: 1.4.2.1; previous revision: 1.4 done Checking in builtins/manifest.mn; /cvsroot/mozilla/security/nss/lib/ckfw/builtins/manifest.mn,v <-- manifest.mn new revision: 1.6.34.1; previous revision: 1.6 done Checking in builtins/nssckbi.def; /cvsroot/mozilla/security/nss/lib/ckfw/builtins/nssckbi.def,v <-- nssckbi.def new revision: 1.1.2.1; previous revision: 1.1 done also moved the NSS_CLIENT_TAG .
Fixed in 3.8.1 .
Status: NEW → RESOLVED
Closed: 23 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: