Closed Bug 394271 Opened 14 years ago Closed 14 years ago
two public SSL functions require PRFD* to point to SSL layer
libSSL's methods that get called through NSPRs PRIOMethods table require that the PRFileDescriptor (PRFD) argument must be the SSL layer's PRFD. Nearly all other SSL functions that have PRFD arguments permit, but do not require, that the PRFD be the SSL layer's PRFD. They will work even if called with the PRFD from another layer in the stack, PROVIDED that there is only one SSL layer in the stack (which is the usual case). However, there are two functions, new in NSS 3.11, that require that the PRFD argument be precisely the SSL layer PRFD. They are SSL_ReHandshakeWithTimeout and SSL_ForceHandshakeWithTimeout. These are the only two callers to ssl_SetTimeout, also new in NSS 3.11. They require that the PRFD be the SSL layer's, rather than another layer in the stack, because ssl_SetTimeout calls ssl_GetPrivate to get the address of the sslSocket structure. Most other non-PRIOMethod functions call ssl_FindSocket instead of ssl_GetPrivate for this purpose. ssl_GetPrivate requires that its argument be an SSL layer PRFD, while ssl_FindSocket searches the stack for the SSL layer PRFD if the PRFD address passed to it is not an SSL layer PRFD. I propose to a) move ssl_SetTimeout to sslsecur.c, to be in the same file with its callers, b) make it a static function, and c) make it call ssl_FindSocket instead of ssl_GetPrivate.
This patch does what I proposed in comment 0.
OS: Windows XP → All
Priority: -- → P2
Hardware: PC → All
Target Milestone: --- → 3.11.8
Comment on attachment 278903 [details] [diff] [review] patch v1 r=wtc. We also need to remove the function declaration in sslimpl.h.
Attachment #278903 - Flags: superreview?(wtc) → review+
I'm asking Wan-Teh for SR again. Wan-Teh, if you are unable to set the SR flag, please don't cancel the SR request, and instead let's press this issue to get it fixed.
Attachment #278983 - Flags: review? → review?(julien.pierre.boogz)
Comment on attachment 278983 [details] [diff] [review] patch v2, removes func from header file I can't set superreview+ on this patch. The dropdown box for superreview only has empty (cancel request) and '?'. This patch is correct.
Attachment #278983 - Flags: review?(julien.pierre.boogz) → review+
On trunk: Checking in sslimpl.h; new revision: 1.60; previous revision: 1.59 Checking in sslsecur.c; new revision: 1.39; previous revision: 1.38 Checking in sslsock.c; new revision: 1.54; previous revision: 1.53
On branch: Checking in sslimpl.h; new revision: 188.8.131.52; previous revision: 184.108.40.206 Checking in sslsecur.c; new revision: 220.127.116.11; previous revision: 18.104.22.168 Checking in sslsock.c; new revision: 22.214.171.124; previous revision: 126.96.36.199
Status: NEW → RESOLVED
Closed: 14 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.