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

Side by Side Diff: net/base/x509_certificate.h

Issue 2867026: Make X509Certificate::CreateFromHandle() copy the OSCertHandle, rather than assume ownership (Closed)
Patch Set: Deleted one comment too many Created 10 years, 5 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 | « net/base/cert_test_util.cc ('k') | net/base/x509_certificate.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) 2006-2008 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2006-2008 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 #ifndef NET_BASE_X509_CERTIFICATE_H_ 5 #ifndef NET_BASE_X509_CERTIFICATE_H_
6 #define NET_BASE_X509_CERTIFICATE_H_ 6 #define NET_BASE_X509_CERTIFICATE_H_
7 7
8 #include <string.h> 8 #include <string.h>
9 9
10 #include <map> 10 #include <map>
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
75 SOURCE_LONE_CERT_IMPORT = 1, // From importing a certificate without 75 SOURCE_LONE_CERT_IMPORT = 1, // From importing a certificate without
76 // its intermediate CA certificates. 76 // its intermediate CA certificates.
77 SOURCE_FROM_NETWORK = 2, // From the network. 77 SOURCE_FROM_NETWORK = 2, // From the network.
78 }; 78 };
79 79
80 enum VerifyFlags { 80 enum VerifyFlags {
81 VERIFY_REV_CHECKING_ENABLED = 1 << 0, 81 VERIFY_REV_CHECKING_ENABLED = 1 << 0,
82 VERIFY_EV_CERT = 1 << 1, 82 VERIFY_EV_CERT = 1 << 1,
83 }; 83 };
84 84
85 // Create an X509Certificate from a handle to the certificate object 85 // Create an X509Certificate from a handle to the certificate object in the
86 // in the underlying crypto library. This is a transfer of ownership; 86 // underlying crypto library. |source| specifies where |cert_handle| comes
87 // X509Certificate will properly dispose of |cert_handle| for you. 87 // from. Given two certificate handles for the same certificate, our
88 // |source| specifies where |cert_handle| comes from. Given two 88 // certificate cache prefers the handle from the network because our HTTP
89 // certificate handles for the same certificate, our certificate cache 89 // cache isn't caching the corresponding intermediate CA certificates yet
90 // prefers the handle from the network because our HTTP cache isn't
91 // caching the corresponding intermediate CA certificates yet
92 // (http://crbug.com/7065). 90 // (http://crbug.com/7065).
93 // The list of intermediate certificates is ignored under NSS (i.e. Linux.) 91 // The list of intermediate certificates is ignored under NSS (i.e. Linux.)
94 // The returned pointer must be stored in a scoped_refptr<X509Certificate>. 92 // The returned pointer must be stored in a scoped_refptr<X509Certificate>.
95 static X509Certificate* CreateFromHandle(OSCertHandle cert_handle, 93 static X509Certificate* CreateFromHandle(OSCertHandle cert_handle,
96 Source source, 94 Source source,
97 const OSCertHandles& intermediates); 95 const OSCertHandles& intermediates);
98 96
99 // Create an X509Certificate from the BER-encoded representation. 97 // Create an X509Certificate from the BER-encoded representation.
100 // Returns NULL on failure. 98 // Returns NULL on failure.
101 // 99 //
(...skipping 198 matching lines...) Expand 10 before | Expand all | Expand 10 after
300 298
301 // Where the certificate comes from. 299 // Where the certificate comes from.
302 Source source_; 300 Source source_;
303 301
304 DISALLOW_COPY_AND_ASSIGN(X509Certificate); 302 DISALLOW_COPY_AND_ASSIGN(X509Certificate);
305 }; 303 };
306 304
307 } // namespace net 305 } // namespace net
308 306
309 #endif // NET_BASE_X509_CERTIFICATE_H_ 307 #endif // NET_BASE_X509_CERTIFICATE_H_
OLDNEW
« no previous file with comments | « net/base/cert_test_util.cc ('k') | net/base/x509_certificate.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698