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

Side by Side Diff: net/cert/internal/parse_ocsp.h

Issue 2144693002: Reland of Add CheckOCSPDateValid() to net/cert/internal (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add documentation, abort early. Created 4 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
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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_INTERNAL_PARSE_OCSP_H_ 5 #ifndef NET_CERT_INTERNAL_PARSE_OCSP_H_
6 #define NET_CERT_INTERNAL_PARSE_OCSP_H_ 6 #define NET_CERT_INTERNAL_PARSE_OCSP_H_
7 7
8 #include <memory> 8 #include <memory>
9 #include <string> 9 #include <string>
10 #include <vector> 10 #include <vector>
11 11
12 #include "net/base/hash_value.h" 12 #include "net/base/hash_value.h"
13 #include "net/cert/internal/parse_certificate.h" 13 #include "net/cert/internal/parse_certificate.h"
14 #include "net/cert/internal/signature_algorithm.h" 14 #include "net/cert/internal/signature_algorithm.h"
15 #include "net/der/input.h" 15 #include "net/der/input.h"
16 #include "net/der/parse_values.h" 16 #include "net/der/parse_values.h"
17 #include "net/der/parser.h" 17 #include "net/der/parser.h"
18 #include "net/der/tag.h" 18 #include "net/der/tag.h"
19 19
20 namespace base {
21 class Time;
Lei Zhang 2016/07/14 10:39:50 Luckily, TimeDelta is declared somewhere.
dadrian 2016/07/14 17:37:29 Done.
22 }
23
20 namespace net { 24 namespace net {
21 25
22 // OCSPCertID contains a representation of a DER-encoded RFC 6960 "CertID". 26 // OCSPCertID contains a representation of a DER-encoded RFC 6960 "CertID".
23 // 27 //
24 // CertID ::= SEQUENCE { 28 // CertID ::= SEQUENCE {
25 // hashAlgorithm AlgorithmIdentifier, 29 // hashAlgorithm AlgorithmIdentifier,
26 // issuerNameHash OCTET STRING, -- Hash of issuer's DN 30 // issuerNameHash OCTET STRING, -- Hash of issuer's DN
27 // issuerKeyHash OCTET STRING, -- Hash of issuer's public key 31 // issuerKeyHash OCTET STRING, -- Hash of issuer's public key
28 // serialNumber CertificateSerialNumber 32 // serialNumber CertificateSerialNumber
29 // } 33 // }
(...skipping 241 matching lines...) Expand 10 before | Expand all | Expand 10 after
271 // 4.2.2.3), the strictest response is returned (REVOKED > UNKNOWN > GOOD). 275 // 4.2.2.3), the strictest response is returned (REVOKED > UNKNOWN > GOOD).
272 // 276 //
273 // On failure |out| has an undefined state. Some of its fields may have been 277 // On failure |out| has an undefined state. Some of its fields may have been
274 // updated during parsing, whereas others may not have been changed. 278 // updated during parsing, whereas others may not have been changed.
275 NET_EXPORT_PRIVATE bool GetOCSPCertStatus( 279 NET_EXPORT_PRIVATE bool GetOCSPCertStatus(
276 const OCSPResponseData& response_data, 280 const OCSPResponseData& response_data,
277 const der::Input& issuer_tbs_certificate_tlv, 281 const der::Input& issuer_tbs_certificate_tlv,
278 const der::Input& cert_tbs_certificate_tlv, 282 const der::Input& cert_tbs_certificate_tlv,
279 OCSPCertStatus* out); 283 OCSPCertStatus* out);
280 284
285 // Returns true if |response|, a valid OCSP response with a thisUpdate field and
286 // potentially a nextUpdate field, is valid at |verify_time| and not older than
287 // |max_age|. Expressed differently, returns true if |response.thisUpdate| <=
288 // |verify_time| < response.nextUpdate, and |response.thisUpdate| >=
289 // |verify_time| - |max_age|.
290 NET_EXPORT_PRIVATE bool CheckOCSPDateValid(const OCSPSingleResponse& response,
291 const base::Time& verify_time,
292 const base::TimeDelta& max_age);
293
281 } // namespace net 294 } // namespace net
282 295
283 #endif // NET_CERT_INTERNAL_PARSE_OCSP_H_ 296 #endif // NET_CERT_INTERNAL_PARSE_OCSP_H_
OLDNEW
« no previous file with comments | « no previous file | net/cert/internal/parse_ocsp.cc » ('j') | net/cert/internal/parse_ocsp_unittest.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698