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 wrong scrape of Root Certificates #216

Merged
merged 3 commits into from
Aug 31, 2023

Conversation

alessio-perugini
Copy link
Contributor

@alessio-perugini alessio-perugini commented Aug 30, 2023

After #212 we can leverage the usage of ConnectionState.VerifiedChains and per docs:

last element is from Config.RootCAs

So the last element of the VerifiedChains will be the actual RootCA!

@codecov-commenter
Copy link

codecov-commenter commented Aug 30, 2023

Codecov Report

Patch coverage: 66.66% and project coverage change: +1.09% 🎉

Comparison is base (f07445f) 12.10% compared to head (7dc0404) 13.19%.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #216      +/-   ##
==========================================
+ Coverage   12.10%   13.19%   +1.09%     
==========================================
  Files          20       20              
  Lines        1165     1167       +2     
==========================================
+ Hits          141      154      +13     
+ Misses        971      957      -14     
- Partials       53       56       +3     
Flag Coverage Δ
unit 13.19% <66.66%> (+1.09%) ⬆️

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

Files Changed Coverage Δ
cli/certificates/flash.go 0.00% <0.00%> (ø)
certificates/certutils.go 20.00% <80.00%> (+20.00%) ⬆️

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@alessio-perugini alessio-perugini self-assigned this Aug 30, 2023
@alessio-perugini alessio-perugini added the type: imperfection Perceived defect in any part of project label Aug 30, 2023
Copy link
Member

@cmaglie cmaglie left a comment

Choose a reason for hiding this comment

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

Great catch! I've pushed a suggestion but otherwise, looks good to me.

certificates/certutils.go Outdated Show resolved Hide resolved
certificates/certutils.go Outdated Show resolved Hide resolved
certificates/certutils.go Outdated Show resolved Hide resolved
In the uno r4 we're using mbedtls which has a strange behaviour. And some root certificates won't work. Therfore the most simple solution is using all the possible ones, found during the handshake.
@per1234 per1234 added the topic: code Related to content of the project itself label Aug 30, 2023
Copy link
Contributor

@per1234 per1234 left a comment

Choose a reason for hiding this comment

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

Thanks Alessio!

@alessio-perugini alessio-perugini merged commit d945078 into main Aug 31, 2023
47 checks passed
@alessio-perugini alessio-perugini deleted the fix-bug-on-certificates-scraper branch August 31, 2023 07:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
topic: code Related to content of the project itself type: imperfection Perceived defect in any part of project
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants