Skip to content

Commit

Permalink
add struct fields in definition
Browse files Browse the repository at this point in the history
  • Loading branch information
phbnf committed Feb 25, 2025
1 parent e198b49 commit 6e16d9c
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions internal/x509util/verify.go
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ func isValid(c *x509.Certificate, certType int, currentChain []*x509.Certificate
if len(currentChain) > 0 {
child := currentChain[len(currentChain)-1]
if !bytes.Equal(child.RawIssuer, c.RawSubject) {
return x509.CertificateInvalidError{c, x509.NameMismatch, ""}
return x509.CertificateInvalidError{Cert: c, Reason: x509.NameMismatch, Detail: ""}
}
}

Expand Down Expand Up @@ -116,7 +116,7 @@ func isValid(c *x509.Certificate, certType int, currentChain []*x509.Certificate
// encryption key could only be used for Diffie-Hellman key agreement.

if certType == intermediateCertificate && (!c.BasicConstraintsValid || !c.IsCA) {
return x509.CertificateInvalidError{c, x509.NotAuthorizedToSign, ""}
return x509.CertificateInvalidError{Cert: c, Reason: x509.NotAuthorizedToSign, Detail: ""}
}

// TooManyIntermediates check deleted.
Expand Down Expand Up @@ -208,7 +208,7 @@ func Verify(c *x509.Certificate, opts VerifyOptions) (chains [][]*x509.Certifica

if len(candidateChains) == 0 {
var details []string
err = x509.CertificateInvalidError{c, x509.NoValidChains, strings.Join(details, ", ")}
err = x509.CertificateInvalidError{Cert: c, Reason: x509.NoValidChains, Detail: strings.Join(details, ", ")}

Check failure on line 211 in internal/x509util/verify.go

View workflow job for this annotation

GitHub Actions / lint

undefined: x509.NoValidChains) (typecheck)

Check failure on line 211 in internal/x509util/verify.go

View workflow job for this annotation

GitHub Actions / lint

undefined: x509.NoValidChains) (typecheck)

Check failure on line 211 in internal/x509util/verify.go

View workflow job for this annotation

GitHub Actions / lint

undefined: x509.NoValidChains (typecheck)

Check failure on line 211 in internal/x509util/verify.go

View workflow job for this annotation

GitHub Actions / lint

undefined: x509.NoValidChains) (typecheck)

Check failure on line 211 in internal/x509util/verify.go

View workflow job for this annotation

GitHub Actions / test (1.22.x, ubuntu-latest)

undefined: x509.NoValidChains

Check failure on line 211 in internal/x509util/verify.go

View workflow job for this annotation

GitHub Actions / test (1.23.x, ubuntu-latest)

undefined: x509.NoValidChains
return nil, err
}

Expand Down

0 comments on commit 6e16d9c

Please sign in to comment.