Closed Bug 242984 Opened 21 years ago Closed 21 years ago

workaround for incomplete NSPR I/O layer in lib/ssl

Categories

(NSS :: Libraries, defect, P2)

3.9.1
defect

Tracking

(Not tracked)

RESOLVED FIXED

People

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

Details

Attachments

(1 file, 2 obsolete files)

We have an application that has its own base NSPR I/O layer for sockets. Unfortunately, its layer is incomplete, and many callbacks were set to NULL. The applications functioned with NSPR 4.1 and NSS 3.3, but when moving to NSS 3.9 and NSPR 4.4, core dumps are seen upon SSL socket close due to the changes made to disable the nagle delay, and the application NSPR layer's NULL setsocketoption callback . We are making a fix to the application so that it has a complete NSPR I/O layer (at least, stub functions). However, because the update of the application and the NSPR/NSS components does not always happen simultaneously, I would like to make a workaround in libssl to check whether the setsocketoption callback is non-NULL before calling it, for NSS 3.9.2 .
Attachment #147947 - Flags: superreview?(wchang0222)
Attachment #147947 - Flags: review?(MisterSSL)
Priority: -- → P2
Target Milestone: --- → 3.9.2
Comment on attachment 147947 [details] [diff] [review] check for missing setsocketoption method sr=wtc. May want to make the types right as follows. 1. Declare 'rv' with the type SECStatus. 2. Add a (SECStatus) typecast before osfd->methods->setsocketoption(osfd, &opt), which returns PRStatus.
Attachment #147947 - Flags: superreview?(wchang0222) → superreview+
Comment on attachment 147947 [details] [diff] [review] check for missing setsocketoption method Julien, you should call PORT_SetError(PR_NOT_IMPLEMENTED_ERROR) if osfd->methods->setsocketoption is NULL. This is more important than getting the types (int/PRStatus/SECStatus) right. Please submit a new patch. Thanks.
Attachment #147947 - Flags: superreview+ → superreview-
Set the PR_NOT_IMPLEMENTED_ERROR error code if the setsocketoption method is missing. Feel free to edit this patch for taste.
Attachment #147947 - Attachment is obsolete: true
Attachment #147947 - Flags: review?(MisterSSL)
Attachment #148144 - Flags: superreview?(MisterSSL)
Attachment #148144 - Flags: review?(julien.pierre.bugs)
Comment on attachment 148144 [details] [diff] [review] check for missing setsocketoption method, v2 Looks good. I personally prefer to have fewer points of return (see the previous patch), but this works too.
Attachment #148144 - Flags: review?(julien.pierre.bugs) → review+
Attachment #148144 - Attachment is obsolete: true
Attachment #148156 - Flags: review?(wchang0222)
Comment on attachment 148156 [details] [diff] [review] third patch. stylistic changes, as well as typecasts r=MisterSSL
Attachment #148156 - Flags: superreview?(wchang0222)
Attachment #148156 - Flags: review?(wchang0222)
Attachment #148156 - Flags: review+
Fixed for 3.9.2 and tip. Checking in sslsock.c; /cvsroot/mozilla/security/nss/lib/ssl/sslsock.c,v <-- sslsock.c new revision: 1.31.38.1; previous revision: 1.31 Checking in sslsock.c; /cvsroot/mozilla/security/nss/lib/ssl/sslsock.c,v <-- sslsock.c new revision: 1.34; previous revision: 1.33
Status: NEW → RESOLVED
Closed: 21 years ago
Resolution: --- → FIXED
Attachment #148156 - Flags: superreview?(wchang0222) → superreview+
Comment on attachment 148144 [details] [diff] [review] check for missing setsocketoption method, v2 removing review request for obsolete patch
Attachment #148144 - Flags: superreview?(MisterSSL)
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: