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

Side by Side Diff: net/socket/ssl_client_socket_nss.cc

Issue 185553013: Standardize error reporting of IPEndPoint::ToSockAddr and (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 6 years, 9 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | net/socket/stream_listen_socket.cc » ('j') | net/socket/tcp_socket_libevent.cc » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 // This file includes code SSLClientSocketNSS::DoVerifyCertComplete() derived 5 // This file includes code SSLClientSocketNSS::DoVerifyCertComplete() derived
6 // from AuthCertificateCallback() in 6 // from AuthCertificateCallback() in
7 // mozilla/security/manager/ssl/src/nsNSSCallbacks.cpp. 7 // mozilla/security/manager/ssl/src/nsNSSCallbacks.cpp.
8 8
9 /* ***** BEGIN LICENSE BLOCK ***** 9 /* ***** BEGIN LICENSE BLOCK *****
10 * Version: MPL 1.1/GPL 2.0/LGPL 2.1 10 * Version: MPL 1.1/GPL 2.0/LGPL 2.1
(...skipping 3225 matching lines...) Expand 10 before | Expand all | Expand 10 after
3236 3236
3237 int SSLClientSocketNSS::InitializeSSLPeerName() { 3237 int SSLClientSocketNSS::InitializeSSLPeerName() {
3238 // Tell NSS who we're connected to 3238 // Tell NSS who we're connected to
3239 IPEndPoint peer_address; 3239 IPEndPoint peer_address;
3240 int err = transport_->socket()->GetPeerAddress(&peer_address); 3240 int err = transport_->socket()->GetPeerAddress(&peer_address);
3241 if (err != OK) 3241 if (err != OK)
3242 return err; 3242 return err;
3243 3243
3244 SockaddrStorage storage; 3244 SockaddrStorage storage;
3245 if (!peer_address.ToSockAddr(storage.addr, &storage.addr_len)) 3245 if (!peer_address.ToSockAddr(storage.addr, &storage.addr_len))
3246 return ERR_UNEXPECTED; 3246 return ERR_ADDRESS_INVALID;
3247 3247
3248 PRNetAddr peername; 3248 PRNetAddr peername;
3249 memset(&peername, 0, sizeof(peername)); 3249 memset(&peername, 0, sizeof(peername));
3250 DCHECK_LE(static_cast<size_t>(storage.addr_len), sizeof(peername)); 3250 DCHECK_LE(static_cast<size_t>(storage.addr_len), sizeof(peername));
3251 size_t len = std::min(static_cast<size_t>(storage.addr_len), 3251 size_t len = std::min(static_cast<size_t>(storage.addr_len),
3252 sizeof(peername)); 3252 sizeof(peername));
3253 memcpy(&peername, storage.addr, len); 3253 memcpy(&peername, storage.addr, len);
3254 3254
3255 // Adjust the address family field for BSD, whose sockaddr 3255 // Adjust the address family field for BSD, whose sockaddr
3256 // structure has a one-byte length and one-byte address family 3256 // structure has a one-byte length and one-byte address family
(...skipping 330 matching lines...) Expand 10 before | Expand all | Expand 10 after
3587 SignedCertificateTimestampAndStatus(*iter, 3587 SignedCertificateTimestampAndStatus(*iter,
3588 ct::SCT_STATUS_LOG_UNKNOWN)); 3588 ct::SCT_STATUS_LOG_UNKNOWN));
3589 } 3589 }
3590 } 3590 }
3591 3591
3592 ServerBoundCertService* SSLClientSocketNSS::GetServerBoundCertService() const { 3592 ServerBoundCertService* SSLClientSocketNSS::GetServerBoundCertService() const {
3593 return server_bound_cert_service_; 3593 return server_bound_cert_service_;
3594 } 3594 }
3595 3595
3596 } // namespace net 3596 } // namespace net
OLDNEW
« no previous file with comments | « no previous file | net/socket/stream_listen_socket.cc » ('j') | net/socket/tcp_socket_libevent.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698