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

Unified Diff: net/socket/ssl_client_socket_impl.cc

Issue 2342123002: Fix error-handling for non-SSL_get_error functions. (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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/socket/ssl_client_socket_impl.cc
diff --git a/net/socket/ssl_client_socket_impl.cc b/net/socket/ssl_client_socket_impl.cc
index 94f7f1c418bbc3cb5a22c71873d159d07815e818..1c963b794274f24a064de2af18b0a27161d70121 100644
--- a/net/socket/ssl_client_socket_impl.cc
+++ b/net/socket/ssl_client_socket_impl.cc
@@ -597,17 +597,14 @@ int SSLClientSocketImpl::ExportKeyingMaterial(const base::StringPiece& label,
crypto::OpenSSLErrStackTracer err_tracer(FROM_HERE);
- int rv = SSL_export_keying_material(
- ssl_, out, outlen, label.data(), label.size(),
- reinterpret_cast<const unsigned char*>(context.data()), context.length(),
- has_context ? 1 : 0);
-
- if (rv != 1) {
- int ssl_error = SSL_get_error(ssl_, rv);
- LOG(ERROR) << "Failed to export keying material;"
- << " returned " << rv << ", SSL error code " << ssl_error;
- return MapOpenSSLError(ssl_error, err_tracer);
+ if (!SSL_export_keying_material(
+ ssl_, out, outlen, label.data(), label.size(),
+ reinterpret_cast<const unsigned char*>(context.data()),
+ context.length(), has_context ? 1 : 0)) {
+ LOG(ERROR) << "Failed to export keying material.";
+ return ERR_FAILED;
}
+
return OK;
}
@@ -1272,11 +1269,9 @@ int SSLClientSocketImpl::DoChannelIDLookupComplete(int result) {
// type.
DCHECK(channel_id_key_);
crypto::OpenSSLErrStackTracer err_tracer(FROM_HERE);
- int rv = SSL_set1_tls_channel_id(ssl_, channel_id_key_->key());
- if (!rv) {
+ if (!SSL_set1_tls_channel_id(ssl_, channel_id_key_->key())) {
LOG(ERROR) << "Failed to set Channel ID.";
- int err = SSL_get_error(ssl_, rv);
- return MapOpenSSLError(err, err_tracer);
+ return ERR_FAILED;
}
// Return to the handshake.
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698