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

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

Issue 2760723002: Check X509Certificate::CreateFromHandle result. (Closed)
Patch Set: 2nd round of updates Created 3 years, 9 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
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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_CERT_X509_CERTIFICATE_H_ 5 #ifndef NET_CERT_X509_CERTIFICATE_H_
6 #define NET_CERT_X509_CERTIFICATE_H_ 6 #define NET_CERT_X509_CERTIFICATE_H_
7 7
8 #include <stddef.h> 8 #include <stddef.h>
9 #include <string.h> 9 #include <string.h>
10 10
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after
120 120
121 // The Pickle contains the certificate and any certificates that were 121 // The Pickle contains the certificate and any certificates that were
122 // stored in |intermediate_ca_certs_| at the time it was serialized. 122 // stored in |intermediate_ca_certs_| at the time it was serialized.
123 // The format is [int count], [data - this certificate], 123 // The format is [int count], [data - this certificate],
124 // [data - intermediate1], ... [data - intermediateN]. 124 // [data - intermediate1], ... [data - intermediateN].
125 // All certificates are stored in DER form. 125 // All certificates are stored in DER form.
126 PICKLETYPE_CERTIFICATE_CHAIN_V3, 126 PICKLETYPE_CERTIFICATE_CHAIN_V3,
127 }; 127 };
128 128
129 // Create an X509Certificate from a handle to the certificate object in the 129 // Create an X509Certificate from a handle to the certificate object in the
130 // underlying crypto library. 130 // underlying crypto library. Returns NULL on failure to parse or extract
131 // data from the the certificate. Note that this does not guarantee the
132 // certificate is fully parsed and validated, only that the members of this
133 // class, such as subject, issuer, expiry times, and serial number, could be
134 // successfully initialized from the certificate.
131 static scoped_refptr<X509Certificate> CreateFromHandle( 135 static scoped_refptr<X509Certificate> CreateFromHandle(
132 OSCertHandle cert_handle, 136 OSCertHandle cert_handle,
133 const OSCertHandles& intermediates); 137 const OSCertHandles& intermediates);
134 138
135 // Create an X509Certificate from a chain of DER encoded certificates. The 139 // Create an X509Certificate from a chain of DER encoded certificates. The
136 // first certificate in the chain is the end-entity certificate to which a 140 // first certificate in the chain is the end-entity certificate to which a
137 // handle is returned. The other certificates in the chain are intermediate 141 // handle is returned. The other certificates in the chain are intermediate
138 // certificates. 142 // certificates.
139 static scoped_refptr<X509Certificate> CreateFromDERCertChain( 143 static scoped_refptr<X509Certificate> CreateFromDERCertChain(
140 const std::vector<base::StringPiece>& der_certs); 144 const std::vector<base::StringPiece>& der_certs);
(...skipping 306 matching lines...) Expand 10 before | Expand all | Expand 10 after
447 // Untrusted intermediate certificates associated with this certificate 451 // Untrusted intermediate certificates associated with this certificate
448 // that may be needed for chain building. 452 // that may be needed for chain building.
449 OSCertHandles intermediate_ca_certs_; 453 OSCertHandles intermediate_ca_certs_;
450 454
451 DISALLOW_COPY_AND_ASSIGN(X509Certificate); 455 DISALLOW_COPY_AND_ASSIGN(X509Certificate);
452 }; 456 };
453 457
454 } // namespace net 458 } // namespace net
455 459
456 #endif // NET_CERT_X509_CERTIFICATE_H_ 460 #endif // NET_CERT_X509_CERTIFICATE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698