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

Side by Side Diff: runtime/bin/secure_socket_boringssl.cc

Issue 2683703004: [dart:io] A small boringssl cleanup from davidben@ (Closed)
Patch Set: Created 3 years, 10 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 #if !defined(DART_IO_DISABLED) && !defined(DART_IO_SECURE_SOCKET_DISABLED) 5 #if !defined(DART_IO_DISABLED) && !defined(DART_IO_SECURE_SOCKET_DISABLED)
6 6
7 #include "platform/globals.h" 7 #include "platform/globals.h"
8 #if defined(TARGET_OS_ANDROID) || defined(TARGET_OS_LINUX) || \ 8 #if defined(TARGET_OS_ANDROID) || defined(TARGET_OS_LINUX) || \
9 defined(TARGET_OS_WINDOWS) || defined(TARGET_OS_FUCHSIA) 9 defined(TARGET_OS_WINDOWS) || defined(TARGET_OS_FUCHSIA)
10 10
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
84 // null-terminated string. 84 // null-terminated string.
85 static void FetchErrorString(const SSL* ssl, TextBuffer* text_buffer) { 85 static void FetchErrorString(const SSL* ssl, TextBuffer* text_buffer) {
86 uint32_t error = 0; 86 uint32_t error = 0;
87 const char* path = NULL; 87 const char* path = NULL;
88 int line = -1; 88 int line = -1;
89 const char* sep = File::PathSeparator(); 89 const char* sep = File::PathSeparator();
90 do { 90 do {
91 error = ERR_get_error_line(&path, &line); 91 error = ERR_get_error_line(&path, &line);
92 const char* file = strrchr(path, sep[0]); 92 const char* file = strrchr(path, sep[0]);
93 path = file ? file + 1 : path; 93 path = file ? file + 1 : path;
94 if ((ssl != NULL) && 94 if ((ssl != NULL) && (ERR_GET_LIB(error) == ERR_LIB_SSL) &&
95 (error == ERR_PACK(ERR_R_SSL_LIB, SSL_R_CERTIFICATE_VERIFY_FAILED))) { 95 (ERR_GET_REASON(error) == SSL_R_CERTIFICATE_VERIFY_FAILED)) {
96 intptr_t result = SSL_get_verify_result(ssl); 96 intptr_t result = SSL_get_verify_result(ssl);
97 text_buffer->Printf("\n\t%s: %s (%s:%d)", ERR_reason_error_string(error), 97 text_buffer->Printf("\n\t%s: %s (%s:%d)", ERR_reason_error_string(error),
98 X509_verify_cert_error_string(result), path, line); 98 X509_verify_cert_error_string(result), path, line);
99 } else if (error != 0) { 99 } else if (error != 0) {
100 text_buffer->Printf("\n\t%s (%s:%d)", ERR_reason_error_string(error), 100 text_buffer->Printf("\n\t%s (%s:%d)", ERR_reason_error_string(error),
101 path, line); 101 path, line);
102 } 102 }
103 } while (error != 0); 103 } while (error != 0);
104 } 104 }
105 105
(...skipping 1680 matching lines...) Expand 10 before | Expand all | Expand 10 after
1786 return bytes_processed; 1786 return bytes_processed;
1787 } 1787 }
1788 1788
1789 } // namespace bin 1789 } // namespace bin
1790 } // namespace dart 1790 } // namespace dart
1791 1791
1792 #endif // defined(TARGET_OS_LINUX) 1792 #endif // defined(TARGET_OS_LINUX)
1793 1793
1794 #endif // !defined(DART_IO_DISABLED) && 1794 #endif // !defined(DART_IO_DISABLED) &&
1795 // !defined(DART_IO_SECURE_SOCKET_DISABLED) 1795 // !defined(DART_IO_SECURE_SOCKET_DISABLED)
OLDNEW
« 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