Skip to content

Commit

Permalink
expose status_request
Browse files Browse the repository at this point in the history
  • Loading branch information
nathanejohnson committed Dec 15, 2019
1 parent c33807f commit e282dc3
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions intransport.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,14 +29,14 @@ type certCache struct {
c *http.Client
}

// TODO - look into status_request_v2
const statusRequestExtension = 5
// StatusRequestExtension - status_request
const StatusRequestExtension = 5

var (
// MustStapleValue is the value in the MustStaple extension.
// DER encoding of []int{5}.
// https://tools.ietf.org/html/rfc6066#section-1.1
MustStapleValue, _ = asn1.Marshal([]int{statusRequestExtension})
MustStapleValue, _ = asn1.Marshal([]int{StatusRequestExtension})

// MustStapleOID is the OID of the must staple.
// Must staple oid is id-pe-tlsfeature as defined here
Expand Down Expand Up @@ -237,7 +237,7 @@ func (it *inTranspoort) validateOCSP(serverName string, connState *tls.Connectio
return fmt.Errorf("malformed must staple extension: %w", err)
}
for _, tlsExt := range tlsExts {
if tlsExt == statusRequestExtension {
if tlsExt == StatusRequestExtension {
mustStaple = true
break
}
Expand Down
2 changes: 1 addition & 1 deletion intransport_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -586,7 +586,7 @@ func signCSR(
extVal := MustStapleValue

if multiMustStaple {
extVal, _ = asn1.Marshal([]int{2, 3, 4, statusRequestExtension})
extVal, _ = asn1.Marshal([]int{2, 3, 4, StatusRequestExtension})
}
crtTmpl := &x509.Certificate{
Signature: csr.Signature,
Expand Down

0 comments on commit e282dc3

Please sign in to comment.