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

Side by Side Diff: net/socket/ssl_client_socket_impl.h

Issue 2350483002: Improve error pages on client certificate failures. (Closed)
Patch Set: Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef NET_SOCKET_SSL_CLIENT_SOCKET_IMPL_H_ 5 #ifndef NET_SOCKET_SSL_CLIENT_SOCKET_IMPL_H_
6 #define NET_SOCKET_SSL_CLIENT_SOCKET_IMPL_H_ 6 #define NET_SOCKET_SSL_CLIENT_SOCKET_IMPL_H_
7 7
8 #include <openssl/base.h> 8 #include <openssl/base.h>
9 #include <openssl/ssl.h> 9 #include <openssl/ssl.h>
10 #include <stddef.h> 10 #include <stddef.h>
(...skipping 19 matching lines...) Expand all
30 #include "net/ssl/openssl_ssl_util.h" 30 #include "net/ssl/openssl_ssl_util.h"
31 #include "net/ssl/scoped_openssl_types.h" 31 #include "net/ssl/scoped_openssl_types.h"
32 #include "net/ssl/ssl_client_cert_type.h" 32 #include "net/ssl/ssl_client_cert_type.h"
33 #include "net/ssl/ssl_config_service.h" 33 #include "net/ssl/ssl_config_service.h"
34 34
35 namespace base { 35 namespace base {
36 class FilePath; 36 class FilePath;
37 class SequencedTaskRunner; 37 class SequencedTaskRunner;
38 } 38 }
39 39
40 namespace crypto {
41 class OpenSSLErrStackTracer;
42 }
43
40 namespace net { 44 namespace net {
41 45
42 class CertVerifier; 46 class CertVerifier;
43 class CTVerifier; 47 class CTVerifier;
44 class SSLCertRequestInfo; 48 class SSLCertRequestInfo;
45 class SSLInfo; 49 class SSLInfo;
46 50
47 using SignedEkmMap = base::MRUCache<std::string, std::vector<uint8_t>>; 51 using SignedEkmMap = base::MRUCache<std::string, std::vector<uint8_t>>;
48 52
49 class SSLClientSocketImpl : public SSLClientSocket { 53 class SSLClientSocketImpl : public SSLClientSocket {
(...skipping 194 matching lines...) Expand 10 before | Expand all | Expand 10 after
244 // chosen in a UMA histogram. 248 // chosen in a UMA histogram.
245 void RecordNegotiationExtension() const; 249 void RecordNegotiationExtension() const;
246 250
247 // Records histograms for channel id support during full handshakes - resumed 251 // Records histograms for channel id support during full handshakes - resumed
248 // handshakes are ignored. 252 // handshakes are ignored.
249 void RecordChannelIDSupport() const; 253 void RecordChannelIDSupport() const;
250 254
251 // Returns whether TLS channel ID is enabled. 255 // Returns whether TLS channel ID is enabled.
252 bool IsChannelIDEnabled() const; 256 bool IsChannelIDEnabled() const;
253 257
258 // Returns the net error corresponding to the most recent OpenSSL
259 // error. ssl_error is the output of SSL_get_error.
260 int MapLastOpenSSLError(int ssl_error,
261 const crypto::OpenSSLErrStackTracer& tracer,
262 OpenSSLErrorInfo* info);
263
254 bool transport_send_busy_; 264 bool transport_send_busy_;
255 bool transport_recv_busy_; 265 bool transport_recv_busy_;
256 266
257 // Buffers which are shared by BoringSSL and SSLClientSocketImpl. 267 // Buffers which are shared by BoringSSL and SSLClientSocketImpl.
258 // GrowableIOBuffer is used to keep ownership and setting offset. 268 // GrowableIOBuffer is used to keep ownership and setting offset.
259 scoped_refptr<GrowableIOBuffer> send_buffer_; 269 scoped_refptr<GrowableIOBuffer> send_buffer_;
260 scoped_refptr<GrowableIOBuffer> recv_buffer_; 270 scoped_refptr<GrowableIOBuffer> recv_buffer_;
261 271
262 CompletionCallback user_connect_callback_; 272 CompletionCallback user_connect_callback_;
263 CompletionCallback user_read_callback_; 273 CompletionCallback user_read_callback_;
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after
359 SSLNegotiationExtension negotiation_extension_; 369 SSLNegotiationExtension negotiation_extension_;
360 // Written by the |channel_id_service_|. 370 // Written by the |channel_id_service_|.
361 std::unique_ptr<crypto::ECPrivateKey> channel_id_key_; 371 std::unique_ptr<crypto::ECPrivateKey> channel_id_key_;
362 // True if a channel ID was sent. 372 // True if a channel ID was sent.
363 bool channel_id_sent_; 373 bool channel_id_sent_;
364 // If non-null, the newly-established to be inserted into the session cache 374 // If non-null, the newly-established to be inserted into the session cache
365 // once certificate verification is done. 375 // once certificate verification is done.
366 ScopedSSL_SESSION pending_session_; 376 ScopedSSL_SESSION pending_session_;
367 // True if the initial handshake's certificate has been verified. 377 // True if the initial handshake's certificate has been verified.
368 bool certificate_verified_; 378 bool certificate_verified_;
379 // Set to true if a CertificateRequest was received.
380 bool certificate_requested_;
369 // The request handle for |channel_id_service_|. 381 // The request handle for |channel_id_service_|.
370 ChannelIDService::Request channel_id_request_; 382 ChannelIDService::Request channel_id_request_;
371 383
372 int signature_result_; 384 int signature_result_;
373 std::vector<uint8_t> signature_; 385 std::vector<uint8_t> signature_;
374 386
375 TransportSecurityState* transport_security_state_; 387 TransportSecurityState* transport_security_state_;
376 388
377 CTPolicyEnforcer* const policy_enforcer_; 389 CTPolicyEnforcer* const policy_enforcer_;
378 390
379 // pinning_failure_log contains a message produced by 391 // pinning_failure_log contains a message produced by
380 // TransportSecurityState::CheckPublicKeyPins in the event of a 392 // TransportSecurityState::CheckPublicKeyPins in the event of a
381 // pinning failure. It is a (somewhat) human-readable string. 393 // pinning failure. It is a (somewhat) human-readable string.
382 std::string pinning_failure_log_; 394 std::string pinning_failure_log_;
383 395
384 // True if PKP is bypassed due to a local trust anchor. 396 // True if PKP is bypassed due to a local trust anchor.
385 bool pkp_bypassed_; 397 bool pkp_bypassed_;
386 398
387 BoundNetLog net_log_; 399 BoundNetLog net_log_;
388 base::WeakPtrFactory<SSLClientSocketImpl> weak_factory_; 400 base::WeakPtrFactory<SSLClientSocketImpl> weak_factory_;
389 }; 401 };
390 402
391 } // namespace net 403 } // namespace net
392 404
393 #endif // NET_SOCKET_SSL_CLIENT_SOCKET_IMPL_H_ 405 #endif // NET_SOCKET_SSL_CLIENT_SOCKET_IMPL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698