Closed
Bug 1149850
Opened 11 years ago
Closed 10 years ago
Disable DTLS Renegotiation
Categories
(NSS :: Libraries, defect)
NSS
Libraries
Tracking
(firefox40 affected)
RESOLVED
FIXED
3.27
| Tracking | Status | |
|---|---|---|
| firefox40 | --- | affected |
People
(Reporter: mt, Assigned: mt)
Details
(Keywords: sec-audit)
Attachments
(2 files, 1 obsolete file)
|
5.78 KB,
patch
|
Details | Diff | Splinter Review | |
|
1.79 KB,
patch
|
ekr
:
review+
|
Details | Diff | Splinter Review |
As we've discovered today, renegotiation doesn't work in DTLS. It could be fixed, probably with not a great deal of work, but it's obvious no one uses it.
There is a little bit of dead code to remove as a result, but it's probably not that much.
Updated•11 years ago
|
Group: core-security
Comment 1•11 years ago
|
||
Restricting access until we can evaluate.
Comment 2•11 years ago
|
||
Attachment #8587055 -
Flags: feedback?(martin.thomson)
Comment 3•11 years ago
|
||
Wan-Teh,
After discussing this with Martin, we concluded that since we are
deprecating renegotiation, we should not put in the effort to fix
the bug he found where it didn't work with DTLS. As far as I know,
nobody uses it with DTLS.
Any objections?
Flags: needinfo?(wtc)
| Assignee | ||
Comment 4•11 years ago
|
||
Comment on attachment 8587055 [details] [diff] [review]
0001-Remove-renegotiation-for-DTLS.patch
Review of attachment 8587055 [details] [diff] [review]:
-----------------------------------------------------------------
This looks fine. I think that we should a) default the option to NEVER and b) prevent the option from ever being set to something other than NEVER.
Attachment #8587055 -
Flags: feedback?(martin.thomson)
Comment 5•11 years ago
|
||
Comment on attachment 8587055 [details] [diff] [review]
0001-Remove-renegotiation-for-DTLS.patch
Review of attachment 8587055 [details] [diff] [review]:
-----------------------------------------------------------------
::: external_tests/ssl_gtest/tls_agent.h
@@ +86,4 @@
> // Marks the state as CONNECTING in anticipation of renegotiation.
> void PrepareRenegotiate();
> // Prepares for renegotiation, then actually triggers it.
> + void StartRenegotiate(bool expect_success=true);
It is best to avoid the default argument. I assume it is a new C feature.
::: lib/ssl/ssl3con.c
@@ +5402,4 @@
> PORT_SetError(SSL_ERROR_RX_UNEXPECTED_HELLO_REQUEST);
> return SECFailure;
> }
> + if (IS_DTLS(ss) || ss->opt.enableRenegotiation == SSL_RENEGOTIATE_NEVER) {
Please find a convenient place to document that renegotiation is not supported in DTLS, and why (nobody needs it).
Comment 6•11 years ago
|
||
(In reply to Eric Rescorla (:ekr) from comment #3)
> Wan-Teh,
>
> After discussing this with Martin, we concluded that since we are
> deprecating renegotiation, we should not put in the effort to fix
> the bug he found where it didn't work with DTLS. As far as I know,
> nobody uses it with DTLS.
>
> Any objections?
This is fine by me if nobody needs it. This could become a
chicken-and-egg problem though and prevent others from
using renegotiation in DTLS.
Flags: needinfo?(wtc)
Comment 7•11 years ago
|
||
(In reply to Martin Thomson [:mt] from comment #4)
> Comment on attachment 8587055 [details] [diff] [review]
> 0001-Remove-renegotiation-for-DTLS.patch
>
> Review of attachment 8587055 [details] [diff] [review]:
> -----------------------------------------------------------------
>
> This looks fine. I think that we should a) default the option to NEVER and
> b) prevent the option from ever being set to something other than NEVER.
I assume you mean in DTLS?
Comment 8•11 years ago
|
||
(In reply to Wan-Teh Chang from comment #6)
> (In reply to Eric Rescorla (:ekr) from comment #3)
> > Wan-Teh,
> >
> > After discussing this with Martin, we concluded that since we are
> > deprecating renegotiation, we should not put in the effort to fix
> > the bug he found where it didn't work with DTLS. As far as I know,
> > nobody uses it with DTLS.
> >
> > Any objections?
>
> This is fine by me if nobody needs it. This could become a
> chicken-and-egg problem though and prevent others from
> using renegotiation in DTLS.
My sense is that we actually want to prevent them doing so.
Comment 9•11 years ago
|
||
(In reply to Wan-Teh Chang from comment #5)
> Comment on attachment 8587055 [details] [diff] [review]
> 0001-Remove-renegotiation-for-DTLS.patch
>
> Review of attachment 8587055 [details] [diff] [review]:
> -----------------------------------------------------------------
>
> ::: external_tests/ssl_gtest/tls_agent.h
> @@ +86,4 @@
> > // Marks the state as CONNECTING in anticipation of renegotiation.
> > void PrepareRenegotiate();
> > // Prepares for renegotiation, then actually triggers it.
> > + void StartRenegotiate(bool expect_success=true);
>
> It is best to avoid the default argument. I assume it is a new C feature.
These tests are in C++. However, I can remove the default argument
if you prefer.
> ::: lib/ssl/ssl3con.c
> @@ +5402,4 @@
> > PORT_SetError(SSL_ERROR_RX_UNEXPECTED_HELLO_REQUEST);
> > return SECFailure;
> > }
> > + if (IS_DTLS(ss) || ss->opt.enableRenegotiation == SSL_RENEGOTIATE_NEVER) {
>
> Please find a convenient place to document that renegotiation is not
> supported in DTLS, and why (nobody needs it).
Willdo.
Comment 10•11 years ago
|
||
Martin,
I took a look at what it would take to nail the option to NEVER.
Unfortunately, the difficulty is that the options are not conditioned
on the variant. See, for instance:
https://dxr.mozilla.org/mozilla-central/source/security/nss/lib/ssl/sslsock.c#886
We could override the defaults in the socket, e.g., here:
https://dxr.mozilla.org/mozilla-central/source/security/nss/lib/ssl/sslsock.c#2945
This would mean that you could get:
SSL_GetDefault(SSL_ENABLE_RENEGOTIATION, ...) --> SSL_RENEGOTIATE_REQUIRES_XTN
and then
fd = ssl_NewSocket(..., DTLS)
SSL_OptionGet(fd, SSL_ENABLE_RENEGOTIATION, ...) --> SSL_RENEGOTIATE_NEVER
Would you prefer that?
Comment 11•11 years ago
|
||
Comment on attachment 8587055 [details] [diff] [review]
0001-Remove-renegotiation-for-DTLS.patch
Review of attachment 8587055 [details] [diff] [review]:
-----------------------------------------------------------------
::: lib/ssl/ssl3con.c
@@ +5402,4 @@
> PORT_SetError(SSL_ERROR_RX_UNEXPECTED_HELLO_REQUEST);
> return SECFailure;
> }
> + if (IS_DTLS(ss) || ss->opt.enableRenegotiation == SSL_RENEGOTIATE_NEVER) {
Eric, Martin: it may be a cleaner change to simply force ss->opt.enableRenegotiation to be SSL_RENEGOTIATE_NEVER for all DTLS sockets. What do you think? This seems to be what Eric suggested in the NSS conference call this morning. I'm sorry I was a little absent-minded when Eric talked about this bug.
| Assignee | ||
Comment 12•11 years ago
|
||
I think that matches what I suggested. That avoids those three extra checks.
Comment 13•11 years ago
|
||
I will do that.
Comment 16•11 years ago
|
||
Let's have a patch first. I'll try to get to that this week.
Flags: needinfo?(ekr)
Updated•10 years ago
|
Group: core-security → crypto-core-security
| Assignee | ||
Comment 17•10 years ago
|
||
Found this old bug, seemed relatively important.
Attachment #8757178 -
Flags: review?(ekr)
Comment 18•10 years ago
|
||
Comment on attachment 8757178 [details] [diff] [review]
bug1149850-1.patch
Review of attachment 8757178 [details] [diff] [review]:
-----------------------------------------------------------------
::: lib/ssl/sslsock.c
@@ +736,5 @@
> case SSL_ENABLE_RENEGOTIATION:
> + if (IS_DTLS(ss) && on != SSL_RENEGOTIATE_NEVER) {
> + PORT_SetError(SEC_ERROR_INVALID_ARGS);
> + rv = SECFailure;
> + on = SSL_RENEGOTIATE_NEVER;
It seems that a failed function should have no side
effect. If you want to be secure by default, then we
should initialize ss->opt.enableRenegotiation to
SSL_RENEGOTIATE_NEVER for DTLS (which I think you did
below). So this line should be replaced with "break".
| Assignee | ||
Comment 19•10 years ago
|
||
The net effect is the same.
Attachment #8757178 -
Attachment is obsolete: true
Attachment #8757178 -
Flags: review?(ekr)
Attachment #8757665 -
Flags: review?(ekr)
| Assignee | ||
Comment 20•10 years ago
|
||
ekr, ping
Comment 21•10 years ago
|
||
Comment on attachment 8757665 [details] [diff] [review]
bug1149850-1.patch
Review of attachment 8757665 [details] [diff] [review]:
-----------------------------------------------------------------
LGTM
Attachment #8757665 -
Flags: review?(ekr) → review+
| Assignee | ||
Comment 22•10 years ago
|
||
Status: NEW → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
Target Milestone: --- → 3.27
| Assignee | ||
Updated•10 years ago
|
Assignee: nobody → martin.thomson
Updated•10 years ago
|
Group: crypto-core-security → core-security-release
Updated•7 years ago
|
Group: core-security-release
You need to log in
before you can comment on or make changes to this bug.
Description
•