Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: CRL #214

Merged
merged 117 commits into from
Sep 18, 2024
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
Show all changes
117 commits
Select commit Hold shift + click to select a range
62aa8fc
Squashed commit of the following:
JeyJeyGao Nov 29, 2023
eef8579
test: add unit test
JeyJeyGao Dec 7, 2023
feb151c
feat: crl support
JeyJeyGao Apr 18, 2024
56da59c
fix: update
JeyJeyGao Apr 18, 2024
7d869a7
Merge remote-tracking branch 'upstream/main' into feat/crl
JeyJeyGao Apr 18, 2024
a25275e
fix: update
JeyJeyGao May 29, 2024
a262bab
fix: update crl
JeyJeyGao Jul 8, 2024
7d591d6
Merge remote-tracking branch 'upstream/main' into feat/crl
JeyJeyGao Jul 8, 2024
e66d9fd
fix: update cache
JeyJeyGao Jul 11, 2024
ac1d240
fix: update
JeyJeyGao Jul 12, 2024
e789f29
Merge remote-tracking branch 'upstream/main' into feat/crl
JeyJeyGao Jul 12, 2024
31fa5a5
fix: update test
JeyJeyGao Jul 12, 2024
039be39
fix: update
JeyJeyGao Jul 12, 2024
3b1a7ed
fix: update
JeyJeyGao Jul 12, 2024
6875035
fix: update
JeyJeyGao Jul 12, 2024
5bbd8c7
fix: update
JeyJeyGao Jul 15, 2024
39c94d3
fix: deprecate revocation Mode
JeyJeyGao Jul 15, 2024
c85d472
fix: update
JeyJeyGao Jul 15, 2024
a8db155
fix: update
JeyJeyGao Jul 15, 2024
534d11e
fix: update
JeyJeyGao Jul 16, 2024
50964ba
fix: update
JeyJeyGao Jul 16, 2024
cf593b1
fix: update
JeyJeyGao Jul 19, 2024
c172845
fix: update
JeyJeyGao Jul 19, 2024
1aa53fd
fix: update
JeyJeyGao Jul 19, 2024
2d39c35
fix: update
JeyJeyGao Jul 19, 2024
4c01b9e
fix: update
JeyJeyGao Jul 19, 2024
5787e75
fix: remove cache
JeyJeyGao Jul 22, 2024
41746fb
fix: update
JeyJeyGao Jul 22, 2024
759b727
fix: refactor
JeyJeyGao Jul 22, 2024
17da500
fix: update
JeyJeyGao Jul 23, 2024
75884a5
fix: complete test for crl package
JeyJeyGao Jul 23, 2024
e92aff7
fix: update
JeyJeyGao Jul 23, 2024
5c5c041
fix: update github action rule for branches
JeyJeyGao Jul 24, 2024
efe7708
fix: update
JeyJeyGao Jul 24, 2024
28bbf22
fix: update
JeyJeyGao Jul 24, 2024
a8f3b4b
fix: update
JeyJeyGao Jul 24, 2024
93ee863
fix: update
JeyJeyGao Jul 24, 2024
99ad04c
fix: update
JeyJeyGao Jul 24, 2024
9eb5af5
fix: update
JeyJeyGao Jul 24, 2024
38d04ce
fix: update
JeyJeyGao Jul 24, 2024
6a5357e
fix: update
JeyJeyGao Jul 24, 2024
3f9a259
fix: update
JeyJeyGao Jul 25, 2024
6bf3ca2
fix: update
JeyJeyGao Jul 25, 2024
751397b
fix: add CRL size limit
JeyJeyGao Jul 25, 2024
3170db3
fix: restore workflow and update NewWithOptions
JeyJeyGao Jul 25, 2024
8df836d
Merge branch 'main' into feat/crl_no_cache
JeyJeyGao Jul 25, 2024
041a63d
fix: update
JeyJeyGao Jul 25, 2024
e170b90
fix: update
JeyJeyGao Jul 25, 2024
1c68a17
fix: update
JeyJeyGao Jul 26, 2024
c512907
Merge 215
JeyJeyGao Aug 8, 2024
281dd64
Squashed commit of the following:
JeyJeyGao Aug 8, 2024
f833d94
Merge remote-tracking branch 'upstream/main' into feat/crl_no_cache
JeyJeyGao Aug 8, 2024
2c677c1
fix: update
JeyJeyGao Aug 8, 2024
6c0db0a
fix: update
JeyJeyGao Aug 8, 2024
cf44e31
fix: update
JeyJeyGao Aug 8, 2024
a174c20
Merge remote-tracking branch 'upstream/main' into feat/crl_no_cache
JeyJeyGao Aug 8, 2024
3a45b12
fix: update
JeyJeyGao Aug 8, 2024
950f76d
fix: update
JeyJeyGao Aug 8, 2024
e32b2d7
fix: update
JeyJeyGao Aug 8, 2024
4c41371
fix: update
JeyJeyGao Aug 8, 2024
c76c7c4
fix: resolve comments
JeyJeyGao Aug 12, 2024
9be2722
fix: update
JeyJeyGao Aug 12, 2024
3e3934c
fix: update
JeyJeyGao Aug 13, 2024
8b64025
fix: update
JeyJeyGao Aug 13, 2024
1f2b8ae
fix: update
JeyJeyGao Aug 14, 2024
1b7b38f
fix: add issuing distribution point extension
JeyJeyGao Aug 16, 2024
8f6c2c0
fix: update
JeyJeyGao Aug 16, 2024
e2acd00
fix: add delta CRL not checked error
JeyJeyGao Aug 16, 2024
174b516
fix: add comment
JeyJeyGao Aug 16, 2024
fe77e59
fix: update
JeyJeyGao Aug 16, 2024
815cc5f
fix: add license
JeyJeyGao Aug 16, 2024
c3a484e
fix: update
JeyJeyGao Aug 19, 2024
15337d4
Squashed commit of the following:
JeyJeyGao Aug 19, 2024
148a7b9
Merge remote-tracking branch 'upstream/main' into feat/crl_no_cache
JeyJeyGao Aug 19, 2024
1dafcd5
fix: update
JeyJeyGao Aug 19, 2024
1f89b49
fix: resolve comments
JeyJeyGao Aug 20, 2024
1c4cbfb
fix: update
JeyJeyGao Aug 20, 2024
3bb154f
fix: update
JeyJeyGao Aug 20, 2024
5d2ada4
fix: update
JeyJeyGao Aug 21, 2024
679dd5b
fix: update
JeyJeyGao Aug 21, 2024
f395a1a
fix: update
JeyJeyGao Aug 21, 2024
dec2a8c
fix: update
JeyJeyGao Aug 21, 2024
4a5d93b
fix: update
JeyJeyGao Aug 21, 2024
61f6c1a
fix: update
JeyJeyGao Aug 21, 2024
a42c44c
fix: update
JeyJeyGao Aug 22, 2024
9d91fb6
fix: update
JeyJeyGao Aug 22, 2024
266d814
fix: update
JeyJeyGao Aug 22, 2024
7451fbe
fix: update
JeyJeyGao Aug 22, 2024
2748835
fix: update
JeyJeyGao Aug 22, 2024
3520a7b
fix: update
JeyJeyGao Aug 22, 2024
8aadc6c
fix: update
JeyJeyGao Aug 22, 2024
22540ea
fix: update
JeyJeyGao Aug 22, 2024
bf0eadb
fix: update
JeyJeyGao Aug 22, 2024
e7fedcf
fix: update
JeyJeyGao Aug 22, 2024
d643ea2
fix: update
JeyJeyGao Aug 22, 2024
c620d85
fix: update
JeyJeyGao Aug 22, 2024
d014978
Merge branch 'main' into feat/crl_no_cache
JeyJeyGao Aug 27, 2024
ab1ed37
fix: resolve comments
JeyJeyGao Sep 11, 2024
a89a11c
Merge branch 'feat/crl_no_cache' of https://github.com/JeyJeyGao/nota…
JeyJeyGao Sep 11, 2024
a0f9d47
fix: update
JeyJeyGao Sep 11, 2024
e2cf605
fix: update
JeyJeyGao Sep 11, 2024
1ec6ed4
fix: remove CertificateHold and RemoveFromCRL check
JeyJeyGao Sep 12, 2024
04ce2f0
fix: merge CRLResult with ServerResult
JeyJeyGao Sep 12, 2024
2320086
refactor: merge CRLResult and ServerResult
JeyJeyGao Sep 12, 2024
0ebc7f9
fix: update
JeyJeyGao Sep 12, 2024
02d07e2
fix: update
JeyJeyGao Sep 12, 2024
bb2315e
fix: add license
JeyJeyGao Sep 12, 2024
4e565ec
fix: update
JeyJeyGao Sep 12, 2024
5aa15e0
fix: update
JeyJeyGao Sep 12, 2024
e2b246d
fix: update
JeyJeyGao Sep 13, 2024
982561e
fix: update
JeyJeyGao Sep 13, 2024
f4400ac
fix: update
JeyJeyGao Sep 14, 2024
f422da2
fix: update
JeyJeyGao Sep 14, 2024
50f6e6d
fix: update
JeyJeyGao Sep 14, 2024
deec55e
fix: update
JeyJeyGao Sep 14, 2024
c6132af
fix: update
JeyJeyGao Sep 14, 2024
2bf101a
fix: update
JeyJeyGao Sep 14, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 15 additions & 17 deletions revocation/internal/crl/crl.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,10 @@ import (
"net/url"
"time"

"github.com/notaryproject/notation-core-go/revocation/internal/revocation"
"github.com/notaryproject/notation-core-go/revocation/result"
)

// RevocationMethodCRL represents the CRL revocation method
const RevocationMethodCRL = 2

var (
// oidFreshestCRL is the object identifier for the distribution point
// for the delta CRL. (See RFC 5280, Section 5.2.6)
Expand Down Expand Up @@ -75,10 +73,10 @@ func CertCheckStatus(ctx context.Context, cert, issuer *x509.Certificate, opts C
return &result.CertRevocationResult{
Result: result.ResultNonRevokable,
ServerResults: []*result.ServerResult{{
RevocationMethod: RevocationMethodCRL,
RevocationMethod: revocation.MethodCRL,
Result: result.ResultNonRevokable,
}},
RevocationMethod: RevocationMethodCRL,
RevocationMethod: revocation.MethodCRL,
}
}

Expand All @@ -90,11 +88,11 @@ func CertCheckStatus(ctx context.Context, cert, issuer *x509.Certificate, opts C
// point with one CRL URI, which will be cached, so checking all the URIs is
// not a performance issue.
var (
results []*result.ServerResult
lastErr error
crlURL string
serverResults = make([]*result.ServerResult, 0, len(cert.CRLDistributionPoints))
lastErr error
crlURL string
)
for _, crlURL = range cert.CRLDistributionPoints {
for _, crlURL := range cert.CRLDistributionPoints {
JeyJeyGao marked this conversation as resolved.
Show resolved Hide resolved
baseCRL, err := download(ctx, crlURL, opts.HTTPClient)
if err != nil {
lastErr = fmt.Errorf("failed to download CRL from %s: %w", crlURL, err)
Expand All @@ -115,11 +113,11 @@ func CertCheckStatus(ctx context.Context, cert, issuer *x509.Certificate, opts C
return &result.CertRevocationResult{
Result: result.ResultRevoked,
ServerResults: []*result.ServerResult{crlResult},
RevocationMethod: RevocationMethodCRL,
RevocationMethod: revocation.MethodCRL,
}
}

results = append(results, crlResult)
serverResults = append(serverResults, crlResult)
}

if lastErr != nil {
Expand All @@ -130,16 +128,16 @@ func CertCheckStatus(ctx context.Context, cert, issuer *x509.Certificate, opts C
Result: result.ResultUnknown,
Server: crlURL,
Error: lastErr,
RevocationMethod: RevocationMethodCRL,
RevocationMethod: revocation.MethodCRL,
}},
RevocationMethod: RevocationMethodCRL,
RevocationMethod: revocation.MethodCRL,
}
}

return &result.CertRevocationResult{
Result: result.ResultOK,
ServerResults: results,
RevocationMethod: RevocationMethodCRL,
ServerResults: serverResults,
RevocationMethod: revocation.MethodCRL,
}
}

Expand Down Expand Up @@ -208,15 +206,15 @@ func checkRevocation(cert *x509.Certificate, baseCRL *x509.RevocationList, signi
return &result.ServerResult{
Result: result.ResultRevoked,
Server: crlURL,
RevocationMethod: RevocationMethodCRL,
RevocationMethod: revocation.MethodCRL,
}, nil
}
}

return &result.ServerResult{
Result: result.ResultOK,
Server: crlURL,
RevocationMethod: RevocationMethodCRL,
RevocationMethod: revocation.MethodCRL,
}, nil
}

Expand Down
10 changes: 4 additions & 6 deletions revocation/internal/ocsp/ocsp.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,11 @@
"strings"
"time"

"github.com/notaryproject/notation-core-go/revocation/internal/revocation"
"github.com/notaryproject/notation-core-go/revocation/result"
"golang.org/x/crypto/ocsp"
)

// RevocationMethodOCSP represents the OCSP revocation method
const RevocationMethodOCSP = 1

// CertCheckStatusOptions specifies values that are needed to check OCSP revocation
type CertCheckStatusOptions struct {
// HTTPClient is the HTTP client used to perform the OCSP request
Expand All @@ -61,7 +59,7 @@
return &result.CertRevocationResult{
Result: result.ResultNonRevokable,
ServerResults: []*result.ServerResult{toServerResult("", NoServerError{})},
RevocationMethod: RevocationMethodOCSP,
RevocationMethod: revocation.MethodOCSP,
}
}
ocspURLs := cert.OCSPServer
Expand All @@ -77,9 +75,9 @@
// other servers
return serverResultsToCertRevocationResult([]*result.ServerResult{serverResult})
}
serverResults[serverIndex] = serverResult

Check warning on line 78 in revocation/internal/ocsp/ocsp.go

View check run for this annotation

Codecov / codecov/patch

revocation/internal/ocsp/ocsp.go#L78

Added line #L78 was not covered by tests
}
return serverResultsToCertRevocationResult(serverResults)

Check warning on line 80 in revocation/internal/ocsp/ocsp.go

View check run for this annotation

Codecov / codecov/patch

revocation/internal/ocsp/ocsp.go#L80

Added line #L80 was not covered by tests
}

// Supported returns true if the certificate supports OCSP.
Expand Down Expand Up @@ -113,7 +111,7 @@
if _, foundNoCheck := extensionMap[pkixNoCheckOID]; !foundNoCheck {
// This will be ignored until CRL is implemented
// If it isn't found, CRL should be used to verify the OCSP response
_ = foundNoCheck // needed to bypass linter warnings (Remove after adding CRL)

Check warning on line 114 in revocation/internal/ocsp/ocsp.go

View check run for this annotation

Codecov / codecov/patch

revocation/internal/ocsp/ocsp.go#L114

Added line #L114 was not covered by tests
// TODO: add CRL support
// https://github.com/notaryproject/notation-core-go/issues/125
}
Expand Down Expand Up @@ -158,7 +156,7 @@
// that were tested.
ocspRequest, err := ocsp.CreateRequest(cert, issuer, &ocsp.RequestOptions{Hash: crypto.SHA1})
if err != nil {
return nil, GenericError{Err: err}

Check warning on line 159 in revocation/internal/ocsp/ocsp.go

View check run for this annotation

Codecov / codecov/patch

revocation/internal/ocsp/ocsp.go#L159

Added line #L159 was not covered by tests
}

var resp *http.Response
Expand All @@ -169,45 +167,45 @@
var reqURL string
reqURL, err = url.JoinPath(server, encodedReq)
if err != nil {
return nil, GenericError{Err: err}

Check warning on line 170 in revocation/internal/ocsp/ocsp.go

View check run for this annotation

Codecov / codecov/patch

revocation/internal/ocsp/ocsp.go#L170

Added line #L170 was not covered by tests
}
resp, err = opts.HTTPClient.Get(reqURL)
} else {
resp, err = postRequest(ocspRequest, server, opts.HTTPClient)

Check warning on line 174 in revocation/internal/ocsp/ocsp.go

View check run for this annotation

Codecov / codecov/patch

revocation/internal/ocsp/ocsp.go#L173-L174

Added lines #L173 - L174 were not covered by tests
}
} else {
resp, err = postRequest(ocspRequest, server, opts.HTTPClient)

Check warning on line 177 in revocation/internal/ocsp/ocsp.go

View check run for this annotation

Codecov / codecov/patch

revocation/internal/ocsp/ocsp.go#L176-L177

Added lines #L176 - L177 were not covered by tests
}

if err != nil {
var urlErr *url.Error
if errors.As(err, &urlErr) && urlErr.Timeout() {
return nil, TimeoutError{}

Check warning on line 183 in revocation/internal/ocsp/ocsp.go

View check run for this annotation

Codecov / codecov/patch

revocation/internal/ocsp/ocsp.go#L183

Added line #L183 was not covered by tests
}
return nil, GenericError{Err: err}
}
defer resp.Body.Close()

if resp.StatusCode < 200 || resp.StatusCode >= 300 {
return nil, fmt.Errorf("failed to retrieve OCSP: response had status code %d", resp.StatusCode)

Check warning on line 190 in revocation/internal/ocsp/ocsp.go

View check run for this annotation

Codecov / codecov/patch

revocation/internal/ocsp/ocsp.go#L190

Added line #L190 was not covered by tests
}

body, err := io.ReadAll(io.LimitReader(resp.Body, ocspMaxResponseSize))
if err != nil {
return nil, GenericError{Err: err}

Check warning on line 195 in revocation/internal/ocsp/ocsp.go

View check run for this annotation

Codecov / codecov/patch

revocation/internal/ocsp/ocsp.go#L195

Added line #L195 was not covered by tests
}

switch {
case bytes.Equal(body, ocsp.UnauthorizedErrorResponse):
return nil, GenericError{Err: errors.New("OCSP unauthorized")}
case bytes.Equal(body, ocsp.MalformedRequestErrorResponse):
return nil, GenericError{Err: errors.New("OCSP malformed")}
case bytes.Equal(body, ocsp.InternalErrorErrorResponse):
return nil, GenericError{Err: errors.New("OCSP internal error")}
case bytes.Equal(body, ocsp.TryLaterErrorResponse):
return nil, GenericError{Err: errors.New("OCSP try later")}
case bytes.Equal(body, ocsp.SigRequredErrorResponse):
return nil, GenericError{Err: errors.New("OCSP signature required")}

Check warning on line 208 in revocation/internal/ocsp/ocsp.go

View check run for this annotation

Codecov / codecov/patch

revocation/internal/ocsp/ocsp.go#L199-L208

Added lines #L199 - L208 were not covered by tests
}

return ocsp.ParseResponseForCert(body, cert, issuer)
Expand All @@ -232,14 +230,14 @@
// and TimeoutError
serverResult = result.NewServerResult(result.ResultUnknown, server, t)
}
serverResult.RevocationMethod = RevocationMethodOCSP
serverResult.RevocationMethod = revocation.MethodOCSP
return serverResult
}

func serverResultsToCertRevocationResult(serverResults []*result.ServerResult) *result.CertRevocationResult {
return &result.CertRevocationResult{
Result: serverResults[len(serverResults)-1].Result,
ServerResults: serverResults,
RevocationMethod: RevocationMethodOCSP,
RevocationMethod: revocation.MethodOCSP,
}
}
53 changes: 53 additions & 0 deletions revocation/internal/revocation/method.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
// Copyright The Notary Project Authors.
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

// Package revocation provides methods for checking the revocation status of a
// certificate
package revocation

// Method defines the method used to check the revocation status of a
// certificate.
type Method int

const (
// MethodUnknown is used for root certificates or when the method
// used to check the revocation status of a certificate is unknown.
MethodUnknown Method = iota

// MethodOCSP represents OCSP as the method used to check the
// revocation status of a certificate.
MethodOCSP

// MethodCRL represents CRL as the method used to check the
// revocation status of a certificate.
MethodCRL

// MethodOCSPFallbackCRL represents OCSP check with unknown error
// fallback to CRL as the method used to check the revocation status of a
// certificate.
MethodOCSPFallbackCRL
)

// String provides a conversion from a Method to a string
func (m Method) String() string {
switch m {
case MethodOCSP:
return "OCSP"
case MethodCRL:
return "CRL"
case MethodOCSPFallbackCRL:
return "OCSPFallbackCRL"
default:
return "Unknown"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -15,25 +15,23 @@ package revocation

import "testing"

func TestMethods(t *testing.T) {
t.Run("MethodUnknown", func(t *testing.T) {
if MethodUnknown != 0 {
t.Errorf("Expected %d but got %d", 0, MethodUnknown)
}
})
t.Run("MethodOCSP", func(t *testing.T) {
if MethodOCSP != 1 {
t.Errorf("Expected %d but got %d", 1, MethodOCSP)
}
})
t.Run("MethodCRL", func(t *testing.T) {
if MethodCRL != 2 {
t.Errorf("Expected %d but got %d", 1, MethodCRL)
}
})
t.Run("MethodOCSPFallbackCRL", func(t *testing.T) {
if MethodOCSPFallbackCRL != 3 {
t.Errorf("Expected %d but got %d", 3, MethodOCSPFallbackCRL)
}
})
func TestMethodString(t *testing.T) {
tests := []struct {
method Method
expected string
}{
{MethodOCSP, "OCSP"},
{MethodCRL, "CRL"},
{MethodOCSPFallbackCRL, "OCSPFallbackCRL"},
{Method(999), "Unknown"}, // Test for default case
}

for _, tt := range tests {
t.Run(tt.expected, func(t *testing.T) {
result := tt.method.String()
if result != tt.expected {
t.Errorf("expected %s, got %s", tt.expected, result)
}
})
}
}
21 changes: 12 additions & 9 deletions revocation/method.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,25 +14,28 @@
package revocation

import (
"github.com/notaryproject/notation-core-go/revocation/internal/crl"
"github.com/notaryproject/notation-core-go/revocation/internal/ocsp"
internalrevocation "github.com/notaryproject/notation-core-go/revocation/internal/revocation"
JeyJeyGao marked this conversation as resolved.
Show resolved Hide resolved
)

// Method defines the method used to check the revocation status of a
// certificate.
type Method = internalrevocation.Method

const (
// MethodUnknown is used for root certificates or when the method
// used to check the revocation status of a certificate is unknown.
MethodUnknown int = 0
MethodUnknown = internalrevocation.MethodUnknown

// MethodOCSP represents OCSP as the method used to check the
// revocation status of a certificate
MethodOCSP = ocsp.RevocationMethodOCSP
// revocation status of a certificate.
MethodOCSP = internalrevocation.MethodOCSP

// MethodCRL represents CRL as the method used to check the
// revocation status of a certificate
MethodCRL = crl.RevocationMethodCRL
// revocation status of a certificate.
MethodCRL = internalrevocation.MethodCRL

// MethodOCSPFallbackCRL represents OCSP check with unknown error
// fallback to CRL as the method used to check the revocation status of a
// certificate
MethodOCSPFallbackCRL = 3
// certificate.
MethodOCSPFallbackCRL = internalrevocation.MethodOCSPFallbackCRL
)
12 changes: 8 additions & 4 deletions revocation/result/results.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,11 @@
// Package result provides general objects that are used across revocation
package result

import "strconv"
import (
"strconv"

"github.com/notaryproject/notation-core-go/revocation/internal/revocation"
)

// Result is a type of enumerated value to help characterize revocation result.
// It can be OK, Unknown, NonRevokable, or Revoked
Expand Down Expand Up @@ -74,7 +78,7 @@ type ServerResult struct {

// RevocationMethod is the method used to check the revocation status of the
// certificate, including Unknown(0), MethodOCSP(1), MethodCRL(2)
RevocationMethod int
RevocationMethod revocation.Method
JeyJeyGao marked this conversation as resolved.
Show resolved Hide resolved
}

// NewServerResult creates a ServerResult object from its individual parts: a
Expand Down Expand Up @@ -116,6 +120,6 @@ type CertRevocationResult struct {

// RevocationMethod is the method used to check the revocation status of the
// certificate, including Unknown(0), MethodOCSP(1), MethodCRL(2) and
// OCSPFallbackCRL(3)
RevocationMethod int
// MethodOCSPFallbackCRL(3)
JeyJeyGao marked this conversation as resolved.
Show resolved Hide resolved
RevocationMethod revocation.Method
JeyJeyGao marked this conversation as resolved.
Show resolved Hide resolved
}
Loading