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

Issue 3571011: implement certificate verification state machine (Closed)

Created:
10 years, 2 months ago by joth
Modified:
9 years, 7 months ago
Reviewers:
wtc
CC:
chromium-reviews, cbentzel+watch_chromium.org, darin-cc_chromium.org, agl, Ryan Sleevi, bulach
Visibility:
Public.

Description

implement certificate verification state machine BUG=None TEST=None Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=61370

Patch Set 1 #

Patch Set 2 : tidy unneeded code #

Patch Set 3 : add server_cert_verify_result_ usage #

Total comments: 6

Patch Set 4 : wtc comments #

Total comments: 1
Unified diffs Side-by-side diffs Delta from patch set Stats (+144 lines, -35 lines) Patch
M net/socket/ssl_client_socket_openssl.h View 4 chunks +13 lines, -0 lines 0 comments Download
M net/socket/ssl_client_socket_openssl.cc View 1 2 3 9 chunks +131 lines, -35 lines 1 comment Download

Messages

Total messages: 5 (0 generated)
joth
This patch builds upon pending CL http://codereview.chromium.org/3518004/show Once these are in, it should just be ...
10 years, 2 months ago (2010-10-01 19:42:09 UTC) #1
wtc
LGTM. http://codereview.chromium.org/3571011/diff/5001/6001 File net/socket/ssl_client_socket_openssl.cc (right): http://codereview.chromium.org/3571011/diff/5001/6001#newcode346 net/socket/ssl_client_socket_openssl.cc:346: net_error = ERR_SSL_PROTOCOL_ERROR; This is unlikely to be ...
10 years, 2 months ago (2010-10-02 14:06:01 UTC) #2
joth
On 2 October 2010 15:06, <wtc@chromium.org> wrote: > LGTM. > > > http://codereview.chromium.org/3571011/diff/5001/6001 > File ...
10 years, 2 months ago (2010-10-04 13:30:05 UTC) #3
wtc
http://codereview.chromium.org/3571011/diff/5001/6001 File net/socket/ssl_client_socket_openssl.cc (right): http://codereview.chromium.org/3571011/diff/5001/6001#newcode346 net/socket/ssl_client_socket_openssl.cc:346: net_error = ERR_SSL_PROTOCOL_ERROR; You said: > My understanding is ...
10 years, 2 months ago (2010-10-04 23:13:53 UTC) #4
joth
10 years, 2 months ago (2010-10-05 12:04:15 UTC) #5
On 5 October 2010 00:13, <wtc@chromium.org> wrote:

>
> http://codereview.chromium.org/3571011/diff/5001/6001
> File net/socket/ssl_client_socket_openssl.cc (right):
>
> http://codereview.chromium.org/3571011/diff/5001/6001#newcode346
> net/socket/ssl_client_socket_openssl.cc:346: net_error =
> ERR_SSL_PROTOCOL_ERROR;
> You said:
>
>> My understanding is this is effectively the equivalent to
>> line 1929 of the NSS version:
>>       // SSL_ForceHandshake returned SECSuccess prematurely.
>> ...
>>       net_error = ERR_SSL_PROTOCOL_ERROR;
>>
>
> That is a workaround for an NSS bug.  OpenSSL doesn't
> have the bug, so this file does not need this workaround.
>
> Note: ERR_SSL_PROTOCOL_ERROR is appropriate for
> ssl_client_socket_nss.cc because the peer needs to violate
> the SSL protocol to cause SSL_ForceHandshake to return
> SECSuccess prematurely.
>
> You should CHECK/assert that the UpdateServerCert() call
> does not return NULL.
>
> Thanks for the explanation. Replaced with a CHECK.
May I expand the comment in the NSS version to mention this is a workaround?



> http://codereview.chromium.org/3571011/diff/10001/11001#newcode51
> net/socket/ssl_client_socket_openssl.cc:51: // TODO(joth): Implement
> full mapping.
> Typo: SYSVCALL => SYSCALL
>
> Thanks! I fixed that once but I obviously failed to save it.


> Should this really be mapped to ERR_SSL_PROTOCOL_ERROR?
> A system call failure is not an SSL protocol error.
>
> Good question. I need to hit the following case in  order for the SSLv3
fall-back to work:
http://codesearch.google.com/codesearch/p?hl=en#OAMlx_jo-ck/src/net/http/http...
Of the error codes present there, protocol error sounds the closest.

AFAICT, this occurs the result of the underlying socket read returning 0
(end of file); when that happens I shutdown the transport side of the BIO,
and then the SSL layer gets this error:
- SSL_do_handshake() returns 0.
- SSL_get_error() returns SSL_ERROR_SYSCALL
- errno holds 0
- ERR_get_error() returns 0 (i.e. nothing on the error stack).

None of these seem useful enough to make a more focused error mapping.

Guess I could make a note that the underlying transport was closed in some
bool, detect that when the handshake fails, and so map it to
ERR_CONNECTION_CLOSED or ERR_CONNECTION_RESET (need to work out which), and
then add either/both of those to the switch statement in
http_stream_request.cc, but that seems overkill (especially given the other
implementations are presumably already mapping an unexpected socket shutdown
in handshake to protocol error?)

Let me know what you think

Cheers

Powered by Google App Engine
This is Rietveld 408576698