From 5bead598a0d4042616ba0daf31d8398ff6c06eaf Mon Sep 17 00:00:00 2001 From: Brad Fitzpatrick Date: Thu, 15 Feb 2024 19:55:13 -0800 Subject: [PATCH] ocsp: don't use iota for externally defined constants Style fix: iota shouldn't be used for values that come from RFCs or things that go over the wire or to disk. Change-Id: Ib903ec1bce7e71ff81094db3de8d0b71e16f52f3 Reviewed-on: https://go-review.googlesource.com/c/crypto/+/564695 Reviewed-by: Dmitri Shuralyov Auto-Submit: Roland Shoemaker LUCI-TryBot-Result: Go LUCI Reviewed-by: Roland Shoemaker --- ocsp/ocsp.go | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/ocsp/ocsp.go b/ocsp/ocsp.go index 4269ed113b..bf2259537d 100644 --- a/ocsp/ocsp.go +++ b/ocsp/ocsp.go @@ -279,21 +279,22 @@ func getOIDFromHashAlgorithm(target crypto.Hash) asn1.ObjectIdentifier { // This is the exposed reflection of the internal OCSP structures. -// The status values that can be expressed in OCSP. See RFC 6960. +// The status values that can be expressed in OCSP. See RFC 6960. +// These are used for the Response.Status field. const ( // Good means that the certificate is valid. - Good = iota + Good = 0 // Revoked means that the certificate has been deliberately revoked. - Revoked + Revoked = 1 // Unknown means that the OCSP responder doesn't know about the certificate. - Unknown + Unknown = 2 // ServerFailed is unused and was never used (see // https://go-review.googlesource.com/#/c/18944). ParseResponse will // return a ResponseError when an error response is parsed. - ServerFailed + ServerFailed = 3 ) -// The enumerated reasons for revoking a certificate. See RFC 5280. +// The enumerated reasons for revoking a certificate. See RFC 5280. const ( Unspecified = 0 KeyCompromise = 1