Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(26)

Issue 3208003: Don't break on auth if we are about to do client auth.... (Closed)

Created:
10 years, 4 months ago by wtc
Modified:
9 years, 7 months ago
Reviewers:
Ryan Sleevi
CC:
chromium-reviews, John Grabowski, cbentzel+watch_chromium.org, pam+watch_chromium.org, darin-cc_chromium.org
Visibility:
Public.

Description

Don't break on auth if we are about to do client auth. Don't call SSL_SetSessionOption after the initial handshake is done because it'll fail with the badReqErr (-909) error. R=rsleevi BUG=45576, 52152 TEST=Visit any site that requests SSL client auth over renegotiation. Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=58299

Patch Set 1 #

Total comments: 6

Patch Set 2 : Address rsleevi's comments. #

Patch Set 3 : Fix a typo in comment. #

Patch Set 4 : Upload before checkin #

Unified diffs Side-by-side diffs Delta from patch set Stats (+13 lines, -28 lines) Patch
M net/socket/ssl_client_socket_mac.cc View 1 2 3 4 chunks +13 lines, -28 lines 0 comments Download

Messages

Total messages: 10 (0 generated)
Ryan Sleevi
Uploaded http://codereview.chromium.org/3120036/show
10 years, 4 months ago (2010-08-26 04:01:06 UTC) #1
wtc
I think we should use a simple fix along the line of this CL for ...
10 years, 4 months ago (2010-08-26 23:10:54 UTC) #2
Ryan Sleevi
Wan-Teh, This looks good, but I have two concerns about this that you may wish ...
10 years, 4 months ago (2010-08-27 00:38:24 UTC) #3
wtc
rsleevi: Thanks for your comments. I made all of your suggested changes, except the false ...
10 years, 3 months ago (2010-09-01 02:14:12 UTC) #4
Ryan Sleevi
LGTM then.
10 years, 3 months ago (2010-09-01 02:33:16 UTC) #5
Ryan Sleevi
On 2010/09/01 02:14:12, wtc wrote: > Again, I am going to a small patch to ...
10 years, 3 months ago (2010-09-01 03:50:40 UTC) #6
wtc
rsleevi: thank you for looking into this. I think I know why https://www.startssl.com/logon.ssl and https://openid4.me/ ...
10 years, 3 months ago (2010-09-01 04:06:24 UTC) #7
wtc
On 2010/09/01 03:50:40, rsleevi wrote: > > For what it's worth on investigation, the problem ...
10 years, 3 months ago (2010-09-01 04:16:04 UTC) #8
wtc
On 2010/09/01 03:50:40, rsleevi wrote: > > Switching client_socket_factory.cc:36 to check > send_client_cert AND client_cert ...
10 years, 3 months ago (2010-09-02 02:44:06 UTC) #9
Ryan Sleevi
10 years, 3 months ago (2010-09-02 04:22:05 UTC) #10
On 2010/09/02 02:44:06, wtc wrote:
> On 2010/09/01 03:50:40, rsleevi wrote:
> >
> > Switching client_socket_factory.cc:36 to check
> > send_client_cert AND client_cert causes the NSS socket to be used for the
> entire
> > conversation, ...
> 
> This is essentially what the original code does.  The original
> code checks client_cert. In r56056, mbelshe changed the check to
> send_client_cert.  We can change it back, but I don't think it
> matters, unless there is an advantage to let NSS handle the
> (send_client_cert=true, client_cert=NULL) case.  What do you
> think?

I don't know if there is anyone in the wild doing this, but the use case would
be a server that requests renegotiation, requests a client certificate, requires
secure renegotiation, and the user doesn't have a matching client certificate.
In that case, using the NSS socket for the entire conversation should/could (I
don't know if it will today) allow the conversation to continue. That way, the
server's 'native' error message could be displayed - which may include, say, an
alternate form of logon (eg: via form-based credentials with an e-mailed OTP, or
whatever they find sufficient for security)

Again, i don't know if such a server exists in the wild, but given ST's lack of
secure renegotiation, it'd be a possibility. Of course, I wholly agree - using
NSS entirely for the TLS conversation is arguably the best way to solve that
particular problem (and the myriad others that emerge)

> 
> > If you wanted to apply a partial fix to it, consider
> adapting/copying/(moving?)
> > lines 1105/1106 -1120 to happen around lines 1161. SSLHandshake will return
> > noErr once the ChangeCipherSpec/Finished is sent, meaning it will not wait
> > for/check the server's response until the SSLRead call in DoPayloadRead.
With
> > that change, you'll at least be able to return ERR_BAD_SSL_CLIENT_AUTH_CERT,
> > which is perhaps a more meaningful error message.
> 
> I actually tried this change yesterday afternoon.  Unfortunately
> the SSLGetClientCertificateState call returns a client_state of
> kSSLClientCertNone.  Secure Transport docs says:
>
http://developer.apple.com/mac/library/documentation/Security/Reference/secur...
> 
>     The value returned reflects the latest change in the state
>     of the client certificate exchange. If either peer initiates
>     a renegotiation attempt, Secure Transport resets the state
>     to kSSLClientCertNone.
> 
> Perhaps that's why?  I am on Mac OS X 10.6.4.

Hrm. In my packet captures, I was receiving a Certificate Request in the
re-handshake, and SecureTransport was updating with kSSLClientCertRequested when
I called. I'm tempted to re-run the tests with both patches, but I suspect at
this point, there are enough bugs/issues in how the ST state machine behaves
that it's not worth trying to work through all those, as opposed to get the NSS
stuff working.

Powered by Google App Engine
This is Rietveld 408576698