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

Fix panic when parsing SSH SK pubkeys #1712

Merged
merged 1 commit into from
Sep 26, 2023

Conversation

haydentherapper
Copy link
Contributor

This is because these pubkey types do not implement ssh.CryptoPublicKey, which causes a panic when we try to do a type assertion.

Also realized we weren't handling SSH certs, so now we extract the pubkey from the cert before trying to parse it.

Had to reimplement parsing the SK pubkeys because there is no other way to extract the raw pubkey from it. After golang/go#62518, this will get cleaned up.

Summary

Release Note

Documentation

This is because these pubkey types do not implement
ssh.CryptoPublicKey, which causes a panic when we try to do
a type assertion.

Also realized we weren't handling SSH certs, so now we extract the
pubkey from the cert before trying to parse it.

Had to reimplement parsing the SK pubkeys because there is no other way
to extract the raw pubkey from it. After golang/go#62518,
this will get cleaned up.

Signed-off-by: Hayden Blauzvern <[email protected]>
@codecov
Copy link

codecov bot commented Sep 26, 2023

Codecov Report

Merging #1712 (55389da) into main (ed1fa70) will decrease coverage by 0.06%.
The diff coverage is 57.74%.

@@            Coverage Diff             @@
##             main    #1712      +/-   ##
==========================================
- Coverage   66.84%   66.79%   -0.06%     
==========================================
  Files          88       88              
  Lines        8850     8919      +69     
==========================================
+ Hits         5916     5957      +41     
- Misses       2231     2250      +19     
- Partials      703      712       +9     
Flag Coverage Δ
e2etests 48.55% <0.00%> (-0.36%) ⬇️
unittests 47.68% <57.74%> (+0.10%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files Coverage Δ
pkg/pki/ssh/ssh.go 58.39% <57.74%> (-1.90%) ⬇️

... and 2 files with indirect coverage changes

@bobcallaway bobcallaway merged commit 21102e6 into sigstore:main Sep 26, 2023
14 checks passed
@github-actions github-actions bot added this to the v1.2.2 milestone Sep 26, 2023
@haydentherapper haydentherapper deleted the fix-ssh branch September 26, 2023 14:51
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