Skip to content

Commit 5bead59

Browse files
bradfitzgopherbot
authored andcommitted
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 <[email protected]> Auto-Submit: Roland Shoemaker <[email protected]> LUCI-TryBot-Result: Go LUCI <[email protected]> Reviewed-by: Roland Shoemaker <[email protected]>
1 parent 1a86580 commit 5bead59

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

ocsp/ocsp.go

+7-6
Original file line numberDiff line numberDiff line change
@@ -279,21 +279,22 @@ func getOIDFromHashAlgorithm(target crypto.Hash) asn1.ObjectIdentifier {
279279

280280
// This is the exposed reflection of the internal OCSP structures.
281281

282-
// The status values that can be expressed in OCSP. See RFC 6960.
282+
// The status values that can be expressed in OCSP. See RFC 6960.
283+
// These are used for the Response.Status field.
283284
const (
284285
// Good means that the certificate is valid.
285-
Good = iota
286+
Good = 0
286287
// Revoked means that the certificate has been deliberately revoked.
287-
Revoked
288+
Revoked = 1
288289
// Unknown means that the OCSP responder doesn't know about the certificate.
289-
Unknown
290+
Unknown = 2
290291
// ServerFailed is unused and was never used (see
291292
// https://go-review.googlesource.com/#/c/18944). ParseResponse will
292293
// return a ResponseError when an error response is parsed.
293-
ServerFailed
294+
ServerFailed = 3
294295
)
295296

296-
// The enumerated reasons for revoking a certificate. See RFC 5280.
297+
// The enumerated reasons for revoking a certificate. See RFC 5280.
297298
const (
298299
Unspecified = 0
299300
KeyCompromise = 1

0 commit comments

Comments
 (0)