Skip to content

crypto/x509: invalid authority key identifier parsing older root "Starfield Class 2 Certification Authority" #46854

Description

@joeshaw

What version of Go are you using (go version)?

$ go version
go version devel go1.17-7a5e704 Mon Jun 21 14:58:02 2021 +0000 darwin/amd64

Does this issue reproduce with the latest release?

It does not reproduce with Go 1.16. It only occurs on tip on or after 51ff3a6, when the certificate parser was rewritten.

What operating system and processor architecture are you using (go env)?

darwin/amd64, macOS 11.4. It has also been reproduced on Linux.

What did you do?

Given the sample program:

package main

import (
	"crypto/x509"
	"encoding/pem"
	"io/ioutil"
	"log"
	"os"
)

func main() {
	d, err := ioutil.ReadFile(os.Args[1])
	if err != nil {
		log.Fatal(err)
	}

	block, _ := pem.Decode(d)
	_, err = x509.ParseCertificate(block.Bytes)
	if err != nil {
		log.Fatal(err)
	}
}

And the "Starfield Class 2 Certification Authority" certificate: https://crt.sh/?q=d73494e3446b02167573b3cde3ae1c8584ac26e15e45ac3ec0326708425d90fb

Running this program on Go 1.16.5 produces no error. On tip (7a5e704) following 1.17beta1, you get the error x509: invalid authority key identifier.

What did you expect to see?

The program should terminate without error.

What did you see instead?

x509: invalid authority key identifier

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions