Skip to content

Commit

Permalink
ocsp: don't use iota for externally defined constants
Browse files Browse the repository at this point in the history
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 <dmitshur@google.com>
Auto-Submit: Roland Shoemaker <roland@golang.org>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Roland Shoemaker <roland@golang.org>
  • Loading branch information
bradfitz authored and gopherbot committed Feb 18, 2024
1 parent 1a86580 commit 5bead59
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions ocsp/ocsp.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 5bead59

Please sign in to comment.