Chromium Code Reviews| OLD | NEW | 
|---|---|
| (Empty) | |
| 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 | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #ifndef NET_CERT_OCSP_VERIFY_RESULT_H | |
| 6 #define NET_CERT_OCSP_VERIFY_RESULT_H | |
| 7 | |
| 8 #include <string> | |
| 9 | |
| 10 #include "base/optional.h" | |
| 11 #include "net/base/net_export.h" | |
| 12 #include "net/cert/ocsp_revocation_status.h" | |
| 13 | |
| 14 namespace net { | |
| 15 | |
| 16 // The result of OCSP verification. This always contains a ResponseStatus, which | |
| 17 // describes whether or not an OCSP response was provided, and response level | |
| 18 // errors. It optionally contains an OCSPRevocationStatus when |response_status | |
| 19 // = PROVIDED|. For example, a stapled OCSP response matching the certificate, | |
| 20 // and indicating a non-revoked status, will have |response_status = PROVIDED| | |
| 21 // and |revocation_status = GOOD|. This is populated as part of the certificate | |
| 22 // verification process, and should not be modified at other layers. | |
| 23 struct NET_EXPORT OCSPVerifyResult { | |
| 24 OCSPVerifyResult(); | |
| 25 OCSPVerifyResult(const OCSPVerifyResult&); | |
| 26 ~OCSPVerifyResult(); | |
| 27 | |
| 28 void Reset(); | |
| 
 
Ryan Sleevi
2016/07/18 20:08:08
See remarks about Reset()
 
dadrian
2016/07/18 22:23:32
Removed.
 
 | |
| 29 | |
| 30 enum ResponseStatus { | |
| 31 // No OCSPResponse was stapled. | |
| 32 MISSING, | |
| 33 | |
| 34 // An up-to-date OCSP response was stapled and matched the certificate. | |
| 35 PROVIDED, | |
| 36 | |
| 37 // The stapled OCSP response did not have a SUCCESSFUL status. | |
| 38 BAD_RESPONSE, | |
| 39 | |
| 40 // The OCSPResponseData field producedAt was outside the certificate | |
| 41 // validity period. | |
| 42 BAD_PRODUCED_AT, | |
| 43 | |
| 44 // At least one OCSPSingleResponse was stapled, but none matched the | |
| 45 // certificate. | |
| 46 NO_MATCHING_RESPONSE, | |
| 47 | |
| 48 // A matching OCSPSingleResponse was stapled, but was either expired or not | |
| 49 // yet valid. | |
| 50 INVALID_DATE, | |
| 51 | |
| 52 // The OCSPResponse structure could not be parsed. | |
| 53 PARSE_RESPONSE, | |
| 54 | |
| 55 // The OCSPResponseData structure could not be parsed. | |
| 56 PARSE_RESPONSE_DATA, | |
| 57 | |
| 58 }; | |
| 59 | |
| 60 ResponseStatus response_status; | |
| 
 
Ryan Sleevi
2016/07/18 20:08:08
From an API perspective, I'd argue that the C++11
 
dadrian
2016/07/18 22:23:32
Done.
 
 | |
| 61 | |
| 62 // The strictest CertStatus matching the certificate (REVOKED > UNKNOWN > | |
| 63 // GOOD). Only present if |response_status| = PROVIDED. | |
| 64 base::Optional<OCSPRevocationStatus> revocation_status; | |
| 
 
svaldez
2016/07/16 08:51:53
I think there's some disagreement over whether we
 
Ryan Sleevi
2016/07/18 20:08:08
Aye, I'm a hater of it, because I've generally see
 
dadrian
2016/07/18 22:23:32
Works pretty well with no optional and just a valu
 
 | |
| 65 }; | |
| 66 | |
| 67 } // namespace net | |
| 68 | |
| 69 #endif // NET_CERT_OCSP_VERIFY_RESULT_H | |
| OLD | NEW |