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

Use output to save client cert file locally #79

Merged
merged 8 commits into from
Jul 6, 2021

Conversation

lukehinds
Copy link
Member

Use output to save client cert file locally

This PR is based on top of #78

Luke Hinds added 2 commits July 6, 2021 11:01
Break condition was trying to match an empty array with nil

This resulted in no break condition and the error working down
to `error during PEM decoding`

Instead match on an empty length

Signed-off-by: Luke Hinds <lhinds@redhat.com>
Start to user the output flag to allow users to save the Client
Cert locally

Signed-off-by: Luke Hinds <lhinds@redhat.com>
@cpanato cpanato added this to the 0.1.0 milestone Jul 6, 2021
Signed-off-by: Luke Hinds <lhinds@redhat.com>
Copy link
Member

@bobcallaway bobcallaway left a comment

Choose a reason for hiding this comment

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

no need to redo the PEM decode/encode as it is done above.

cmd/sign.go Outdated Show resolved Hide resolved
cmd/sign.go Outdated Show resolved Hide resolved
cmd/sign.go Outdated Show resolved Hide resolved
break
}
certDer, restBytes := pem.Decode(remaining)

Copy link
Member

Choose a reason for hiding this comment

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

nit: maybe the extra line should be in line 53

if len(remaining) == 0 {
	break
}

certDer, restBytes := pem.Decode(remaining)
if certDer == nil {
	return nil, errors.New("error during PEM decoding")
}

cpanato
cpanato previously approved these changes Jul 6, 2021
Copy link
Member

@cpanato cpanato left a comment

Choose a reason for hiding this comment

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

lgtm, a non tiny comment

lukehinds and others added 5 commits July 6, 2021 12:36
Co-authored-by: Bob Callaway <bobcallaway@users.noreply.github.com>
Co-authored-by: Bob Callaway <bobcallaway@users.noreply.github.com>
Co-authored-by: Bob Callaway <bobcallaway@users.noreply.github.com>
Signed-off-by: Luke Hinds <lhinds@redhat.com>
Signed-off-by: Luke Hinds <lhinds@redhat.com>
@lukehinds
Copy link
Member Author

should be good now @cpanato / @bobcallaway , DCO failure is from accepting bobs commits in the gui.

@lukehinds lukehinds merged commit 8df4308 into sigstore:main Jul 6, 2021
@lukehinds lukehinds deleted the save-cert branch July 6, 2021 11:59
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.

None yet

3 participants