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

Unified Diff: net/ssl/openssl_ssl_util.cc

Issue 2958563002: Revert "Disable the buggy RSA parser by default." (Closed)
Patch Set: Created 3 years, 6 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 | « crypto/openssl_util.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/ssl/openssl_ssl_util.cc
diff --git a/net/ssl/openssl_ssl_util.cc b/net/ssl/openssl_ssl_util.cc
index a51063d460526761591bf8a50a41cf64b86205f9..21b2b5656456c281ed59991148bbd8ae4db2caea 100644
--- a/net/ssl/openssl_ssl_util.cc
+++ b/net/ssl/openssl_ssl_util.cc
@@ -173,26 +173,26 @@ int MapOpenSSLErrorWithDetails(int err,
return ERR_FAILED;
case SSL_ERROR_SSL:
// Walk down the error stack to find an SSL or net error.
- while (true) {
- OpenSSLErrorInfo error_info;
- error_info.error_code =
- ERR_get_error_line(&error_info.file, &error_info.line);
- if (error_info.error_code == 0) {
- // Map errors to ERR_SSL_PROTOCOL_ERROR by default, reporting the most
- // recent error in |*out_error_info|.
- return ERR_SSL_PROTOCOL_ERROR;
- }
-
- *out_error_info = error_info;
- if (ERR_GET_LIB(error_info.error_code) == ERR_LIB_SSL) {
- return MapOpenSSLErrorSSL(error_info.error_code);
- }
- if (ERR_GET_LIB(error_info.error_code) == OpenSSLNetErrorLib()) {
+ uint32_t error_code;
+ const char* file;
+ int line;
+ do {
+ error_code = ERR_get_error_line(&file, &line);
+ if (ERR_GET_LIB(error_code) == ERR_LIB_SSL) {
+ out_error_info->error_code = error_code;
+ out_error_info->file = file;
+ out_error_info->line = line;
+ return MapOpenSSLErrorSSL(error_code);
+ } else if (ERR_GET_LIB(error_code) == OpenSSLNetErrorLib()) {
+ out_error_info->error_code = error_code;
+ out_error_info->file = file;
+ out_error_info->line = line;
// Net error codes are negative but encoded in OpenSSL as positive
// numbers.
- return -ERR_GET_REASON(error_info.error_code);
+ return -ERR_GET_REASON(error_code);
}
- }
+ } while (error_code != 0);
+ return ERR_FAILED;
default:
// TODO(joth): Implement full mapping.
LOG(WARNING) << "Unknown OpenSSL error " << err;
« no previous file with comments | « crypto/openssl_util.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698