Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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_CT_OBJECTS_EXTRACTOR_H_ | 5 #ifndef NET_CERT_CT_OBJECTS_EXTRACTOR_H_ |
| 6 #define NET_CERT_CT_OBJECTS_EXTRACTOR_H_ | 6 #define NET_CERT_CT_OBJECTS_EXTRACTOR_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "net/base/net_export.h" | 10 #include "net/base/net_export.h" |
| (...skipping 27 matching lines...) Expand all Loading... | |
| 38 | 38 |
| 39 // Obtains an X509Chain log entry for |leaf|, an X.509v3 certificate that | 39 // Obtains an X509Chain log entry for |leaf|, an X.509v3 certificate that |
| 40 // is not expected to contain an X.509v3 extension with the OID | 40 // is not expected to contain an X.509v3 extension with the OID |
| 41 // 1.3.6.1.4.1.11129.2.4.2 (meaning a certificate without an embedded SCT). | 41 // 1.3.6.1.4.1.11129.2.4.2 (meaning a certificate without an embedded SCT). |
| 42 // On success, fills |result| with the data for an X509Chain log entry and | 42 // On success, fills |result| with the data for an X509Chain log entry and |
| 43 // returns true. | 43 // returns true. |
| 44 // The filled |*result| should be verified using ct::CTLogVerifier::Verify | 44 // The filled |*result| should be verified using ct::CTLogVerifier::Verify |
| 45 NET_EXPORT_PRIVATE bool GetX509LogEntry(X509Certificate::OSCertHandle leaf, | 45 NET_EXPORT_PRIVATE bool GetX509LogEntry(X509Certificate::OSCertHandle leaf, |
| 46 LogEntry* result); | 46 LogEntry* result); |
| 47 | 47 |
| 48 // Extracts a SignedCertificateTimestampList that has been embedded within | |
| 49 // an OCSP response as an extension with the OID 1.3.6.1.4.1.11129.2.4.5. | |
| 50 // If the extension is present, and matches the serial number of the leaf | |
| 51 // certificate, returns true, updating |*sct_list| to contain | |
| 52 // the encoded list, minus the DER encoding necessary for the extension. | |
| 53 // |*sct_list| can then be further decoded with ct::DecodeSCTList. | |
| 54 // | |
| 55 // Note that we do response matching by serial number only so if the response | |
|
wtc
2013/12/03 01:18:06
Nit: add a comma (,) after "by serial number only"
ekasper
2013/12/03 13:50:51
Done.
| |
| 56 // contains statuses for different certificates with the same serial number, | |
| 57 // this method does not work. However, repeating serial numbers within the same | |
|
wtc
2013/12/03 01:18:06
I don't think we need to worry about this, because
ekasper
2013/12/03 13:50:51
In theory we should. In practice a collision here
| |
| 58 // OCSP response are unlikely to begin with, and since CT further only | |
| 59 // uses stapled OCSP responses which are known to pertain to the server (leaf) | |
| 60 // certificate, this is a non-concern for us. | |
| 61 NET_EXPORT_PRIVATE bool ExtractSCTListFromOCSPResponse( | |
| 62 X509Certificate::OSCertHandle leaf, | |
| 63 const std::string& ocsp_response, | |
| 64 std::string* sct_list); | |
| 65 | |
| 48 } // namespace ct | 66 } // namespace ct |
| 49 | 67 |
| 50 } // namespace net | 68 } // namespace net |
| 51 | 69 |
| 52 #endif // NET_CERT_CT_OBJECTS_EXTRACTOR_H_ | 70 #endif // NET_CERT_CT_OBJECTS_EXTRACTOR_H_ |
| OLD | NEW |