tempfork/x509: fix build on darwin and windows

These fixes were originally in the updates to CL 229917 after
Trybots failed there.
See https://go-review.googlesource.com/c/go/+/229917/1..3
This commit is contained in:
Brad Fitzpatrick
2020-04-25 08:03:10 -07:00
parent bfc1261ab6
commit 8fd8fc9c7d
3 changed files with 18 additions and 7 deletions
+5 -1
View File
@@ -38,7 +38,11 @@ func createStoreContext(leaf *Certificate, opts *VerifyOptions) (*syscall.CertCo
}
if opts.Intermediates != nil {
for _, intermediate := range opts.Intermediates.certs {
for i := 0; i < opts.Intermediates.len(); i++ {
intermediate, err := opts.Intermediates.cert(i)
if err != nil {
return nil, err
}
ctx, err := syscall.CertCreateCertificateContext(syscall.X509_ASN_ENCODING|syscall.PKCS_7_ASN_ENCODING, &intermediate.Raw[0], uint32(len(intermediate.Raw)))
if err != nil {
return nil, err