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

Side by Side Diff: net/base/cert_test_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.cc ('k') | 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) 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 "net/base/cert_test_util.h" 5 #include "net/base/cert_test_util.h"
6 6
7 #include "build/build_config.h" 7 #include "build/build_config.h"
8 8
9 #if defined(USE_OPENSSL) 9 #if defined(USE_OPENSSL)
10 #include <openssl/err.h> 10 #include <openssl/err.h>
(...skipping 14 matching lines...) Expand all
25 #include "net/base/x509_certificate.h" 25 #include "net/base/x509_certificate.h"
26 26
27 namespace net { 27 namespace net {
28 28
29 #if defined(USE_OPENSSL) 29 #if defined(USE_OPENSSL)
30 X509Certificate* AddTemporaryRootCertToStore(X509* x509_cert) { 30 X509Certificate* AddTemporaryRootCertToStore(X509* x509_cert) {
31 if (!X509_STORE_add_cert(X509Certificate::cert_store(), x509_cert)) { 31 if (!X509_STORE_add_cert(X509Certificate::cert_store(), x509_cert)) {
32 unsigned long error_code = ERR_get_error(); 32 unsigned long error_code = ERR_get_error();
33 if (ERR_GET_LIB(error_code) != ERR_LIB_X509 || 33 if (ERR_GET_LIB(error_code) != ERR_LIB_X509 ||
34 ERR_GET_REASON(error_code) != X509_R_CERT_ALREADY_IN_HASH_TABLE) { 34 ERR_GET_REASON(error_code) != X509_R_CERT_ALREADY_IN_HASH_TABLE) {
35 base::ClearOpenSSLERRStack(); 35 base::ClearOpenSSLERRStack(FROM_HERE);
36 return NULL; 36 return NULL;
37 } 37 }
38 } 38 }
39 return X509Certificate::CreateFromHandle( 39 return X509Certificate::CreateFromHandle(
40 x509_cert, X509Certificate::SOURCE_LONE_CERT_IMPORT, 40 x509_cert, X509Certificate::SOURCE_LONE_CERT_IMPORT,
41 X509Certificate::OSCertHandles()); 41 X509Certificate::OSCertHandles());
42 } 42 }
43 43
44 X509Certificate* LoadTemporaryRootCert(const FilePath& filename) { 44 X509Certificate* LoadTemporaryRootCert(const FilePath& filename) {
45 base::EnsureOpenSSLInit(); 45 base::EnsureOpenSSLInit();
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after
147 SecCertificateRef cert_ref = static_cast<SecCertificateRef>( 147 SecCertificateRef cert_ref = static_cast<SecCertificateRef>(
148 const_cast<void*>(CFArrayGetValueAtIndex(cert_array, 0))); 148 const_cast<void*>(CFArrayGetValueAtIndex(cert_array, 0)));
149 149
150 return X509Certificate::CreateFromHandle(cert_ref, 150 return X509Certificate::CreateFromHandle(cert_ref,
151 X509Certificate::SOURCE_LONE_CERT_IMPORT, 151 X509Certificate::SOURCE_LONE_CERT_IMPORT,
152 X509Certificate::OSCertHandles()); 152 X509Certificate::OSCertHandles());
153 } 153 }
154 #endif 154 #endif
155 155
156 } // namespace net 156 } // namespace net
OLDNEW
« no previous file with comments | « base/openssl_util.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698