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

Add URI capability to SplitSANs method #305

Merged
merged 5 commits into from
Jun 25, 2020
Merged

Add URI capability to SplitSANs method #305

merged 5 commits into from
Jun 25, 2020

Conversation

dopey
Copy link
Contributor

@dopey dopey commented Jun 23, 2020

No description provided.

@dopey dopey requested a review from maraino June 23, 2020 18:21
@dopey dopey self-assigned this Jun 23, 2020
Copy link
Collaborator

@maraino maraino left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks ok but can you add a test with a uuid urn like:

urn:uuid:ddfe62ba-7e99-4bc1-83b3-8f57fe3e9959

@maraino maraino self-requested a review June 25, 2020 19:23
Copy link
Collaborator

@maraino maraino left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Prepend the generated uri. The rest looks ok.

template := &x509.CertificateRequest{
Subject: csr.Subject,
DNSNames: csr.DNSNames,
IPAddresses: csr.IPAddresses,
EmailAddresses: csr.EmailAddresses,
URIs: []*url.URL{uri},
URIs: append(csr.URIs, uri),
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Prepend the generated uri. There is code that expects the uuid URI to be the first one.

dnsNames = append(dnsNames, san)
} else {
uris = append(uris, u)
}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is probably not strictly ok, but I think it is good enough.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah, I wasn't sure what the right answer was. 🤷‍♂️ If / when people complain, we'll fix it.

go.mod Outdated
golang.org/x/sys v0.0.0-20200106162015-b016eb3dc98e
gopkg.in/square/go-jose.v2 v2.4.0
howett.net/plist v0.0.0-20200419221736-3b63eb3a43b5 // indirect
)

// replace github.com/smallstep/certificates => ../certificates
replace github.com/smallstep/certificates => ../certificates
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Make sure to change this.

@dopey dopey merged commit c7938f8 into master Jun 25, 2020
@maraino maraino deleted the max/get-uri branch September 9, 2020 01:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants