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 null pointer crash and incorrect error statuses #526

Merged
merged 1 commit into from
Apr 16, 2022

Conversation

haydentherapper
Copy link
Contributor

The gRPC and legacy servers did not check if the public
key was provided before accesses it, causing a null pointer exception if
no public key was provided in the request.

The errors from the gRPC server to the legacy server were being wrapped,
and the original error status was being lost.

Signed-off-by: Hayden Blauzvern hblauzvern@google.com

Summary

Ticket Link

Fixes #525

Release Note

Fixed null pointer crash and incorrect error statuses from gRPC server

@codecov-commenter
Copy link

codecov-commenter commented Apr 15, 2022

Codecov Report

Merging #526 (43878c1) into main (d834c55) will increase coverage by 0.31%.
The diff coverage is 30.00%.

❗ Current head 43878c1 differs from pull request most recent head 4c2f7a7. Consider uploading reports for the commit 4c2f7a7 to get more accurate results

@@            Coverage Diff             @@
##             main     #526      +/-   ##
==========================================
+ Coverage   33.43%   33.75%   +0.31%     
==========================================
  Files          18       18              
  Lines        1352     1357       +5     
==========================================
+ Hits          452      458       +6     
  Misses        836      836              
+ Partials       64       63       -1     
Impacted Files Coverage Δ
pkg/api/legacy_server.go 0.00% <0.00%> (ø)
pkg/api/grpc_server.go 45.73% <100.00%> (+1.01%) ⬆️
pkg/ca/fileca/load.go 68.96% <0.00%> (+10.34%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update d834c55...4c2f7a7. Read the comment docs.

@bobcallaway
Copy link
Member

Good catch; should we also add required field options in fulcio_legacy.proto?

The gRPC and legacy servers did not check if the public
key was provided before accesses it, causing a null pointer exception if
no public key was provided in the request.

The errors from the gRPC server to the legacy server were being wrapped,
and the original error status was being lost.

Signed-off-by: Hayden Blauzvern <hblauzvern@google.com>
@haydentherapper
Copy link
Contributor Author

Good idea, added!

@dlorenc dlorenc merged commit 38798fe into sigstore:main Apr 16, 2022
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.

gRPC legacy server does not return correct error statuses
4 participants