OLD | NEW |
---|---|
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 2125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2136 // < 0 for error (or the non-error ERR_IO_PENDING). | 2136 // < 0 for error (or the non-error ERR_IO_PENDING). |
2137 int SSLClientSocketNSS::Core::BufferSend() { | 2137 int SSLClientSocketNSS::Core::BufferSend() { |
2138 DCHECK(OnNSSTaskRunner()); | 2138 DCHECK(OnNSSTaskRunner()); |
2139 | 2139 |
2140 if (transport_send_busy_) | 2140 if (transport_send_busy_) |
2141 return ERR_IO_PENDING; | 2141 return ERR_IO_PENDING; |
2142 | 2142 |
2143 const char* buf1; | 2143 const char* buf1; |
2144 const char* buf2; | 2144 const char* buf2; |
2145 unsigned int len1, len2; | 2145 unsigned int len1, len2; |
2146 memio_GetWriteParams(nss_bufs_, &buf1, &len1, &buf2, &len2); | 2146 if (memio_GetWriteParams(nss_bufs_, &buf1, &len1, &buf2, &len2)) { |
wtc
2014/06/17 22:48:55
IMPORTANT: please update the memio_GetWriteParams
davidben
2014/06/17 23:04:44
Done.
| |
2147 // It is important this return synchronously to prevent spinning infinitely | |
2148 // in the off-thread NSS case. The error code itself is ignored, so just | |
2149 // return ERR_ABORTED. See https://crbug.com/381160. | |
2150 return ERR_ABORTED; | |
2151 } | |
2147 const unsigned int len = len1 + len2; | 2152 const unsigned int len = len1 + len2; |
2148 | 2153 |
2149 int rv = 0; | 2154 int rv = 0; |
2150 if (len) { | 2155 if (len) { |
2151 scoped_refptr<IOBuffer> send_buffer(new IOBuffer(len)); | 2156 scoped_refptr<IOBuffer> send_buffer(new IOBuffer(len)); |
2152 memcpy(send_buffer->data(), buf1, len1); | 2157 memcpy(send_buffer->data(), buf1, len1); |
2153 memcpy(send_buffer->data() + len1, buf2, len2); | 2158 memcpy(send_buffer->data() + len1, buf2, len2); |
2154 | 2159 |
2155 if (OnNetworkTaskRunner()) { | 2160 if (OnNetworkTaskRunner()) { |
2156 rv = DoBufferSend(send_buffer.get(), len); | 2161 rv = DoBufferSend(send_buffer.get(), len); |
(...skipping 1457 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
3614 scoped_refptr<X509Certificate> | 3619 scoped_refptr<X509Certificate> |
3615 SSLClientSocketNSS::GetUnverifiedServerCertificateChain() const { | 3620 SSLClientSocketNSS::GetUnverifiedServerCertificateChain() const { |
3616 return core_->state().server_cert.get(); | 3621 return core_->state().server_cert.get(); |
3617 } | 3622 } |
3618 | 3623 |
3619 ServerBoundCertService* SSLClientSocketNSS::GetServerBoundCertService() const { | 3624 ServerBoundCertService* SSLClientSocketNSS::GetServerBoundCertService() const { |
3620 return server_bound_cert_service_; | 3625 return server_bound_cert_service_; |
3621 } | 3626 } |
3622 | 3627 |
3623 } // namespace net | 3628 } // namespace net |
OLD | NEW |