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

Side by Side Diff: base/openssl_util.cc

Issue 5105003: Implements Signature Creator & Verifier for openssl (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: wtc comments - change error stack tracer to use FROM_HERE Created 10 years, 1 month 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 | « base/openssl_util.h ('k') | net/base/cert_test_util.cc » ('j') | 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) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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 #include "base/openssl_util.h" 5 #include "base/openssl_util.h"
6 6
7 #include <openssl/err.h> 7 #include <openssl/err.h>
8 #include <openssl/ssl.h> 8 #include <openssl/ssl.h>
9 9
10 #include "base/lock.h" 10 #include "base/lock.h"
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
60 60
61 DISALLOW_COPY_AND_ASSIGN(OpenSSLInitSingleton); 61 DISALLOW_COPY_AND_ASSIGN(OpenSSLInitSingleton);
62 }; 62 };
63 63
64 } // namespace 64 } // namespace
65 65
66 void EnsureOpenSSLInit() { 66 void EnsureOpenSSLInit() {
67 (void)Singleton<OpenSSLInitSingleton>::get(); 67 (void)Singleton<OpenSSLInitSingleton>::get();
68 } 68 }
69 69
70 void ClearOpenSSLERRStack() { 70 void ClearOpenSSLERRStack(const tracked_objects::Location& location) {
71 if (logging::DEBUG_MODE && VLOG_IS_ON(1)) { 71 if (logging::DEBUG_MODE && VLOG_IS_ON(1)) {
72 int error_num = ERR_get_error(); 72 int error_num = ERR_get_error();
73 if (error_num == 0) 73 if (error_num == 0)
74 return; 74 return;
75 75
76 DVLOG(1) << "OpenSSL ERR_get_error stack:"; 76 std::string message;
77 location.Write(true, true, &message);
78 DVLOG(1) << "OpenSSL ERR_get_error stack from " << message;
77 char buf[140]; 79 char buf[140];
78 do { 80 do {
79 ERR_error_string_n(error_num, buf, arraysize(buf)); 81 ERR_error_string_n(error_num, buf, arraysize(buf));
80 DVLOG(1) << "\t" << error_num << ": " << buf; 82 DVLOG(1) << "\t" << error_num << ": " << buf;
81 error_num = ERR_get_error(); 83 error_num = ERR_get_error();
82 } while (error_num != 0); 84 } while (error_num != 0);
83 } else { 85 } else {
84 ERR_clear_error(); 86 ERR_clear_error();
85 } 87 }
86 } 88 }
87 89
88 } // namespace base 90 } // namespace base
OLDNEW
« no previous file with comments | « base/openssl_util.h ('k') | net/base/cert_test_util.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698